Skip to content
v2.277.0

Experimental

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

VPCPeeringConnectionProps Struct ​

Properties to define a VPC peering connection.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as ec2_alpha from '@aws-cdk/aws-ec2-alpha';

declare const vpcV2: ec2_alpha.VpcV2;
const vPCPeeringConnectionProps: ec2_alpha.VPCPeeringConnectionProps = {
  acceptorVpc: vpcV2,
  requestorVpc: vpcV2,

  // the properties below are optional
  peerRoleArn: 'peerRoleArn',
  vpcPeeringConnectionName: 'vpcPeeringConnectionName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_ec2_alpha as ec2_alpha

# vpc_v2: ec2_alpha.VpcV2

v_pc_peering_connection_props = ec2_alpha.VPCPeeringConnectionProps(
    acceptor_vpc=vpc_v2,
    requestor_vpc=vpc_v2,

    # the properties below are optional
    peer_role_arn="peerRoleArn",
    vpc_peering_connection_name="vpcPeeringConnectionName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.alpha.*;

VpcV2 vpcV2;

VPCPeeringConnectionProps vPCPeeringConnectionProps = VPCPeeringConnectionProps.builder()
        .acceptorVpc(vpcV2)
        .requestorVpc(vpcV2)

        // the properties below are optional
        .peerRoleArn("peerRoleArn")
        .vpcPeeringConnectionName("vpcPeeringConnectionName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ec2.Alpha
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ec2.Alpha;

VpcV2 vpcV2;

var vPCPeeringConnectionProps = new VPCPeeringConnectionProps {
    AcceptorVpc = vpcV2,
    RequestorVpc = vpcV2,

    // the properties below are optional
    PeerRoleArn = "peerRoleArn",
    VpcPeeringConnectionName = "vpcPeeringConnectionName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awsec2alpha/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import ec2_alpha "github.com/aws/aws-cdk-go/awsec2alpha"

var vpcV2 VpcV2

vPCPeeringConnectionProps := &VPCPeeringConnectionProps{
	AcceptorVpc: vpcV2,
	RequestorVpc: vpcV2,

	// the properties below are optional
	PeerRoleArn: jsii.String("peerRoleArn"),
	VpcPeeringConnectionName: jsii.String("vpcPeeringConnectionName"),
}

Properties ​

acceptorVpcIVpcV2acceptor_vpcIVpcV2acceptorVpcIVpcV2AcceptorVpcIVpcV2AcceptorVpcIVpcV2 required #
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

requestorVpcIVpcV2requestor_vpcIVpcV2requestorVpcIVpcV2RequestorVpcIVpcV2RequestorVpcIVpcV2 required #
The VPC that is requesting the peering connection.
vpcPeeringConnectionNameoptionalstringvpc_peering_connection_nameoptionalstrvpcPeeringConnectionNameoptionalStringVpcPeeringConnectionNameoptionalstringVpcPeeringConnectionNameoptional*string #
The resource name of the peering connection.

Default: peering connection provisioned without any name