Skip to content

Commit

Permalink
Create extra private subnets in dev and prod
Browse files Browse the repository at this point in the history
Running low on IP in prod. While at it create new ones on `dev` too as
we are close to running out on some subnets.
  • Loading branch information
masih committed Mar 20, 2023
1 parent 224ae49 commit 753ac60
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 2 deletions.
54 changes: 53 additions & 1 deletion deploy/infrastructure/dev/us-east-2/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ module "vpc" {
cidr = "20.10.0.0/16"
private_subnets = [
"20.10.1.0/24", "20.10.2.0/24", "20.10.3.0/24",
"20.10.4.0/24", "20.10.5.0/24", "20.10.6.0/24"
"20.10.4.0/24", "20.10.5.0/24", "20.10.6.0/24",
"20.10.7.0/24", "20.10.8.0/24", "20.10.9.0/24"
]
public_subnets = ["20.10.11.0/24", "20.10.12.0/24", "20.10.13.0/24"]
database_subnets = ["20.10.101.0/24", "20.10.102.0/24", "20.10.103.0/24"]
Expand Down Expand Up @@ -75,6 +76,23 @@ data "aws_subnet" "ue2a2" {
}
}

data "aws_subnet" "ue2a3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2a"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.7.0/24"]
}
}

data "aws_subnet" "ue2b1" {
vpc_id = module.vpc.vpc_id

Expand Down Expand Up @@ -109,6 +127,23 @@ data "aws_subnet" "ue2b2" {
}
}

data "aws_subnet" "ue2b3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2b"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.8.0/24"]
}
}

data "aws_subnet" "ue2c1" {
vpc_id = module.vpc.vpc_id

Expand Down Expand Up @@ -141,4 +176,21 @@ data "aws_subnet" "ue2c2" {
name = "cidr-block"
values = ["20.10.6.0/24"]
}
}

data "aws_subnet" "ue2c3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2c"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.9.0/24"]
}
}
54 changes: 53 additions & 1 deletion deploy/infrastructure/prod/us-east-2/vpc.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ module "vpc" {
cidr = "20.10.0.0/16"
private_subnets = [
"20.10.1.0/24", "20.10.2.0/24", "20.10.3.0/24",
"20.10.4.0/24", "20.10.5.0/24", "20.10.6.0/24"
"20.10.4.0/24", "20.10.5.0/24", "20.10.6.0/24",
"20.10.7.0/24", "20.10.8.0/24", "20.10.9.0/24"
]
public_subnets = ["20.10.11.0/24", "20.10.12.0/24", "20.10.13.0/24"]

Expand Down Expand Up @@ -109,6 +110,23 @@ data "aws_subnet" "ue2a2" {
}
}

data "aws_subnet" "ue2a3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2a"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.7.0/24"]
}
}

data "aws_subnet" "ue2b2" {
vpc_id = module.vpc.vpc_id

Expand All @@ -126,6 +144,23 @@ data "aws_subnet" "ue2b2" {
}
}

data "aws_subnet" "ue2b3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2b"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.8.0/24"]
}
}

data "aws_subnet" "ue2c2" {
vpc_id = module.vpc.vpc_id

Expand All @@ -142,3 +177,20 @@ data "aws_subnet" "ue2c2" {
values = ["20.10.6.0/24"]
}
}

data "aws_subnet" "ue2c3" {
vpc_id = module.vpc.vpc_id

filter {
name = "availability-zone"
values = ["us-east-2c"]
}
filter {
name = "subnet-id"
values = module.vpc.private_subnets
}
filter {
name = "cidr-block"
values = ["20.10.9.0/24"]
}
}

0 comments on commit 753ac60

Please sign in to comment.