SubnetAttributes¶
-
class
aws_cdk.aws_ec2.
SubnetAttributes
(*, subnet_id, availability_zone=None, ipv4_cidr_block=None, route_table_id=None)¶ Bases:
object
- Parameters
subnet_id (
str
) – The subnetId for this particular subnet.availability_zone (
Optional
[str
]) – The Availability Zone the subnet is located in. Default: - No AZ information, cannot use AZ selection featuresipv4_cidr_block (
Optional
[str
]) – The IPv4 CIDR block associated with the subnet. Default: - No CIDR information, cannot use CIDR filter featuresroute_table_id (
Optional
[str
]) – The ID of the route table for this particular subnet. Default: - No route table information, cannot create VPC endpoints
- ExampleMetadata
infused
Example:
# Supply all properties subnet1 = ec2.Subnet.from_subnet_attributes(self, "SubnetFromAttributes", subnet_id="s-1234", availability_zone="pub-az-4465", route_table_id="rt-145" ) # Supply only subnet id subnet2 = ec2.Subnet.from_subnet_id(self, "SubnetFromId", "s-1234")
Attributes
-
availability_zone
¶ The Availability Zone the subnet is located in.
- Default
No AZ information, cannot use AZ selection features
- Return type
Optional
[str
]
-
ipv4_cidr_block
¶ The IPv4 CIDR block associated with the subnet.
- Default
No CIDR information, cannot use CIDR filter features
- Return type
Optional
[str
]
-
route_table_id
¶ The ID of the route table for this particular subnet.
- Default
No route table information, cannot create VPC endpoints
- Return type
Optional
[str
]
-
subnet_id
¶ The subnetId for this particular subnet.
- Return type
str