Show / Hide Table of Contents

Class VpcPeeringConnection

Provides a resource to manage a VPC peering connection.

NOTE on VPC Peering Connections and VPC Peering Connection Options: This provider provides both a standalone VPC Peering Connection Options and a VPC Peering Connection resource with accepter and requester attributes. Do not manage options for the same VPC peering connection in both a VPC Peering Connection resource and a VPC Peering Connection Options resource. Doing so will cause a conflict of options and will overwrite the options. Using a VPC Peering Connection Options resource decouples management of the connection options from management of the VPC Peering Connection and allows options to be set correctly in cross-account scenarios.

Note: For cross-account (requester's AWS account differs from the accepter's AWS account) or inter-region VPC Peering Connections use the aws.ec2.VpcPeeringConnection resource to manage the requester's side of the connection and use the aws.ec2.VpcPeeringConnectionAccepter resource to manage the accepter's side of the connection.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
public MyStack()
{
    var foo = new Aws.Ec2.VpcPeeringConnection("foo", new Aws.Ec2.VpcPeeringConnectionArgs
    {
        PeerOwnerId = @var.Peer_owner_id,
        PeerVpcId = aws_vpc.Bar.Id,
        VpcId = aws_vpc.Foo.Id,
    });
}

}

Notes

If both VPCs are not in the same AWS account do not enable the auto_accept attribute. The accepter can manage its side of the connection using the aws.ec2.VpcPeeringConnectionAccepter resource or accept the connection manually using the AWS Management Console, AWS CLI, through SDKs, etc.

Inheritance
System.Object
Resource
CustomResource
VpcPeeringConnection
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 VpcPeeringConnection : CustomResource

Constructors

View Source

VpcPeeringConnection(String, VpcPeeringConnectionArgs, CustomResourceOptions)

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

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

The unique name of the resource

VpcPeeringConnectionArgs 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

An optional configuration block that allows for [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts the peering connection (a maximum of one).

Declaration
public Output<VpcPeeringConnectionAccepter> Accepter { get; }
Property Value
Type Description
Output<VpcPeeringConnectionAccepter>
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

Accept the peering (both VPCs need to be in the same AWS account).

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 peer VPC. Defaults to the account ID the AWS provider is currently connected to.

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

PeerRegion

The region of the accepter VPC of the [VPC Peering Connection]. auto_accept must be false, and use the aws.ec2.VpcPeeringConnectionAccepter to manage the accepter side.

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

PeerVpcId

The ID of the VPC with which you are creating the VPC Peering Connection.

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

Requester

A optional configuration block that allows for [VPC Peering Connection] (https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests the peering connection (a maximum of one).

Declaration
public Output<VpcPeeringConnectionRequester> Requester { get; }
Property Value
Type Description
Output<VpcPeeringConnectionRequester>
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 requester VPC.

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

Methods

View Source

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

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

Declaration
public static VpcPeeringConnection Get(string name, Input<string> id, VpcPeeringConnectionState 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.

VpcPeeringConnectionState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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