Class PeeringConnectionOptions
Provides a resource to manage VPC peering connection options.
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-region and cross-account scenarios.
Basic usage:
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var fooVpc = new Aws.Ec2.Vpc("fooVpc", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.0.0.0/16",
});
var bar = new Aws.Ec2.Vpc("bar", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.1.0.0/16",
});
var fooVpcPeeringConnection = new Aws.Ec2.VpcPeeringConnection("fooVpcPeeringConnection", new Aws.Ec2.VpcPeeringConnectionArgs
{
AutoAccept = true,
PeerVpcId = bar.Id,
VpcId = fooVpc.Id,
});
var fooPeeringConnectionOptions = new Aws.Ec2.PeeringConnectionOptions("fooPeeringConnectionOptions", new Aws.Ec2.PeeringConnectionOptionsArgs
{
Accepter = new Aws.Ec2.Inputs.PeeringConnectionOptionsAccepterArgs
{
AllowRemoteVpcDnsResolution = true,
},
Requester = new Aws.Ec2.Inputs.PeeringConnectionOptionsRequesterArgs
{
AllowClassicLinkToRemoteVpc = true,
AllowVpcToRemoteClassicLink = true,
},
VpcPeeringConnectionId = fooVpcPeeringConnection.Id,
});
}
}
Basic cross-account usage:
using Pulumi;
using Aws = Pulumi.Aws;
class MyStack : Stack
{
public MyStack()
{
var requester = new Aws.Provider("requester", new Aws.ProviderArgs
{
});
var accepter = new Aws.Provider("accepter", new Aws.ProviderArgs
{
});
var main = new Aws.Ec2.Vpc("main", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.0.0.0/16",
EnableDnsHostnames = true,
EnableDnsSupport = true,
});
var peerVpc = new Aws.Ec2.Vpc("peerVpc", new Aws.Ec2.VpcArgs
{
CidrBlock = "10.1.0.0/16",
EnableDnsHostnames = true,
EnableDnsSupport = true,
});
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),
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,
});
var requesterPeeringConnectionOptions = new Aws.Ec2.PeeringConnectionOptions("requesterPeeringConnectionOptions", new Aws.Ec2.PeeringConnectionOptionsArgs
{
Requester = new Aws.Ec2.Inputs.PeeringConnectionOptionsRequesterArgs
{
AllowRemoteVpcDnsResolution = true,
},
VpcPeeringConnectionId = peerVpcPeeringConnectionAccepter.Id,
});
var accepterPeeringConnectionOptions = new Aws.Ec2.PeeringConnectionOptions("accepterPeeringConnectionOptions", new Aws.Ec2.PeeringConnectionOptionsArgs
{
Accepter = new Aws.Ec2.Inputs.PeeringConnectionOptionsAccepterArgs
{
AllowRemoteVpcDnsResolution = true,
},
VpcPeeringConnectionId = peerVpcPeeringConnectionAccepter.Id,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class PeeringConnectionOptions : CustomResource
Constructors
View SourcePeeringConnectionOptions(String, PeeringConnectionOptionsArgs, CustomResourceOptions)
Create a PeeringConnectionOptions resource with the given unique name, arguments, and options.
Declaration
public PeeringConnectionOptions(string name, PeeringConnectionOptionsArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| PeeringConnectionOptionsArgs | 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<PeeringConnectionOptionsAccepter> Accepter { get; }
Property Value
| Type | Description |
|---|---|
| Output<PeeringConnectionOptionsAccepter> |
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<PeeringConnectionOptionsRequester> Requester { get; }
Property Value
| Type | Description |
|---|---|
| Output<PeeringConnectionOptionsRequester> |
VpcPeeringConnectionId
The ID of the requester VPC peering connection.
Declaration
public Output<string> VpcPeeringConnectionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, PeeringConnectionOptionsState, CustomResourceOptions)
Get an existing PeeringConnectionOptions resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static PeeringConnectionOptions Get(string name, Input<string> id, PeeringConnectionOptionsState 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. |
| PeeringConnectionOptionsState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| PeeringConnectionOptions |