Terraform module to create all mandatory VPC components.
This module supports either single-tier (only pubilc subnet) or multi-tier (public-app-data subnets) VPC creation. This module supports only up to 4 AZs.
module "abc_dev" {
source = "github.com/traveloka/terraform-aws-vpc.git?ref=0.0.1"
product_domain = "abc"
environment = "dev"
vpc_name = "abc-dev"
vpc_cidr_block = "172.16.0.0/16"
}
In some cases, you will need a VPC which has only public subnets.
module "abc_dev" {
source = "github.com/traveloka/terraform-aws-vpc.git?ref=0.0.1"
# you only need to add this line
vpc_multi_tier = false
# ... omitted
}
In some situations (it is not always happening), you will get some errors from Terraform when you set vpc_multi_tier = false
.
It happens because several resources were not created but stated as the outputs.
Currrently Terraform does not allow count
inside output
block, so now it is inevitable.
But don't worry, the errors have nothing to do with the stacks/resources/infrastructures that you created.
Just re-execute terraform apply
and you will be fine.
This module was created using Terraform 0.11.4. So to be more safe, Terraform version 0.11.4 or newer is required to use this module.
Apache 2 Licensed. See LICENSE for full details.