Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create extra private subnets in dev and prod #1425

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
}
}