Skip to content
v2.274.0

PublicSubnetAttributes Struct ​

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
const publicSubnetAttributes: ec2.PublicSubnetAttributes = {
  subnetId: 'subnetId',

  // the properties below are optional
  availabilityZone: 'availabilityZone',
  ipv4CidrBlock: 'ipv4CidrBlock',
  routeTableId: 'routeTableId',
};

Properties ​

availabilityZonestringavailability_zonestravailabilityZoneStringAvailabilityZonestringAvailabilityZone*string#
The Availability Zone the subnet is located in.

Default: No AZ information, cannot use AZ selection features

ipv4CidrBlockstringipv4_cidr_blockstripv4CidrBlockStringIpv4CidrBlockstringIpv4CidrBlock*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.