dynamic-subnets

cloudposse/dynamic-subnets/aws

Terraform Module HCL AWS

Terraform module for public and private subnets provisioning in existing VPC

Install
module "dynamic-subnets" {
source = "cloudposse/dynamic-subnets/aws"
version = "3.1.1"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform module to provision public and private subnets in an existing VPC __Note:__ This module is intended for use with an existing VPC and existing Internet Gateway. To create a new VPC, use terraform-aws-vpc module. __Note:__ Due to Terraform limitations, many optional inputs to this module are specified as a list(string) that can have zero or one element, rather than as a string that could be empty or null. The designation of an input as a list type does not necessarily mean that you can supply more than one value in the list, so check the input's description before supplying more than one value. The core function of this module is to create 2 sets of subnets, a "public" set with bidirectional access to the public internet, and a "private" set behind a firewall with egress-only acces

Inputs (50)
NameTypeDescriptionDefault
vpc_idstringVPC ID where subnets will be created (e.g. `vpc-aceb2723`) required
aws_route_create_timeoutstringDEPRECATED: Use `route_create_timeout` instead. Time to wait for AWS route creatnull
private_labelstringThe string to use in IDs and elsewhere to identify resources for the private sub"private"
public_assign_ipv6_address_on_creationboolIf `true`, network interfaces created in a public subnet will be assigned an IPvtrue
metadata_http_put_response_hop_limitnumberThe desired HTTP PUT response hop limit (between 1 and 64) for instance metadata1
nat_instance_root_block_device_encryptedboolWhether to encrypt the root block device on the created NAT instancestrue
ipv4_public_instance_hostnames_enabledboolIf `true`, DNS queries for instance hostnames in the public subnets will be answfalse
contextanySingle object for setting entire context at once. See description of individual { "additional_tag_map": {}, "attribu
tenantstringID element _(Rarely used, not included by default)_. A customer identifier, indinull
subnet_type_tag_keystringDEPRECATED: Use `public_subnets_additional_tags` and `private_subnets_additionalnull
ipv4_enabledboolSet `true` to enable IPv4 addresses in the subnetstrue
nat_elastic_ipslist(string)Existing Elastic IPs (not EIP IDs) to attach to the NAT Gateway(s) or Instance(s[]
public_subnets_additional_tagsmap(string)Additional tags to be added to public subnets{}
subnets_per_az_nameslist(string)The subnet names of each type (public or private) to provision per Availability [ "common" ]
map_public_ip_on_launchboolIf `true`, instances launched into a public subnet will be assigned a public IPvtrue
public_labelstringThe string to use in IDs and elsewhere to identify resources for the public subn"public"
nat_gateway_public_subnet_nameslist(string)The names of the public subnets in each AZ where NAT Gateways should be placed. null
nat_instance_typestringNAT Instance type"t3.micro"
labels_as_tagsset(string)Set of labels (ID elements) to include as tags in the `tags` output. Default is [ "default" ]
max_natsnumberUpper limit on number of NAT Gateways/Instances to create. Set to 1 or 2 for cos999
public_route_table_enabledboolIf `true`, network route table(s) will be created as determined by `public_routetrue
… and 10 more inputs
Outputs (31)
public_subnet_arns — ARNs of the created public subnets
public_network_acl_id — ID of the Network ACL created for public subnets
nat_gateway_ids — IDs of the NAT Gateways created
nat_instance_ids — IDs of the NAT Instances created
nat_gateway_public_ips — DEPRECATED: use `nat_ips` instead. Public IPv4 IP addresses in use by NAT.
availability_zone_ids — List of Availability Zones IDs where subnets were created, when available
private_subnet_ipv6_cidrs — IPv6 CIDR blocks of the created private subnets
public_route_table_ids — IDs of the created public route tables
az_private_subnets_map — Map of AZ names to list of private subnet IDs in the AZs
private_subnet_cidrs — IPv4 CIDR blocks of the created private subnets
private_network_acl_id — ID of the Network ACL created for private subnets
nat_ips — Elastic IP Addresses in use by NAT
az_public_subnets_map — Map of AZ names to list of public subnet IDs in the AZs
public_subnet_ipv6_cidrs — IPv6 CIDR blocks of the created public subnets
az_private_route_table_ids_map — Map of AZ names to list of private route table IDs in the AZs
named_public_route_table_ids_map — Map of subnet names (specified in `public_subnets_per_az_names` or `subnets_per_az_names` variable)
named_public_subnets_stats_map — Map of subnet names (specified in `public_subnets_per_az_names` or `subnets_per_az_names` variable)
private_subnet_ids — IDs of the created private subnets
public_subnet_cidrs — IPv4 CIDR blocks of the created public subnets
nat_gateway_private_ips — Private IP addresses of the NAT Gateways
nat_instance_ami_id — ID of AMI used by NAT instance
named_private_subnets_stats_map — Map of subnet names (specified in `private_subnets_per_az_names` or `subnets_per_az_names` variable)
availability_zones — List of Availability Zones where subnets were created
public_subnet_ids — IDs of the created public subnets
named_private_subnets_map — Map of subnet names (specified in `private_subnets_per_az_names` or `subnets_per_az_names` variable)
named_private_route_table_ids_map — Map of subnet names (specified in `private_subnets_per_az_names` or `subnets_per_az_names` variable)
private_subnet_arns — ARNs of the created private subnets
private_route_table_ids — IDs of the created private route tables
named_public_subnets_map — Map of subnet names (specified in `public_subnets_per_az_names` or `subnets_per_az_names` variable)
nat_eip_allocation_ids — Elastic IP allocations in use by NAT
… and 1 more outputs
Resources (12)
aws_eipaws_eip_associationaws_instanceaws_nat_gatewayaws_network_aclaws_network_acl_ruleaws_routeaws_route_tableaws_route_table_associationaws_security_groupaws_security_group_ruleaws_subnet
Details
FrameworkTerraform Module
LanguageHCL
Version3.1.1
Cloud AWS
★ Stars206
Forks167
Total downloads3.4M
Inputs50
Outputs31
Resources12
Examples7
LicenseApache-2.0
Namespacecloudposse
Updated