code-dumps/tf-modulised/vpc-subnets/vpc.tf

24 lines
576 B
Terraform
Raw Normal View History

2020-06-18 10:30:49 +08:00
data "aws_availability_zones" "available" {}
2020-08-02 18:58:41 +08:00
module "random" {
2020-08-02 19:00:08 +08:00
source = "./m.random"
2020-06-18 10:30:49 +08:00
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "2.6.0"
2020-08-02 18:58:41 +08:00
name = "demo-vpc-${module.random.number}"
2020-06-18 10:30:49 +08:00
cidr = "172.16.0.0/16"
azs = data.aws_availability_zones.available.names
2020-07-23 09:02:47 +08:00
private_subnets = cidrsubnets("172.16.18.0/23", 1, 1)
public_subnets = cidrsubnets("172.16.20.0/23", 1, 1)
2020-08-02 18:58:41 +08:00
enable_nat_gateway = false
2020-06-18 10:30:49 +08:00
single_nat_gateway = true
enable_dns_hostnames = true
2020-08-02 17:44:28 +08:00
tags = var.default-tags
2020-06-18 10:30:49 +08:00
}