SubnetConfiguration Struct
Specify configuration parameters for a single subnet group in a VPC.
| Source | aws-ec2/lib/vpc.ts |
|---|---|
| Type last changed |
Example
// 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 subnetConfiguration: ec2.SubnetConfiguration = {
name: 'name',
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
// the properties below are optional
cidrMask: 123,
ipv6AssignAddressOnCreation: false,
mapPublicIpOnLaunch: false,
reserved: false,
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_ec2 as ec2
subnet_configuration = ec2.SubnetConfiguration(
name="name",
subnet_type=ec2.SubnetType.PRIVATE_ISOLATED,
# the properties below are optional
cidr_mask=123,
ipv6_assign_address_on_creation=False,
map_public_ip_on_launch=False,
reserved=False
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.ec2.*;
SubnetConfiguration subnetConfiguration = SubnetConfiguration.builder()
.name("name")
.subnetType(SubnetType.PRIVATE_ISOLATED)
// the properties below are optional
.cidrMask(123)
.ipv6AssignAddressOnCreation(false)
.mapPublicIpOnLaunch(false)
.reserved(false)
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.EC2;
var subnetConfiguration = new SubnetConfiguration {
Name = "name",
SubnetType = SubnetType.PRIVATE_ISOLATED,
// the properties below are optional
CidrMask = 123,
Ipv6AssignAddressOnCreation = false,
MapPublicIpOnLaunch = false,
Reserved = false
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
subnetConfiguration := &SubnetConfiguration{
Name: jsii.String("name"),
SubnetType: awscdk.Aws_ec2.SubnetType_PRIVATE_ISOLATED,
// the properties below are optional
CidrMask: jsii.Number(123),
Ipv6AssignAddressOnCreation: jsii.Boolean(false),
MapPublicIpOnLaunch: jsii.Boolean(false),
Reserved: jsii.Boolean(false),
}
Properties
cidrMaskoptionalnumbercidr_maskoptionalint | floatcidrMaskoptionalNumberCidrMaskoptionaldoubleCidrMaskoptional*float64 #Default: Available IP space is evenly divided across subnets.
The number of available IP addresses in each subnet of this group will be equal to 2^(32 - cidrMask) - 2.
Valid values are 16--28.
Note this is specific to IPv4 addresses.
ipv6AssignAddressOnCreationoptionalbooleanipv6_assign_address_on_creationoptionalboolipv6AssignAddressOnCreationoptionalBooleanIpv6AssignAddressOnCreationoptionalboolIpv6AssignAddressOnCreationoptional*bool = true #If set to false, then an IPv6 address will not be automatically assigned.
Note this is specific to IPv6 addresses.
mapPublicIpOnLaunchoptionalbooleanmap_public_ip_on_launchoptionalboolmapPublicIpOnLaunchoptionalBooleanMapPublicIpOnLaunchoptionalboolMapPublicIpOnLaunchoptional*bool #Default: true in Subnet.Public of IPV4_ONLY VPCs, false otherwise
Note this is specific to IPv4 addresses.
This name can be used when selecting VPC subnets to distinguish between different subnet groups of the same type.
reservedoptionalbooleanreservedoptionalboolreservedoptionalBooleanReservedoptionalboolReservedoptional*bool = false #When true, the IP space for the subnet is reserved but no actual resources are provisioned. This space is only dependent on the number of availability zones and on cidrMask - all other subnet properties are ignored.
subnetTypeSubnetTypesubnet_typeSubnetTypesubnetTypeSubnetTypeSubnetTypeSubnetTypeSubnetTypeSubnetType required #The Subnet type will control the ability to route and connect to the Internet.