Skip to content

Commit

Permalink
Deploy new VPC (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
soerenmartius authored Apr 22, 2024
2 parents 8a00944 + 57b0271 commit b2d171d
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 6 deletions.
16 changes: 16 additions & 0 deletions stacks/prod/config.tm.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
globals "terraform" "module" "version" {
vpc = "5.7.1"
}

globals "vpc" {
name = "prd-vpc"
cidr = "10.0.0.0/16"
azs = ["us-east-1a", "us-east-1b", "us-east-1c"]
}

globals {
tags = {
Environment = "prd"
Terraform = "true"
}
}
File renamed without changes.
29 changes: 29 additions & 0 deletions stacks/prod/us-east-1/vpc/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// TERRAMATE: GENERATED AUTOMATICALLY DO NOT EDIT

module "vpc" {
azs = [
"us-east-1a",
"us-east-1b",
"us-east-1c",
]
cidr = "10.0.0.0/16"
enable_nat_gateway = true
enable_vpn_gateway = true
name = "prd-vpc"
private_subnets = [
"10.0.1.0/24",
"10.0.2.0/24",
"10.0.3.0/24",
]
public_subnets = [
"10.0.101.0/24",
"10.0.102.0/24",
"10.0.103.0/24",
]
source = "terraform-aws-modules/vpc/aws"
tags = {
Environment = "prd"
Terraform = "true"
}
version = "5.7.1"
}
30 changes: 30 additions & 0 deletions stacks/prod/us-east-1/vpc/main.tm.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
generate_hcl "main.tf" {
inherit = false

content {
module "vpc" {
source = "terraform-aws-modules/vpc/aws"
version = global.terraform.module.version.vpc

name = global.vpc.name
cidr = global.vpc.cidr

azs = global.vpc.azs
private_subnets = [
tm_cidrsubnet(global.vpc.cidr, 8, 1),
tm_cidrsubnet(global.vpc.cidr, 8, 2),
tm_cidrsubnet(global.vpc.cidr, 8, 3)
]
public_subnets = [
tm_cidrsubnet(global.vpc.cidr, 8, 101),
tm_cidrsubnet(global.vpc.cidr, 8, 102),
tm_cidrsubnet(global.vpc.cidr, 8, 103)
]

enable_nat_gateway = tm_try(global.vpc.enable_nat_gateway, true)
enable_vpn_gateway = tm_try(global.vpc.enable_vpn_gateway, true)

tags = tm_try(global.tags, {})
}
}
}
6 changes: 6 additions & 0 deletions stacks/prod/us-east-1/vpc/stack.tm.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stack {
name = "Production VPC"
description = "Production VPC deployed in us-east-1"
id = "6f9c219c-cb68-4cac-8753-d94336f565e7"
tags = ["networking"]
}
File renamed without changes.
1 change: 0 additions & 1 deletion stacks/us-east-1/vpc/main/main.tf

This file was deleted.

5 changes: 0 additions & 5 deletions stacks/us-east-1/vpc/main/stack.tm.hcl

This file was deleted.

0 comments on commit b2d171d

Please sign in to comment.