interface SubnetAttributes
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.SubnetAttributes |
Java | software.amazon.awscdk.services.ec2.SubnetAttributes |
Python | aws_cdk.aws_ec2.SubnetAttributes |
TypeScript (source) | @aws-cdk/aws-ec2 » SubnetAttributes |
Example
// Supply all properties
const subnet1 = ec2.Subnet.fromSubnetAttributes(this, 'SubnetFromAttributes', {
subnetId: 's-1234',
availabilityZone: 'pub-az-4465',
routeTableId: 'rt-145'
});
// Supply only subnet id
const subnet2 = ec2.Subnet.fromSubnetId(this, 'SubnetFromId', 's-1234');
Properties
Name | Type | Description |
---|---|---|
subnet | string | The subnetId for this particular subnet. |
availability | string | The Availability Zone the subnet is located in. |
ipv4 | string | The IPv4 CIDR block associated with the subnet. |
route | string | The ID of the route table for this particular subnet. |
subnetId
Type:
string
The subnetId for this particular subnet.
availabilityZone?
Type:
string
(optional, default: No AZ information, cannot use AZ selection features)
The Availability Zone the subnet is located in.
ipv4CidrBlock?
Type:
string
(optional, default: No CIDR information, cannot use CIDR filter features)
The IPv4 CIDR block associated with the subnet.
routeTableId?
Type:
string
(optional, default: No route table information, cannot create VPC endpoints)
The ID of the route table for this particular subnet.