Skip to content

Commit

Permalink
Session 6 Goal 1 | Remove unused declarations number_of_public_subnet…
Browse files Browse the repository at this point in the history
…s, number_of_private_subnets, number_of_secure_subnets
  • Loading branch information
krishanuc1001 committed Aug 25, 2024
1 parent fe4cad0 commit 1d00977
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ locals {
vpc_id = module.vpc.vpc_id
azs = slice(data.aws_availability_zones.available.names, 0, 2)

number_of_public_subnets = var.public_subnets
number_of_private_subnets = var.private_subnets
number_of_secure_subnets = var.secure_subnets

public_subnet_cidrs = [for i in range(number_of_public_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 1)]
private_subnet_cidrs = [for i in range(number_of_private_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 3)]
secure_subnet_cidrs = [for i in range(number_of_secure_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 5)]
public_subnet_cidrs = [for i in range(var.public_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 1)]
private_subnet_cidrs = [for i in range(var.private_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 3)]
secure_subnet_cidrs = [for i in range(var.secure_subnets) : cidrsubnet(var.vpc_cidr, 3, i + 5)]
}

0 comments on commit 1d00977

Please sign in to comment.