Class CfnVPCPeeringConnection
A CloudFormation AWS::EC2::VPCPeeringConnection
.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class CfnVPCPeeringConnection : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnVPCPeeringConnection
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. The accepter VPC can belong to a different AWS account and can be in a different Region than the requester VPC.
The requester VPC and accepter VPC cannot have overlapping CIDR blocks. If you create a VPC peering connection request between VPCs with overlapping CIDR blocks, the VPC peering connection has a status of failed
.
If the VPCs belong to different accounts, the acceptor account must have a role that allows the requester account to accept the VPC peering connection. For more information, see Walkthough: Peer with a VPC in another AWS account .
If the requester and acceptor VPCs are in the same account, the peering request is accepted without a peering role.
CloudformationResource: AWS::EC2::VPCPeeringConnection
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var cfnVPCPeeringConnection = new CfnVPCPeeringConnection(this, "MyCfnVPCPeeringConnection", new CfnVPCPeeringConnectionProps {
PeerVpcId = "peerVpcId",
VpcId = "vpcId",
// the properties below are optional
PeerOwnerId = "peerOwnerId",
PeerRegion = "peerRegion",
PeerRoleArn = "peerRoleArn",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
CfnVPCPeeringConnection(Construct, String, ICfnVPCPeeringConnectionProps) | Create a new |
CfnVPCPeeringConnection(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnVPCPeeringConnection(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
AttrId | The ID of the peering connection. |
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
PeerOwnerId | The AWS account ID of the owner of the accepter VPC. |
PeerRegion | The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request. |
PeerRoleArn | The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account. |
PeerVpcId | The ID of the VPC with which you are creating the VPC peering connection. |
Tags | Any tags assigned to the resource. |
VpcId | The ID of the VPC. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnVPCPeeringConnection(Construct, String, ICfnVPCPeeringConnectionProps)
Create a new AWS::EC2::VPCPeeringConnection
.
public CfnVPCPeeringConnection(Construct scope, string id, ICfnVPCPeeringConnectionProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnVPCPeeringConnectionProps
- resource properties.
CfnVPCPeeringConnection(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnVPCPeeringConnection(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnVPCPeeringConnection(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnVPCPeeringConnection(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
AttrId
The ID of the peering connection.
public virtual string AttrId { get; }
Property Value
System.String
Remarks
CloudformationAttribute: Id
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
PeerOwnerId
The AWS account ID of the owner of the accepter VPC.
public virtual string PeerOwnerId { get; set; }
Property Value
System.String
Remarks
PeerRegion
The Region code for the accepter VPC, if the accepter VPC is located in a Region other than the Region in which you make the request.
public virtual string PeerRegion { get; set; }
Property Value
System.String
Remarks
Default: The Region in which you make the request.
PeerRoleArn
The Amazon Resource Name (ARN) of the VPC peer role for the peering connection in another AWS account.
public virtual string PeerRoleArn { get; set; }
Property Value
System.String
Remarks
This is required when you are peering a VPC in a different AWS account.
PeerVpcId
The ID of the VPC with which you are creating the VPC peering connection.
public virtual string PeerVpcId { get; set; }
Property Value
System.String
Remarks
You must specify this parameter in the request.
Tags
Any tags assigned to the resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
VpcId
The ID of the VPC.
public virtual string VpcId { get; set; }
Property Value
System.String
Remarks
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>