1. Packages
  2. Packages
  3. AWS
  4. API Docs
  5. ec2
  6. VpcPeeringConnectionAccepter
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi
aws logo
Viewing docs for AWS v5.43.0 (Older version)
published on Tuesday, Mar 10, 2026 by Pulumi

    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

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var peer = new Aws.Provider("peer", new()
        {
            Region = "us-west-2",
        });
    
        // Accepter's credentials.
        var main = new Aws.Ec2.Vpc("main", new()
        {
            CidrBlock = "10.0.0.0/16",
        });
    
        var peerVpc = new Aws.Ec2.Vpc("peerVpc", new()
        {
            CidrBlock = "10.1.0.0/16",
        }, new CustomResourceOptions
        {
            Provider = aws.Peer,
        });
    
        var peerCallerIdentity = Aws.GetCallerIdentity.Invoke();
    
        // Requester's side of the connection.
        var peerVpcPeeringConnection = new Aws.Ec2.VpcPeeringConnection("peerVpcPeeringConnection", new()
        {
            VpcId = main.Id,
            PeerVpcId = peerVpc.Id,
            PeerOwnerId = peerCallerIdentity.Apply(getCallerIdentityResult => getCallerIdentityResult.AccountId),
            PeerRegion = "us-west-2",
            AutoAccept = false,
            Tags = 
            {
                { "Side", "Requester" },
            },
        });
    
        // Accepter's side of the connection.
        var peerVpcPeeringConnectionAccepter = new Aws.Ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", new()
        {
            VpcPeeringConnectionId = peerVpcPeeringConnection.Id,
            AutoAccept = true,
            Tags = 
            {
                { "Side", "Accepter" },
            },
        }, new CustomResourceOptions
        {
            Provider = aws.Peer,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := aws.NewProvider(ctx, "peer", &aws.ProviderArgs{
    			Region: pulumi.String("us-west-2"),
    		})
    		if err != nil {
    			return err
    		}
    		main, err := ec2.NewVpc(ctx, "main", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    		peerVpc, err := ec2.NewVpc(ctx, "peerVpc", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.1.0.0/16"),
    		}, pulumi.Provider(aws.Peer))
    		if err != nil {
    			return err
    		}
    		peerCallerIdentity, err := aws.GetCallerIdentity(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		peerVpcPeeringConnection, err := ec2.NewVpcPeeringConnection(ctx, "peerVpcPeeringConnection", &ec2.VpcPeeringConnectionArgs{
    			VpcId:       main.ID(),
    			PeerVpcId:   peerVpc.ID(),
    			PeerOwnerId: *pulumi.String(peerCallerIdentity.AccountId),
    			PeerRegion:  pulumi.String("us-west-2"),
    			AutoAccept:  pulumi.Bool(false),
    			Tags: pulumi.StringMap{
    				"Side": pulumi.String("Requester"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewVpcPeeringConnectionAccepter(ctx, "peerVpcPeeringConnectionAccepter", &ec2.VpcPeeringConnectionAccepterArgs{
    			VpcPeeringConnectionId: peerVpcPeeringConnection.ID(),
    			AutoAccept:             pulumi.Bool(true),
    			Tags: pulumi.StringMap{
    				"Side": pulumi.String("Accepter"),
    			},
    		}, pulumi.Provider(aws.Peer))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.Provider;
    import com.pulumi.aws.ProviderArgs;
    import com.pulumi.aws.ec2.Vpc;
    import com.pulumi.aws.ec2.VpcArgs;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.ec2.VpcPeeringConnection;
    import com.pulumi.aws.ec2.VpcPeeringConnectionArgs;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepter;
    import com.pulumi.aws.ec2.VpcPeeringConnectionAccepterArgs;
    import com.pulumi.resources.CustomResourceOptions;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var peer = new Provider("peer", ProviderArgs.builder()        
                .region("us-west-2")
                .build());
    
            var main = new Vpc("main", VpcArgs.builder()        
                .cidrBlock("10.0.0.0/16")
                .build());
    
            var peerVpc = new Vpc("peerVpc", VpcArgs.builder()        
                .cidrBlock("10.1.0.0/16")
                .build(), CustomResourceOptions.builder()
                    .provider(aws.peer())
                    .build());
    
            final var peerCallerIdentity = AwsFunctions.getCallerIdentity();
    
            var peerVpcPeeringConnection = new VpcPeeringConnection("peerVpcPeeringConnection", VpcPeeringConnectionArgs.builder()        
                .vpcId(main.id())
                .peerVpcId(peerVpc.id())
                .peerOwnerId(peerCallerIdentity.applyValue(getCallerIdentityResult -> getCallerIdentityResult.accountId()))
                .peerRegion("us-west-2")
                .autoAccept(false)
                .tags(Map.of("Side", "Requester"))
                .build());
    
            var peerVpcPeeringConnectionAccepter = new VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", VpcPeeringConnectionAccepterArgs.builder()        
                .vpcPeeringConnectionId(peerVpcPeeringConnection.id())
                .autoAccept(true)
                .tags(Map.of("Side", "Accepter"))
                .build(), CustomResourceOptions.builder()
                    .provider(aws.peer())
                    .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const peer = new aws.Provider("peer", {region: "us-west-2"});
    // Accepter's credentials.
    const main = new aws.ec2.Vpc("main", {cidrBlock: "10.0.0.0/16"});
    const peerVpc = new aws.ec2.Vpc("peerVpc", {cidrBlock: "10.1.0.0/16"}, {
        provider: aws.peer,
    });
    const peerCallerIdentity = aws.getCallerIdentity({});
    // Requester's side of the connection.
    const peerVpcPeeringConnection = new aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection", {
        vpcId: main.id,
        peerVpcId: peerVpc.id,
        peerOwnerId: peerCallerIdentity.then(peerCallerIdentity => peerCallerIdentity.accountId),
        peerRegion: "us-west-2",
        autoAccept: false,
        tags: {
            Side: "Requester",
        },
    });
    // Accepter's side of the connection.
    const peerVpcPeeringConnectionAccepter = new aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", {
        vpcPeeringConnectionId: peerVpcPeeringConnection.id,
        autoAccept: true,
        tags: {
            Side: "Accepter",
        },
    }, {
        provider: aws.peer,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    peer = aws.Provider("peer", region="us-west-2")
    # Accepter's credentials.
    main = aws.ec2.Vpc("main", cidr_block="10.0.0.0/16")
    peer_vpc = aws.ec2.Vpc("peerVpc", cidr_block="10.1.0.0/16",
    opts=pulumi.ResourceOptions(provider=aws["peer"]))
    peer_caller_identity = aws.get_caller_identity()
    # Requester's side of the connection.
    peer_vpc_peering_connection = aws.ec2.VpcPeeringConnection("peerVpcPeeringConnection",
        vpc_id=main.id,
        peer_vpc_id=peer_vpc.id,
        peer_owner_id=peer_caller_identity.account_id,
        peer_region="us-west-2",
        auto_accept=False,
        tags={
            "Side": "Requester",
        })
    # Accepter's side of the connection.
    peer_vpc_peering_connection_accepter = aws.ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter",
        vpc_peering_connection_id=peer_vpc_peering_connection.id,
        auto_accept=True,
        tags={
            "Side": "Accepter",
        },
        opts=pulumi.ResourceOptions(provider=aws["peer"]))
    
    resources:
      peer:
        type: pulumi:providers:aws
        properties:
          region: us-west-2
      main:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.0.0.0/16
      peerVpc:
        type: aws:ec2:Vpc
        properties:
          cidrBlock: 10.1.0.0/16
        options:
          provider: ${aws.peer}
      # Requester's side of the connection.
      peerVpcPeeringConnection:
        type: aws:ec2:VpcPeeringConnection
        properties:
          vpcId: ${main.id}
          peerVpcId: ${peerVpc.id}
          peerOwnerId: ${peerCallerIdentity.accountId}
          peerRegion: us-west-2
          autoAccept: false
          tags:
            Side: Requester
      # Accepter's side of the connection.
      peerVpcPeeringConnectionAccepter:
        type: aws:ec2:VpcPeeringConnectionAccepter
        properties:
          vpcPeeringConnectionId: ${peerVpcPeeringConnection.id}
          autoAccept: true
          tags:
            Side: Accepter
        options:
          provider: ${aws.peer}
    variables:
      peerCallerIdentity:
        fn::invoke:
          Function: aws:getCallerIdentity
          Arguments: {}
    

    Create VpcPeeringConnectionAccepter Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new VpcPeeringConnectionAccepter(name: string, args: VpcPeeringConnectionAccepterArgs, opts?: CustomResourceOptions);
    @overload
    def VpcPeeringConnectionAccepter(resource_name: str,
                                     args: VpcPeeringConnectionAccepterInitArgs,
                                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def VpcPeeringConnectionAccepter(resource_name: str,
                                     opts: Optional[ResourceOptions] = None,
                                     vpc_peering_connection_id: Optional[str] = None,
                                     accepter: Optional[VpcPeeringConnectionAccepterAccepterArgs] = None,
                                     auto_accept: Optional[bool] = None,
                                     requester: Optional[VpcPeeringConnectionAccepterRequesterArgs] = None,
                                     tags: Optional[Mapping[str, str]] = None)
    func NewVpcPeeringConnectionAccepter(ctx *Context, name string, args VpcPeeringConnectionAccepterArgs, opts ...ResourceOption) (*VpcPeeringConnectionAccepter, error)
    public VpcPeeringConnectionAccepter(string name, VpcPeeringConnectionAccepterArgs args, CustomResourceOptions? opts = null)
    public VpcPeeringConnectionAccepter(String name, VpcPeeringConnectionAccepterArgs args)
    public VpcPeeringConnectionAccepter(String name, VpcPeeringConnectionAccepterArgs args, CustomResourceOptions options)
    
    type: aws:ec2:VpcPeeringConnectionAccepter
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args VpcPeeringConnectionAccepterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args VpcPeeringConnectionAccepterInitArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args VpcPeeringConnectionAccepterArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args VpcPeeringConnectionAccepterArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args VpcPeeringConnectionAccepterArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var vpcPeeringConnectionAccepterResource = new Aws.Ec2.VpcPeeringConnectionAccepter("vpcPeeringConnectionAccepterResource", new()
    {
        VpcPeeringConnectionId = "string",
        Accepter = new Aws.Ec2.Inputs.VpcPeeringConnectionAccepterAccepterArgs
        {
            AllowRemoteVpcDnsResolution = false,
        },
        AutoAccept = false,
        Requester = new Aws.Ec2.Inputs.VpcPeeringConnectionAccepterRequesterArgs
        {
            AllowRemoteVpcDnsResolution = false,
        },
        Tags = 
        {
            { "string", "string" },
        },
    });
    
    example, err := ec2.NewVpcPeeringConnectionAccepter(ctx, "vpcPeeringConnectionAccepterResource", &ec2.VpcPeeringConnectionAccepterArgs{
    	VpcPeeringConnectionId: pulumi.String("string"),
    	Accepter: &ec2.VpcPeeringConnectionAccepterAccepterArgs{
    		AllowRemoteVpcDnsResolution: pulumi.Bool(false),
    	},
    	AutoAccept: pulumi.Bool(false),
    	Requester: &ec2.VpcPeeringConnectionAccepterRequesterArgs{
    		AllowRemoteVpcDnsResolution: pulumi.Bool(false),
    	},
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    })
    
    var vpcPeeringConnectionAccepterResource = new VpcPeeringConnectionAccepter("vpcPeeringConnectionAccepterResource", VpcPeeringConnectionAccepterArgs.builder()
        .vpcPeeringConnectionId("string")
        .accepter(VpcPeeringConnectionAccepterAccepterArgs.builder()
            .allowRemoteVpcDnsResolution(false)
            .build())
        .autoAccept(false)
        .requester(VpcPeeringConnectionAccepterRequesterArgs.builder()
            .allowRemoteVpcDnsResolution(false)
            .build())
        .tags(Map.of("string", "string"))
        .build());
    
    vpc_peering_connection_accepter_resource = aws.ec2.VpcPeeringConnectionAccepter("vpcPeeringConnectionAccepterResource",
        vpc_peering_connection_id="string",
        accepter={
            "allow_remote_vpc_dns_resolution": False,
        },
        auto_accept=False,
        requester={
            "allow_remote_vpc_dns_resolution": False,
        },
        tags={
            "string": "string",
        })
    
    const vpcPeeringConnectionAccepterResource = new aws.ec2.VpcPeeringConnectionAccepter("vpcPeeringConnectionAccepterResource", {
        vpcPeeringConnectionId: "string",
        accepter: {
            allowRemoteVpcDnsResolution: false,
        },
        autoAccept: false,
        requester: {
            allowRemoteVpcDnsResolution: false,
        },
        tags: {
            string: "string",
        },
    });
    
    type: aws:ec2:VpcPeeringConnectionAccepter
    properties:
        accepter:
            allowRemoteVpcDnsResolution: false
        autoAccept: false
        requester:
            allowRemoteVpcDnsResolution: false
        tags:
            string: string
        vpcPeeringConnectionId: string
    

    VpcPeeringConnectionAccepter Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The VpcPeeringConnectionAccepter resource accepts the following input properties:

    VpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    Accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    AutoAccept bool
    Whether or not to accept the peering request. Defaults to false.
    Requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    VpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    Accepter VpcPeeringConnectionAccepterAccepterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    AutoAccept bool
    Whether or not to accept the peering request. Defaults to false.
    Requester VpcPeeringConnectionAccepterRequesterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    Tags map[string]string
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    vpcPeeringConnectionId String
    The VPC Peering Connection ID to manage.
    accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept Boolean
    Whether or not to accept the peering request. Defaults to false.
    requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Map<String,String>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    vpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept boolean
    Whether or not to accept the peering request. Defaults to false.
    requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags {[key: string]: string}
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    vpc_peering_connection_id str
    The VPC Peering Connection ID to manage.
    accepter VpcPeeringConnectionAccepterAccepterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    auto_accept bool
    Whether or not to accept the peering request. Defaults to false.
    requester VpcPeeringConnectionAccepterRequesterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Mapping[str, str]
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    vpcPeeringConnectionId String
    The VPC Peering Connection ID to manage.
    accepter Property Map
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept Boolean
    Whether or not to accept the peering request. Defaults to false.
    requester Property Map
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Map<String>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VpcPeeringConnectionAccepter resource produces the following output properties:

    AcceptStatus string
    The status of the VPC Peering Connection request.
    Id string
    The provider-assigned unique ID for this managed resource.
    PeerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    PeerRegion string
    The region of the accepter VPC.
    PeerVpcId string
    The ID of the requester VPC.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    The ID of the accepter VPC.
    AcceptStatus string
    The status of the VPC Peering Connection request.
    Id string
    The provider-assigned unique ID for this managed resource.
    PeerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    PeerRegion string
    The region of the accepter VPC.
    PeerVpcId string
    The ID of the requester VPC.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    The ID of the accepter VPC.
    acceptStatus String
    The status of the VPC Peering Connection request.
    id String
    The provider-assigned unique ID for this managed resource.
    peerOwnerId String
    The AWS account ID of the owner of the requester VPC.
    peerRegion String
    The region of the accepter VPC.
    peerVpcId String
    The ID of the requester VPC.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    The ID of the accepter VPC.
    acceptStatus string
    The status of the VPC Peering Connection request.
    id string
    The provider-assigned unique ID for this managed resource.
    peerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    peerRegion string
    The region of the accepter VPC.
    peerVpcId string
    The ID of the requester VPC.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId string
    The ID of the accepter VPC.
    accept_status str
    The status of the VPC Peering Connection request.
    id str
    The provider-assigned unique ID for this managed resource.
    peer_owner_id str
    The AWS account ID of the owner of the requester VPC.
    peer_region str
    The region of the accepter VPC.
    peer_vpc_id str
    The ID of the requester VPC.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpc_id str
    The ID of the accepter VPC.
    acceptStatus String
    The status of the VPC Peering Connection request.
    id String
    The provider-assigned unique ID for this managed resource.
    peerOwnerId String
    The AWS account ID of the owner of the requester VPC.
    peerRegion String
    The region of the accepter VPC.
    peerVpcId String
    The ID of the requester VPC.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    The ID of the accepter VPC.

    Look up Existing VpcPeeringConnectionAccepter Resource

    Get an existing VpcPeeringConnectionAccepter resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: VpcPeeringConnectionAccepterState, opts?: CustomResourceOptions): VpcPeeringConnectionAccepter
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            accept_status: Optional[str] = None,
            accepter: Optional[VpcPeeringConnectionAccepterAccepterArgs] = None,
            auto_accept: Optional[bool] = None,
            peer_owner_id: Optional[str] = None,
            peer_region: Optional[str] = None,
            peer_vpc_id: Optional[str] = None,
            requester: Optional[VpcPeeringConnectionAccepterRequesterArgs] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            vpc_id: Optional[str] = None,
            vpc_peering_connection_id: Optional[str] = None) -> VpcPeeringConnectionAccepter
    func GetVpcPeeringConnectionAccepter(ctx *Context, name string, id IDInput, state *VpcPeeringConnectionAccepterState, opts ...ResourceOption) (*VpcPeeringConnectionAccepter, error)
    public static VpcPeeringConnectionAccepter Get(string name, Input<string> id, VpcPeeringConnectionAccepterState? state, CustomResourceOptions? opts = null)
    public static VpcPeeringConnectionAccepter get(String name, Output<String> id, VpcPeeringConnectionAccepterState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2:VpcPeeringConnectionAccepter    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AcceptStatus string
    The status of the VPC Peering Connection request.
    Accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    AutoAccept bool
    Whether or not to accept the peering request. Defaults to false.
    PeerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    PeerRegion string
    The region of the accepter VPC.
    PeerVpcId string
    The ID of the requester VPC.
    Requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    The ID of the accepter VPC.
    VpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    AcceptStatus string
    The status of the VPC Peering Connection request.
    Accepter VpcPeeringConnectionAccepterAccepterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    AutoAccept bool
    Whether or not to accept the peering request. Defaults to false.
    PeerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    PeerRegion string
    The region of the accepter VPC.
    PeerVpcId string
    The ID of the requester VPC.
    Requester VpcPeeringConnectionAccepterRequesterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    Tags map[string]string
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    VpcId string
    The ID of the accepter VPC.
    VpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    acceptStatus String
    The status of the VPC Peering Connection request.
    accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept Boolean
    Whether or not to accept the peering request. Defaults to false.
    peerOwnerId String
    The AWS account ID of the owner of the requester VPC.
    peerRegion String
    The region of the accepter VPC.
    peerVpcId String
    The ID of the requester VPC.
    requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Map<String,String>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    The ID of the accepter VPC.
    vpcPeeringConnectionId String
    The VPC Peering Connection ID to manage.
    acceptStatus string
    The status of the VPC Peering Connection request.
    accepter VpcPeeringConnectionAccepterAccepter
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept boolean
    Whether or not to accept the peering request. Defaults to false.
    peerOwnerId string
    The AWS account ID of the owner of the requester VPC.
    peerRegion string
    The region of the accepter VPC.
    peerVpcId string
    The ID of the requester VPC.
    requester VpcPeeringConnectionAccepterRequester
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags {[key: string]: string}
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId string
    The ID of the accepter VPC.
    vpcPeeringConnectionId string
    The VPC Peering Connection ID to manage.
    accept_status str
    The status of the VPC Peering Connection request.
    accepter VpcPeeringConnectionAccepterAccepterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    auto_accept bool
    Whether or not to accept the peering request. Defaults to false.
    peer_owner_id str
    The AWS account ID of the owner of the requester VPC.
    peer_region str
    The region of the accepter VPC.
    peer_vpc_id str
    The ID of the requester VPC.
    requester VpcPeeringConnectionAccepterRequesterArgs
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Mapping[str, str]
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpc_id str
    The ID of the accepter VPC.
    vpc_peering_connection_id str
    The VPC Peering Connection ID to manage.
    acceptStatus String
    The status of the VPC Peering Connection request.
    accepter Property Map
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the accepter VPC.
    autoAccept Boolean
    Whether or not to accept the peering request. Defaults to false.
    peerOwnerId String
    The AWS account ID of the owner of the requester VPC.
    peerRegion String
    The region of the accepter VPC.
    peerVpcId String
    The ID of the requester VPC.
    requester Property Map
    A configuration block that describes [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options set for the requester VPC.
    tags Map<String>
    A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    vpcId String
    The ID of the accepter VPC.
    vpcPeeringConnectionId String
    The VPC Peering Connection ID to manage.

    Supporting Types

    VpcPeeringConnectionAccepterAccepter, VpcPeeringConnectionAccepterAccepterArgs

    AllowClassicLinkToRemoteVpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    AllowRemoteVpcDnsResolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    AllowVpcToRemoteClassicLink bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    AllowClassicLinkToRemoteVpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    AllowRemoteVpcDnsResolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    AllowVpcToRemoteClassicLink bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc Boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution Boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink Boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allow_classic_link_to_remote_vpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allow_remote_vpc_dns_resolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allow_vpc_to_remote_classic_link bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc Boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution Boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink Boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    VpcPeeringConnectionAccepterRequester, VpcPeeringConnectionAccepterRequesterArgs

    AllowClassicLinkToRemoteVpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    AllowRemoteVpcDnsResolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    AllowVpcToRemoteClassicLink bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    AllowClassicLinkToRemoteVpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    AllowRemoteVpcDnsResolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    AllowVpcToRemoteClassicLink bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc Boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution Boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink Boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allow_classic_link_to_remote_vpc bool
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allow_remote_vpc_dns_resolution bool
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allow_vpc_to_remote_classic_link bool
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    allowClassicLinkToRemoteVpc Boolean
    Indicates whether a local ClassicLink connection can communicate with the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_classic_link_to_remote_vpc attribute has been deprecated and will be removed in a future version.

    allowRemoteVpcDnsResolution Boolean
    Indicates whether a local VPC can resolve public DNS hostnames to private IP addresses when queried from instances in a peer VPC.
    allowVpcToRemoteClassicLink Boolean
    Indicates whether a local VPC can communicate with a ClassicLink connection in the peer VPC over the VPC Peering Connection.

    Deprecated: With the retirement of EC2-Classic the allow_vpc_to_remote_classic_link attribute has been deprecated and will be removed in a future version.

    Import

    VPC Peering Connection Accepters can be imported by using the Peering Connection ID, e.g.,

     $ 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 provider configuration on an imported resource, this provder will always show a difference. To workaround this behavior, either omit the argument from the configuration or use ignoreChanges to hide the difference, e.g. terraform resource “aws_vpc_peering_connection_accepter” “example” {

    … other configuration …

    There is no AWS EC2 API for reading auto_accept

    lifecycle {

    ignore_changes = [auto_accept]

    } }

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo
    Viewing docs for AWS v5.43.0 (Older version)
    published on Tuesday, Mar 10, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial