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,
});
}
}
Inherited Members
Namespace: Pulumi.Aws.Ec2
Assembly: Pulumi.Aws.dll
Syntax
public class VpcPeeringConnectionAccepter : CustomResource
Constructors
View SourceVpcPeeringConnectionAccepter(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 SourceAccepter
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> |
AcceptStatus
The status of the VPC Peering Connection request.
Declaration
public Output<string> AcceptStatus { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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>> |
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> |
PeerRegion
The region of the accepter VPC.
Declaration
public Output<string> PeerRegion { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PeerVpcId
The ID of the requester VPC.
Declaration
public Output<string> PeerVpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
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 accepter VPC.
Declaration
public Output<string> VpcId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VpcPeeringConnectionId
The VPC Peering Connection ID to manage.
Declaration
public Output<string> VpcPeeringConnectionId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(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 |