Skip to content
v2.274.0

Experimental

@aws-cdk/aws-ec2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

VPCPeeringConnectionOptions Struct ​

Options to define a VPC peering connection.

Example ​

ts
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 ​

acceptorVpcIVpcV2acceptor_vpcIVpcV2acceptorVpcIVpcV2AcceptorVpcIVpcV2AcceptorVpcIVpcV2required#
The VPC that is accepting the peering connection.
peerRoleArnoptionalstringpeer_role_arnoptionalstrpeerRoleArnoptionalStringPeerRoleArnoptionalstringPeerRoleArnoptional*string#
The role arn created in the acceptor account.

Default: no peerRoleArn needed if not cross account connection

vpcPeeringConnectionNameoptionalstringvpc_peering_connection_nameoptionalstrvpcPeeringConnectionNameoptionalStringVpcPeeringConnectionNameoptionalstringVpcPeeringConnectionNameoptional*string#
The resource name of the peering connection.

Default: peering connection provisioned without any name