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
accepterandrequesterattributes. 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.VpcPeeringConnectionresource to manage the requester's side of the connection and use theaws.ec2.VpcPeeringConnectionAccepterresource 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.
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class VpcPeeringConnection : CustomResource
Constructors
View SourceVpcPeeringConnection(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 SourceAccepter
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> |
AcceptStatus
The status of the VPC Peering Connection request.
Declaration
public Output<string> AcceptStatus { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
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> |
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> |
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> |
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> |
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>> |
VpcId
The ID of the requester VPC.
Declaration
public Output<string> VpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |