Skip to content
v2.274.0

Experimental

@aws-cdk/aws-ec2-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

SubnetV2Attributes Struct ​

Properties required to import a subnet.

Example ​

ts
SubnetV2.fromSubnetV2Attributes(this, 'ImportedSubnet', {
  subnetId: 'subnet-0123456789abcdef0',
  availabilityZone: 'us-west-2a',
  ipv4CidrBlock: '10.2.0.0/24',
  routeTableId: 'rtb-0871c310f98da2cbb',
  subnetType: SubnetType.PRIVATE_ISOLATED,
});

Properties ​

availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*stringrequired#
The Availability Zone this subnet is located in.

Default: No AZ information, cannot use AZ selection features

ipv4CidrBlockstringipv4_cidr_blockstripv4CidrBlockStringIpv4CidrBlockstringIpv4CidrBlock*stringrequired#
The IPv4 CIDR block associated with the subnet.

Default: No CIDR information, cannot use CIDR filter features

ipv6CidrBlockstringipv6_cidr_blockstripv6CidrBlockStringIpv6CidrBlockstringIpv6CidrBlock*string#
The IPv4 CIDR block associated with the subnet.

Default: No CIDR information, cannot use CIDR filter features

routeTableIdstringroute_table_idstrrouteTableIdStringRouteTableIdstringRouteTableId*string#
The ID of the route table for this particular subnet.

Default: No route table information, cannot create VPC endpoints

subnetIdstringsubnet_idstrsubnetIdStringSubnetIdstringSubnetId*stringrequired#
The subnetId for this particular subnet.
subnetNamestringsubnet_namestrsubnetNameStringSubnetNamestringSubnetName*string#
Name of the given subnet.

Default: no subnet name

subnetTypeSubnetTypesubnet_typeSubnetTypesubnetTypeSubnetTypeSubnetTypeSubnetTypeSubnetTypeSubnetTyperequired#
The type of subnet (public or private) that this subnet represents.