interface VpcAttributes
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.VpcAttributes |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#VpcAttributes |
Java | software.amazon.awscdk.services.ec2.VpcAttributes |
Python | aws_cdk.aws_ec2.VpcAttributes |
TypeScript (source) | aws-cdk-lib » aws_ec2 » VpcAttributes |
Properties that reference an external Vpc.
Example
const vpc = ec2.Vpc.fromVpcAttributes(this, 'VPC', {
vpcId: 'vpc-1234',
availabilityZones: ['us-east-1a', 'us-east-1b'],
// Either pass literals for all IDs
publicSubnetIds: ['s-12345', 's-67890'],
// OR: import a list of known length
privateSubnetIds: Fn.importListValue('PrivateSubnetIds', 2),
// OR: split an imported string to a list of known length
isolatedSubnetIds: Fn.split(',', ssm.StringParameter.valueForStringParameter(this, `MyParameter`), 2),
});
Properties
Name | Type | Description |
---|---|---|
availability | string[] | List of availability zones for the subnets in this VPC. |
vpc | string | VPC's identifier. |
isolated | string[] | List of isolated subnet IDs. |
isolated | string[] | List of IPv4 CIDR blocks for the isolated subnets. |
isolated | string[] | List of names for the isolated subnets. |
isolated | string[] | List of IDs of route tables for the isolated subnets. |
private | string[] | List of private subnet IDs. |
private | string[] | List of IPv4 CIDR blocks for the private subnets. |
private | string[] | List of names for the private subnets. |
private | string[] | List of IDs of route tables for the private subnets. |
public | string[] | List of public subnet IDs. |
public | string[] | List of IPv4 CIDR blocks for the public subnets. |
public | string[] | List of names for the public subnets. |
public | string[] | List of IDs of route tables for the public subnets. |
region? | string | The region the VPC is in. |
vpc | string | VPC's CIDR range. |
vpn | string | VPN gateway's identifier. |
availabilityZones
Type:
string[]
List of availability zones for the subnets in this VPC.
vpcId
Type:
string
VPC's identifier.
isolatedSubnetIds?
Type:
string[]
(optional, default: The VPC does not have any isolated subnets)
List of isolated subnet IDs.
Must be undefined or match the availability zones in length and order.
isolatedSubnetIpv4CidrBlocks?
Type:
string[]
(optional, default: Retrieving the IPv4 CIDR block of any isolated subnet will fail)
List of IPv4 CIDR blocks for the isolated subnets.
Must be undefined or have an entry for every isolated subnet group.
isolatedSubnetNames?
Type:
string[]
(optional, default: All isolated subnets will have the name Isolated
)
List of names for the isolated subnets.
Must be undefined or have a name for every isolated subnet group.
isolatedSubnetRouteTableIds?
Type:
string[]
(optional, default: Retrieving the route table ID of any isolated subnet will fail)
List of IDs of route tables for the isolated subnets.
Must be undefined or have a name for every isolated subnet group.
privateSubnetIds?
Type:
string[]
(optional, default: The VPC does not have any private subnets)
List of private subnet IDs.
Must be undefined or match the availability zones in length and order.
privateSubnetIpv4CidrBlocks?
Type:
string[]
(optional, default: Retrieving the IPv4 CIDR block of any private subnet will fail)
List of IPv4 CIDR blocks for the private subnets.
Must be undefined or have an entry for every private subnet group.
privateSubnetNames?
Type:
string[]
(optional, default: All private subnets will have the name Private
)
List of names for the private subnets.
Must be undefined or have a name for every private subnet group.
privateSubnetRouteTableIds?
Type:
string[]
(optional, default: Retrieving the route table ID of any private subnet will fail)
List of IDs of route tables for the private subnets.
Must be undefined or have a name for every private subnet group.
publicSubnetIds?
Type:
string[]
(optional, default: The VPC does not have any public subnets)
List of public subnet IDs.
Must be undefined or match the availability zones in length and order.
publicSubnetIpv4CidrBlocks?
Type:
string[]
(optional, default: Retrieving the IPv4 CIDR block of any public subnet will fail)
List of IPv4 CIDR blocks for the public subnets.
Must be undefined or have an entry for every public subnet group.
publicSubnetNames?
Type:
string[]
(optional, default: All public subnets will have the name Public
)
List of names for the public subnets.
Must be undefined or have a name for every public subnet group.
publicSubnetRouteTableIds?
Type:
string[]
(optional, default: Retrieving the route table ID of any public subnet will fail)
List of IDs of route tables for the public subnets.
Must be undefined or have a name for every public subnet group.
region?
Type:
string
(optional, default: The region of the stack where the VPC belongs to)
The region the VPC is in.
vpcCidrBlock?
Type:
string
(optional, default: Retrieving the CIDR from the VPC will fail)
VPC's CIDR range.
vpnGatewayId?
Type:
string
(optional)
VPN gateway's identifier.