pulumi_wasm_providers_aws_mini::ec2

Module vpc_peering_connection_accepter

source
Expand description

Provides a resource to manage the accepter’s side of a VPC Peering Connection.

When a cross-account (requester’s AWS account differs from the accepter’s AWS account) or an inter-region VPC Peering Connection is created, a VPC Peering Connection resource is automatically created in the accepter’s account. The requester can use the aws.ec2.VpcPeeringConnection resource to manage its side of the connection and the accepter can use the aws.ec2.VpcPeeringConnectionAccepter resource to “adopt” its side of the connection into management.

§Example Usage

resources:
  main:
    type: aws:ec2:Vpc
    properties:
      cidrBlock: 10.0.0.0/16
  peerVpc:
    type: aws:ec2:Vpc
    name: peer
    properties:
      cidrBlock: 10.1.0.0/16
  # Requester's side of the connection.
  peerVpcPeeringConnection:
    type: aws:ec2:VpcPeeringConnection
    name: peer
    properties:
      vpcId: ${main.id}
      peerVpcId: ${peerVpc.id}
      peerOwnerId: ${peer.accountId}
      peerRegion: us-west-2
      autoAccept: false
      tags:
        Side: Requester
  # Accepter's side of the connection.
  peerVpcPeeringConnectionAccepter:
    type: aws:ec2:VpcPeeringConnectionAccepter
    name: peer
    properties:
      vpcPeeringConnectionId: ${peerVpcPeeringConnection.id}
      autoAccept: true
      tags:
        Side: Accepter
variables:
  peer:
    fn::invoke:
      function: aws:getCallerIdentity
      arguments: {}

§Import

Using pulumi import, import VPC Peering Connection Accepters using the Peering Connection ID. For example:

$ pulumi import aws:ec2/vpcPeeringConnectionAccepter:VpcPeeringConnectionAccepter example pcx-12345678

Certain resource arguments, like auto_accept, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the Pulumi program on an imported resource, Pulumi will always show a difference. To workaround this behavior, either omit the argument from the Pulumi program or use ignore_changes to hide the difference. For example:

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments