Show / Hide Table of Contents

Class VpcPeeringConnectionAccepter

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 Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var peer = new Aws.Provider("peer", new Aws.ProviderArgs
    {
        Region = "us-west-2",
    });
    var main = new Aws.Ec2.Vpc("main", new Aws.Ec2.VpcArgs
    {
        CidrBlock = "10.0.0.0/16",
    });
    var peerVpc = new Aws.Ec2.Vpc("peerVpc", new Aws.Ec2.VpcArgs
    {
        CidrBlock = "10.1.0.0/16",
    });
    var peerCallerIdentity = Output.Create(Aws.GetCallerIdentity.InvokeAsync());
    // Requester's side of the connection.
    var peerVpcPeeringConnection = new Aws.Ec2.VpcPeeringConnection("peerVpcPeeringConnection", new Aws.Ec2.VpcPeeringConnectionArgs
    {
        AutoAccept = false,
        PeerOwnerId = peerCallerIdentity.Apply(peerCallerIdentity => peerCallerIdentity.AccountId),
        PeerRegion = "us-west-2",
        PeerVpcId = peerVpc.Id,
        Tags = 
        {
            { "Side", "Requester" },
        },
        VpcId = main.Id,
    });
    // Accepter's side of the connection.
    var peerVpcPeeringConnectionAccepter = new Aws.Ec2.VpcPeeringConnectionAccepter("peerVpcPeeringConnectionAccepter", new Aws.Ec2.VpcPeeringConnectionAccepterArgs
    {
        AutoAccept = true,
        Tags = 
        {
            { "Side", "Accepter" },
        },
        VpcPeeringConnectionId = peerVpcPeeringConnection.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
VpcPeeringConnectionAccepter
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class VpcPeeringConnectionAccepter : CustomResource

Constructors

View Source

VpcPeeringConnectionAccepter(String, VpcPeeringConnectionAccepterArgs, CustomResourceOptions)

Create a VpcPeeringConnectionAccepter resource with the given unique name, arguments, and options.

Declaration
public VpcPeeringConnectionAccepter(string name, VpcPeeringConnectionAccepterArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

VpcPeeringConnectionAccepterArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Accepter

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.

Declaration
public Output<VpcPeeringConnectionAccepterAccepter> Accepter { get; }
Property Value
Type Description
Output<VpcPeeringConnectionAccepterAccepter>
View Source

AcceptStatus

The status of the VPC Peering Connection request.

Declaration
public Output<string> AcceptStatus { get; }
Property Value
Type Description
Output<System.String>
View Source

AutoAccept

Whether or not to accept the peering request. Defaults to false.

Declaration
public Output<bool?> AutoAccept { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

PeerOwnerId

The AWS account ID of the owner of the requester VPC.

Declaration
public Output<string> PeerOwnerId { get; }
Property Value
Type Description
Output<System.String>
View Source

PeerRegion

The region of the accepter VPC.

Declaration
public Output<string> PeerRegion { get; }
Property Value
Type Description
Output<System.String>
View Source

PeerVpcId

The ID of the requester VPC.

Declaration
public Output<string> PeerVpcId { get; }
Property Value
Type Description
Output<System.String>
View Source

Requester

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.

Declaration
public Output<VpcPeeringConnectionAccepterRequester> Requester { get; }
Property Value
Type Description
Output<VpcPeeringConnectionAccepterRequester>
View Source

Tags

A map of tags to assign to the resource.

Declaration
public Output<ImmutableDictionary<string, object>> Tags { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.Object>>
View Source

VpcId

The ID of the accepter VPC.

Declaration
public Output<string> VpcId { get; }
Property Value
Type Description
Output<System.String>
View Source

VpcPeeringConnectionId

The VPC Peering Connection ID to manage.

Declaration
public Output<string> VpcPeeringConnectionId { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, VpcPeeringConnectionAccepterState, CustomResourceOptions)

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

Declaration
public static VpcPeeringConnectionAccepter Get(string name, Input<string> id, VpcPeeringConnectionAccepterState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

VpcPeeringConnectionAccepterState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
VpcPeeringConnectionAccepter
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.