interface VPCPeeringConnectionOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ec2.Alpha.VPCPeeringConnectionOptions |
Go | github.com/aws/aws-cdk-go/awsec2alpha/v2#VPCPeeringConnectionOptions |
Java | software.amazon.awscdk.services.ec2.alpha.VPCPeeringConnectionOptions |
Python | aws_cdk.aws_ec2_alpha.VPCPeeringConnectionOptions |
TypeScript (source) | @aws-cdk/aws-ec2-alpha » VPCPeeringConnectionOptions |
Options to define a VPC peering connection.
Example
const stack = new Stack();
const acceptorVpc = new VpcV2(this, 'VpcA', {
primaryAddressBlock: IpAddresses.ipv4('10.0.0.0/16'),
});
const requestorVpc = new VpcV2(this, 'VpcB', {
primaryAddressBlock: IpAddresses.ipv4('10.1.0.0/16'),
});
const peeringConnection = requestorVpc.createPeeringConnection('peeringConnection', {
acceptorVpc: acceptorVpc,
});
const routeTable = new RouteTable(this, 'RouteTable', {
vpc: requestorVpc,
});
routeTable.addRoute('vpcPeeringRoute', '10.0.0.0/16', { gateway: peeringConnection });
Properties
Name | Type | Description |
---|---|---|
acceptor | IVpc | The VPC that is accepting the peering connection. |
peer | string | The role arn created in the acceptor account. |
vpc | string | The resource name of the peering connection. |
acceptorVpc
Type:
IVpc
The VPC that is accepting the peering connection.
peerRoleArn?
Type:
string
(optional, default: no peerRoleArn needed if not cross account connection)
The role arn created in the acceptor account.
vpcPeeringConnectionName?
Type:
string
(optional, default: peering connection provisioned without any name)
The resource name of the peering connection.