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

24 lines
576 B
HCL

data "aws_availability_zones" "available" {}
module "random" {
source = "./m.random"
}
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "2.6.0"
name = "demo-vpc-${module.random.number}"
cidr = "172.16.0.0/16"
azs = data.aws_availability_zones.available.names
private_subnets = cidrsubnets("172.16.18.0/23", 1, 1)
public_subnets = cidrsubnets("172.16.20.0/23", 1, 1)
enable_nat_gateway = false
single_nat_gateway = true
enable_dns_hostnames = true
tags = var.default-tags
}