interface VpcAttributes
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.VpcAttributes |
Java | software.amazon.awscdk.services.ec2.VpcAttributes |
Python | aws_cdk.aws_ec2.VpcAttributes |
TypeScript (source) | @aws-cdk/aws-ec2 » VpcAttributes |
Properties that reference an external Vpc.
Example
const sg = ec2.SecurityGroup.fromSecurityGroupId(this, 'FsxSecurityGroup', '{SECURITY-GROUP-ID}');
const fs = fsx.LustreFileSystem.fromLustreFileSystemAttributes(this, 'FsxLustreFileSystem', {
dnsName: '{FILE-SYSTEM-DNS-NAME}',
fileSystemId: '{FILE-SYSTEM-ID}',
securityGroup: sg,
});
const vpc = ec2.Vpc.fromVpcAttributes(this, 'Vpc', {
availabilityZones: ['us-west-2a', 'us-west-2b'],
publicSubnetIds: ['{US-WEST-2A-SUBNET-ID}', '{US-WEST-2B-SUBNET-ID}'],
vpcId: '{VPC-ID}',
});
const inst = new ec2.Instance(this, 'inst', {
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T2, ec2.InstanceSize.LARGE),
machineImage: new ec2.AmazonLinuxImage({
generation: ec2.AmazonLinuxGeneration.AMAZON_LINUX_2,
}),
vpc,
vpcSubnets: {
subnetType: ec2.SubnetType.PUBLIC,
},
});
fs.connections.allowDefaultPortFrom(inst);
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 names for the isolated subnets. |
isolated | string[] | List of IDs of routing tables for the isolated subnets. |
private | string[] | List of private subnet IDs. |
private | string[] | List of names for the private subnets. |
private | string[] | List of IDs of routing tables for the private subnets. |
public | string[] | List of public subnet IDs. |
public | string[] | List of names for the public subnets. |
public | string[] | List of IDs of routing tables for the public subnets. |
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)
List of isolated subnet IDs.
Must be undefined or match the availability zones in length and order.
isolatedSubnetNames?
Type:
string[]
(optional)
List of names for the isolated subnets.
Must be undefined or have a name for every isolated subnet group.
isolatedSubnetRouteTableIds?
Type:
string[]
(optional)
List of IDs of routing tables for the isolated subnets.
Must be undefined or have a name for every isolated subnet group.
privateSubnetIds?
Type:
string[]
(optional)
List of private subnet IDs.
Must be undefined or match the availability zones in length and order.
privateSubnetNames?
Type:
string[]
(optional)
List of names for the private subnets.
Must be undefined or have a name for every private subnet group.
privateSubnetRouteTableIds?
Type:
string[]
(optional)
List of IDs of routing tables for the private subnets.
Must be undefined or have a name for every private subnet group.
publicSubnetIds?
Type:
string[]
(optional)
List of public subnet IDs.
Must be undefined or match the availability zones in length and order.
publicSubnetNames?
Type:
string[]
(optional)
List of names for the public subnets.
Must be undefined or have a name for every public subnet group.
publicSubnetRouteTableIds?
Type:
string[]
(optional)
List of IDs of routing tables for the public subnets.
Must be undefined or have a name for every public subnet group.
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.