From 22013943d75b039c46a4e6ce5764fc74bc6d7fe2 Mon Sep 17 00:00:00 2001 From: x p k Date: Thu, 23 Jul 2020 09:02:47 +0800 Subject: [PATCH] UPD: use of cidrsubnets --- tf-modulised/vpc-subnets/vpc.tf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tf-modulised/vpc-subnets/vpc.tf b/tf-modulised/vpc-subnets/vpc.tf index 3e8f89f..8a3e9c7 100644 --- a/tf-modulised/vpc-subnets/vpc.tf +++ b/tf-modulised/vpc-subnets/vpc.tf @@ -17,8 +17,8 @@ module "vpc" { name = "demo-vpc-${random_integer.suffix.result}" cidr = "172.16.0.0/16" azs = data.aws_availability_zones.available.names - private_subnets = ["172.16.1.0/24", "172.16.2.0/24", "172.16.3.0/24"] - public_subnets = ["172.16.4.0/24", "172.16.5.0/24", "172.16.6.0/24"] + private_subnets = cidrsubnets("172.16.18.0/23", 1, 1) + public_subnets = cidrsubnets("172.16.20.0/23", 1, 1) enable_nat_gateway = true single_nat_gateway = true enable_dns_hostnames = true @@ -26,6 +26,9 @@ module "vpc" { tags = { "owner" = "KF" "terraform" = "initial-deployment-only" + "environment" = "demo" + "project" = "project1" + "application" = "network" } }