vpc

cloudposse/vpc/aws

Terraform Module HCL AWS

Terraform Module that defines a VPC with public/private subnets across multiple AZs with Internet Gateways

Install
module "vpc" {
source = "cloudposse/vpc/aws"
version = "3.0.0"
}
⭐ Source on GitHub 📦 Registry page
README

Terraform module to provision a VPC with Internet Gateway. Contains a submodule for provisioning Interface and/or Gateway VPC Endpoints. This module also supports provisioning additional CIDR blocks for the VPC, with or without using IPAM. > [!TIP] > #### 👽 Use Atmos with Terraform > Cloud Posse uses atmos to easily orchestrate multiple environments using Terraform. > Works with Github Actions, Atlantis, or Spacelift. > > > Watch demo of using Atmos with Terraform > > Example of running atmos to manage infrastructure from our Quick Start tutorial. > Examples ``hcl module "vpc" { source = "cloudposse/vpc/aws" # Cloud Posse recommends pinning every module to a specific version # version = "x.x.x" namespace = "eg" stage = "test" name = "app" ipv4_primary_cidr_block = "10.0.0.0/16" assign_gene

Inputs (36)
NameTypeDescriptionDefault
label_orderlist(string)The order in which the labels (ID elements) appear in the `id`. Defaults to ["nanull
descriptor_formatsanyDescribe additional descriptors to be output in the `descriptors` output map. Ma{}
ipv4_primary_cidr_blockstringThe primary IPv4 CIDR block for the VPC. Either `ipv4_primary_cidr_block` or `ipnull
ipv6_cidr_block_network_border_groupstringSet this to restrict advertisement of public addresses to a specific Network Bornull
default_security_group_deny_allboolWhen `true`, manage the default security group and remove all rules, disabling atrue
default_network_acl_deny_allboolWhen `true`, manage the default network acl and remove all rules, disabling all false
tenantstringID element _(Rarely used, not included by default)_. A customer identifier, indinull
label_key_casestringControls the letter case of the `tags` keys (label names) for tags generated by null
ipv4_primary_cidr_block_associationobject({ ipv4_ipam_pool_idConfiguration of the VPC's primary IPv4 CIDR block via IPAM. Conflicts with `ipvnull
ipv4_cidr_block_association_timeoutsobject({ create = string Timeouts (in `go` duration format) for creating and destroying IPv4 CIDR block anull
default_route_table_no_routesboolWhen `true`, manage the default route table and remove all routes, disabling allfalse
delimiterstringDelimiter to be used between ID elements. Defaults to `-` (hyphen). Set to `""` null
additional_tag_mapmap(string)Additional key-value pairs to add to each map in `tags_as_list_of_maps`. Not add{}
id_length_limitnumberLimit `id` to this many characters (minimum 6). Set to `0` for unlimited length.null
ipv6_additional_cidr_block_associationsmap(object({ ipv6_cidr_bloIPv6 CIDR blocks to assign to the VPC (in addition to the autogenerated one). `i{}
ipv6_cidr_block_association_timeoutsobject({ create = string Timeouts (in `go` duration format) for creating and destroying IPv6 CIDR block anull
instance_tenancystringA tenancy option for instances launched into the VPC"default"
namestringID element. Usually the component or solution name, e.g. 'app' or 'jenkins'. Thinull
attributeslist(string)ID element. Additional attributes (e.g. `workers` or `cluster`) to add to `id`, []
dns_hostnames_enabledboolSet `true` to enable [DNS hostnames](https://docs.aws.amazon.com/vpc/latest/usertrue
Outputs (16)
vpc_arn — The ARN of the VPC
vpc_main_route_table_id — The ID of the main route table associated with this VPC
additional_ipv6_cidr_blocks_to_association_ids — A map of the additional IPv6 CIDR blocks to VPC CIDR association IDs
vpc_id — The ID of the VPC
vpc_default_network_acl_id — The ID of the network ACL created by default on VPC creation
vpc_ipv6_association_id — The association ID for the primary IPv6 CIDR block
additional_cidr_blocks_to_association_ids — A map of the additional IPv4 CIDR blocks to VPC CIDR association IDs
igw_id — The ID of the Internet Gateway
vpc_cidr_block — The primary IPv4 CIDR block of the VPC
vpc_default_security_group_id — The ID of the security group created by default on VPC creation
additional_ipv6_cidr_blocks — A list of the additional IPv6 CIDR blocks associated with the VPC
ipv6_cidr_block_network_border_group — The IPv6 Network Border Group Zone name
ipv6_egress_only_igw_id — The ID of the egress-only Internet Gateway
vpc_default_route_table_id — The ID of the route table created by default on VPC creation
vpc_ipv6_cidr_block — The primary IPv6 CIDR block
additional_cidr_blocks — A list of the additional IPv4 CIDR blocks associated with the VPC
Resources (8)
aws_default_network_aclaws_default_route_tableaws_default_security_groupaws_egress_only_internet_gatewayaws_internet_gatewayaws_vpcaws_vpc_ipv4_cidr_block_associationaws_vpc_ipv6_cidr_block_association
Details
FrameworkTerraform Module
LanguageHCL
Version3.0.0
Cloud AWS
★ Stars240
Forks198
Total downloads4.5M
Inputs36
Outputs16
Resources8
Examples3
Submodules1
LicenseApache-2.0
Namespacecloudposse
Updated