Represents a new VPC subnet resource.
import { Subnet } from 'aws-cdk-lib/aws-ec2';Or use the module namespace:
import * as ec2 from 'aws-cdk-lib/aws-ec2';
// ec2.SubnetConfiguration passed to the constructor as SubnetProps.
availabilityZoneRequiredstringThe availability zone for the subnet.
cidrBlockRequiredstringThe CIDR notation for this subnet.
vpcIdRequiredstringThe VPC which this subnet is part of.
assignIpv6AddressOnCreationOptionalbooleanIndicates whether a network interface created in this subnet receives an IPv6 address. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
Default: false
ipv6CidrBlockOptionalstringThe IPv6 CIDR block. If you specify AssignIpv6AddressOnCreation, you must also specify Ipv6CidrBlock.
Default: - no IPv6 CIDR block.
mapPublicIpOnLaunchOptionalbooleanControls if a public IP is associated to an instance at launch.
Default: true in Subnet.Public, false in Subnet.Private or Subnet.Isolated.
Everything you need to know about Amazon EC2 on one page. HD quality, print-friendly.
Download Free Infographicaws-ec2