NetworkConfig / VpcConfig | VpcTemplatesConfig / SubnetConfig

Virtual Private Cloud (VPC) subnet configuration.

Use this configuration to define subnets for your VPC. A subnet is a range of IP addresses in your VPC that can be used to create AWS resources, such as EC2 instances.

Static IPv4 CIDR:

- name: accelerator-cidr-subnet-a
availabilityZone: a
routeTable: accelerator-cidr-subnet-a
ipv4CidrBlock: 10.0.0.0/26
tags: []

Using the Physical ID for an Availability Zone

- name: accelerator-cidr-subnet-a
availabilityZone: 1
routeTable: accelerator-cidr-subnet-a
ipv4CidrBlock: 10.0.0.0/26
tags: []

IPAM allocation:

- name: accelerator-ipam-subnet-a
availabilityZone: a
routeTable: accelerator-cidr-subnet-a
ipamAllocation:
ipamPoolName: accelerator-regional-pool
netmaskLength: 26
tags: []

Static IPv6 CIDR:

- name: accelerator-cidr-subnet-1
availabilityZone: 1
routeTable: accelerator-cidr-subnet-1
ipv6CidrBlock: fd00::/64
tags: []
interface ISubnetConfig {
    assignIpv6OnCreation?: boolean;
    availabilityZone?: string | number;
    enableDns64?: boolean;
    ipamAllocation?: IIpamAllocationConfig;
    ipv4CidrBlock?: string;
    ipv6CidrBlock?: string;
    localZone?: string;
    mapPublicIpOnLaunch?: boolean;
    name: string;
    outpost?: string;
    privateDnsOptions?: ISubnetPrivateDnsConfig;
    routeTable?: string;
    shareTargets?: IShareTargets;
    tags?: ITag[];
}

Properties

assignIpv6OnCreation?: boolean

(OPTIONAL) Indicates whether a network interface created in this subnet receives an IPv6 address on creation.

If you specify this property, you must also specify the ipv6CidrBlock property.

This property defaults to false.

availabilityZone?: string | number

The Availability Zone (AZ) the subnet resides in.

CAUTION: changing this property after initial deployment will cause a subnet recreation. Please be aware that any downstream dependencies may cause this property update to fail.

Include only the letter of the AZ name (i.e. 'a' for 'us-east-1a') to have the subnet created in a specific AZ. Use an integer (i.e. 1) for a physical mapping ID to an AZ. Please reference the documentation Availability Zone IDs for your AWS resources for more information.

enableDns64?: boolean

(OPTIONAL) Indicates whether DNS queries made to the Amazon-provided DNS Resolver in this subnet should return synthetic IPv6 addresses for IPv4-only destinations.

For more information, see DNS64 and NAT64 in the Amazon Virtual Private Cloud User Guide.

ipamAllocation?: IIpamAllocationConfig

The IPAM pool configuration for the subnet.

  • IpamAllocationConfig
  • CentralNetworkServicesConfig

Must be using AWS-managed IPAM and allocate a CIDR to the VPC this subnet will be created in. Define IPAM configuration in centralNetworkServices.

ipv4CidrBlock?: string

The IPv4 CIDR block to associate with the subnet.

CAUTION: changing this property after initial deployment will cause a subnet recreation. Please be aware that any downstream dependencies may cause this property update to fail.

Use CIDR notation, i.e. 10.0.0.0/16

ipv6CidrBlock?: string

(OPTIONAL) The IPv6 CIDR block to associate with the subnet.

Use IPv6 CIDR notation, i.e. fd00::/64. Possible IPv6 netmask lengths are between /44 and /64 in increments of /4.

Note: Only providing an IPv6 CIDR block or IPv6 IPAM allocation will create an IPv6-only subnet. You must also specify an IPv4 CIDR or IPAM allocation to create a dual-stack subnet. See Subnet basics for more information.

localZone?: string

The Zone ID of the local zone.

CAUTION: changing this property after initial deployment will cause a subnet recreation. Please be aware that any downstream dependencies may cause this property update to fail.

This will be the identifier of the local zone (ie - 'den-1a' for 'us-west-2-den-1a')

mapPublicIpOnLaunch?: boolean

(OPTIONAL) Configure automatic mapping of public IPs.

Enables you to configure the auto-assign IP settings to automatically request a public IPv4 address for a new network interface in this subnet.

name: string

A friendly name for the VPC subnet.

CAUTION: changing this property after initial deployment will cause a subnet recreation. Please be aware that any downstream dependencies may cause this property update to fail.

outpost?: string

(OPTIONAL) The friendly name for the outpost to attach to the subnet

This is the logical name of the outpost as defined in network-config.yaml.

OutpostsConfig

privateDnsOptions?: ISubnetPrivateDnsConfig

(OPTIONAL) Private DNS name options for the subnet.

SubnetPrivateDnsConfig

routeTable?: string

The friendly name of the route table to associate with the subnet.

shareTargets?: IShareTargets

(OPTIONAL) Resource Access Manager (RAM) share targets.

NOTE: When sharing subnets, security groups created in this VPC will be automatically replicated to the share target accounts. If tags are configured for the VPC and/or subnet, they are also replicated.

  • SecurityGroupConfig

Targets can be account names and/or organizational units.

  • ShareTargets
tags?: ITag[]

(OPTIONAL) An array of tag objects for the VPC subnet.