Class CfnVPCPeeringConnection
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
Inherited Members
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnVPCPeeringConnection : CfnResource, IInspectable, IVPCPeeringConnectionRef, IConstruct, IDependable, IEnvironmentAware, ITaggable
Syntax (vb)
Public Class CfnVPCPeeringConnection Inherits CfnResource Implements IInspectable, IVPCPeeringConnectionRef, IConstruct, IDependable, IEnvironmentAware, ITaggable
Remarks
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 an example, see Walkthrough: 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
AssumeRoleRegion = "assumeRoleRegion",
PeerOwnerId = "peerOwnerId",
PeerRegion = "peerRegion",
PeerRoleArn = "peerRoleArn",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
Synopsis
Constructors
| CfnVPCPeeringConnection(Construct, string, ICfnVPCPeeringConnectionProps) | Create a new |
Properties
| AssumeRoleRegion | The Region code to use when calling Security Token Service (STS) to assume the PeerRoleArn, if provided. |
| AttrId | The ID of the peering connection. |
| CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
| CfnProperties | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. |
| CfnPropertyNames | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. |
| 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 | Tag Manager which manages the tags for this resource. |
| TagsRaw | Any tags assigned to the resource. |
| VpcId | The ID of the VPC. |
| VpcPeeringConnectionRef | A reference to a VPCPeeringConnection resource. |
Methods
| ArnForVPCPeeringConnection(IVPCPeeringConnectionRef) | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. |
| FromVpcPeeringConnectionId(Construct, string, string) | Creates a new IVPCPeeringConnectionRef from a vpcPeeringConnectionId. |
| Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
| IsCfnVPCPeeringConnection(object) | Checks whether the given object is a CfnVPCPeeringConnection. |
| RenderProperties(IDictionary<string, object>) | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. |
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 string
Construct identifier for this resource (unique in its scope).
- props ICfnVPCPeeringConnectionProps
Resource properties.
Remarks
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 an example, see Walkthrough: 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
Properties
AssumeRoleRegion
The Region code to use when calling Security Token Service (STS) to assume the PeerRoleArn, if provided.
public virtual string? AssumeRoleRegion { get; set; }
Property Value
Remarks
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 an example, see Walkthrough: 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
AttrId
The ID of the peering connection.
public virtual string AttrId { get; }
Property Value
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
Remarks
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 an example, see Walkthrough: 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
CfnProperties
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
Overrides
Remarks
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 an example, see Walkthrough: 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
CfnPropertyNames
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
protected override IDictionary<string, string> CfnPropertyNames { get; }
Property Value
Overrides
Remarks
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 an example, see Walkthrough: 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
PeerOwnerId
The AWS account ID of the owner of the accepter VPC.
public virtual string? PeerOwnerId { get; set; }
Property Value
Remarks
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 an example, see Walkthrough: 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
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
Remarks
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 an example, see Walkthrough: 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
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
Remarks
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 an example, see Walkthrough: 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
PeerVpcId
The ID of the VPC with which you are creating the VPC peering connection.
public virtual string PeerVpcId { get; set; }
Property Value
Remarks
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 an example, see Walkthrough: 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
Tags
Tag Manager which manages the tags for this resource.
public virtual TagManager Tags { get; }
Property Value
Remarks
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 an example, see Walkthrough: 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
TagsRaw
Any tags assigned to the resource.
public virtual ICfnTag[]? TagsRaw { get; set; }
Property Value
ICfnTag[]
Remarks
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 an example, see Walkthrough: 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
VpcId
The ID of the VPC.
public virtual string VpcId { get; set; }
Property Value
Remarks
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 an example, see Walkthrough: 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
VpcPeeringConnectionRef
A reference to a VPCPeeringConnection resource.
public virtual IVPCPeeringConnectionReference VpcPeeringConnectionRef { get; }
Property Value
IVPCPeeringConnectionReference
Remarks
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 an example, see Walkthrough: 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
Methods
ArnForVPCPeeringConnection(IVPCPeeringConnectionRef)
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
public static string ArnForVPCPeeringConnection(IVPCPeeringConnectionRef resource)
Parameters
- resource IVPCPeeringConnectionRef
Returns
Remarks
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 an example, see Walkthrough: 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
AssumeRoleRegion = "assumeRoleRegion",
PeerOwnerId = "peerOwnerId",
PeerRegion = "peerRegion",
PeerRoleArn = "peerRoleArn",
Tags = new [] { new CfnTag {
Key = "key",
Value = "value"
} }
});
FromVpcPeeringConnectionId(Construct, string, string)
Creates a new IVPCPeeringConnectionRef from a vpcPeeringConnectionId.
public static IVPCPeeringConnectionRef FromVpcPeeringConnectionId(Construct scope, string id, string vpcPeeringConnectionId)
Parameters
Returns
Remarks
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 an example, see Walkthrough: 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
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.
Remarks
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 an example, see Walkthrough: 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
IsCfnVPCPeeringConnection(object)
Checks whether the given object is a CfnVPCPeeringConnection.
public static bool IsCfnVPCPeeringConnection(object x)
Parameters
- x object
Returns
Remarks
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 an example, see Walkthrough: 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
RenderProperties(IDictionary<string, object>)
Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection.
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props IDictionary<string, object>
Returns
Overrides
Remarks
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 an example, see Walkthrough: 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