module
jonbrouse/module/sample
Test module
VPC Module This module is called within the infrastructure repository to create a new AWS VPC. Root Module To instantiate the module, create a root module with the following files: __main.tf__ `` module "vpc" { source = "git@github.com:TerraformDesignPattern/vpc.git" aws_account = "${var.aws_account}" availability_zones = "${var.availability_zones}" aws_region = "${var.aws_region}" private_subnets = "${var.private_subnets}" public_subnets = "${var.public_subnets}" vpc_cidr = "${var.vpc_cidr}" vpc_name = "${var.vpc_name}" } ` __variables.tf__ As a personal preference, I try to only define data in variable files. ` variable "aws_accont" {} variable "aws_region" {} variable "vpc_name" {} variable "availability_zones" { default = [ "us-east-1b", "us-east-1c", "us-east-1d" ] } variable "private
| Name | Type | Description | Default |
|---|---|---|---|
| vpc_cidr | string | Define the VPC CIDR block | required |
| environment_name | string | Name of the enviornment the VPC belongs to | required |
| aws_account | string | The name of the AWS account in which the VPC is being created | required |
| aws_region | string | The name of the AWS region in which the VPC will be created | required |
| vpc_name | string | The desired name of the VPC being created | required |
| availability_zones | list | The AWS availability zones in which subnets will be created | [] |
| enable_dns_hostnames | string | True to enable DNS hostnames in the VPC | true |
| public_subnets | list | [] | |
| aws_region_shortnames | map | {
"ap-northeast-1": "apne1",
"ap-nor | |
| enable_dns_support | string | True to enable private DNS within the VPC | true |
| private_subnets | list | [] | |
| private_propagating_vgws | list | A list of VGWs the private route table should propagate. | [] |
| public_propagating_vgws | list | A list of VGWs the public route table should propagate. | [] |
| map_public_ip_on_launch | string | True to auto-assign a public IP on launch | true |
flow_log_cloudwatch_log_group_nameinternet_gateway_idnat_eipsprivate_subnet_idspublic_subnet_cidr_blockspublic_subnet_idsvpc_cidr_blockaws_region_shortname — The AWS region's shortname used when naming resources. i.e. "use1"vpc_idprivate_route_table_idsprivate_subnet_cidr_blockspublic_route_table_idsflow_log_cloudwatch_log_group_arn