interface VpcV2Attributes
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.ec2.Alpha.VpcV2Attributes |
![]() | github.com/aws/aws-cdk-go/awsec2alpha/v2#VpcV2Attributes |
![]() | software.amazon.awscdk.services.ec2.alpha.VpcV2Attributes |
![]() | aws_cdk.aws_ec2_alpha.VpcV2Attributes |
![]() | @aws-cdk/aws-ec2-alpha ยป VpcV2Attributes |
Options to import a VPC created outside of CDK stack.
Example
const stack = new Stack();
const acceptorVpc = VpcV2.fromVpcV2Attributes(this, 'acceptorVpc', {
vpcId: 'vpc-XXXX',
vpcCidrBlock: '10.0.0.0/16',
region: 'us-east-2',
ownerAccountId: '111111111111',
});
const acceptorRoleArn = 'arn:aws:iam::111111111111:role/VpcPeeringRole';
const requestorVpc = new VpcV2(this, 'VpcB', {
primaryAddressBlock: IpAddresses.ipv4('10.1.0.0/16'),
});
const peeringConnection = requestorVpc.createPeeringConnection('crossAccountCrossRegionPeering', {
acceptorVpc: acceptorVpc,
peerRoleArn: acceptorRoleArn,
});
Properties
Name | Type | Description |
---|---|---|
vpc | string | Primary VPC CIDR Block of the imported VPC Can only be IPv4. |
vpc | string | The VPC ID Refers to physical Id of the resource. |
owner | string | The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection. |
region? | string | Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection. |
secondary | VPCCidr [] | Import Secondary CIDR blocks associated with VPC. |
subnets? | Subnet [] | Subnets associated with imported VPC. |
vpn | string | A VPN Gateway is attached to the VPC. |
vpcCidrBlock
Type:
string
Primary VPC CIDR Block of the imported VPC Can only be IPv4.
vpcId
Type:
string
The VPC ID Refers to physical Id of the resource.
ownerAccountId?
Type:
string
(optional, default: constructed with stack account value)
The ID of the AWS account that owns the imported VPC required in case of cross account VPC as given value will be used to set field account for imported VPC, which then later can be used for establishing VPC peering connection.
region?
Type:
string
(optional, default: constructed with stack region value)
Region in which imported VPC is hosted required in case of cross region VPC as given value will be used to set field region for imported VPC, which then later can be used for establishing VPC peering connection.
secondaryCidrBlocks?
Type:
VPCCidr
[]
(optional, default: No secondary IP address)
Import Secondary CIDR blocks associated with VPC.
subnets?
Type:
Subnet
[]
(optional, default: no subnets provided to be imported)
Subnets associated with imported VPC.
vpnGatewayId?
Type:
string
(optional, default: No VPN Gateway)
A VPN Gateway is attached to the VPC.