Skip to content

Commit

Permalink
Add vpc workspaces and specify VPC CIDR in variables
Browse files Browse the repository at this point in the history
  • Loading branch information
samsimpson1 committed Mar 19, 2024
1 parent 6ab9fa2 commit d33a00f
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module "variable-set-integration" {
cluster_version = 1.29
cluster_log_retention_in_days = 7

vpc_cidr = "10.1.0.0/16"

eks_control_plane_subnets = {
a = { az = "eu-west-1a", cidr = "10.1.19.0/28" }
b = { az = "eu-west-1b", cidr = "10.1.19.16/28" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module "variable-set-production" {
cluster_version = 1.29
cluster_log_retention_in_days = 7

vpc_cidr = "10.13.0.0/16"

eks_control_plane_subnets = {
a = { az = "eu-west-1a", cidr = "10.13.19.0/28" }
b = { az = "eu-west-1b", cidr = "10.13.19.16/28" }
Expand Down
2 changes: 2 additions & 0 deletions terraform/deployments/tfc-configuration/variables-staging.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module "variable-set-staging" {
cluster_version = 1.29
cluster_log_retention_in_days = 7

vpc_cidr = "10.12.0.0/16"

eks_control_plane_subnets = {
a = { az = "eu-west-1a", cidr = "10.12.19.0/28" }
b = { az = "eu-west-1b", cidr = "10.12.19.16/28" }
Expand Down
93 changes: 93 additions & 0 deletions terraform/deployments/tfc-configuration/vpc.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
module "vpc-integration" {
source = "alexbasista/workspacer/tfe"
version = "0.9.0"

organization = var.organization
workspace_name = "vpc-integration"
workspace_desc = "The vpc module is responsible for the AWS resources which constitute the EKS cluster."
workspace_tags = ["integration", "vpc", "eks", "aws"]
terraform_version = "1.7.0"
execution_mode = "remote"
working_directory = "/terraform/deployments/vpc/"
trigger_patterns = ["/terraform/deployments/vpc/**/*"]

project_name = "govuk-infrastructure"
vcs_repo = {
identifier = "alphagov/govuk-infrastructure"
branch = "samsimpson1/govuk-aws"
oauth_token_id = data.tfe_oauth_client.github.oauth_token_id
}

team_access = {
"GOV.UK Non-Production" = "write"
"GOV.UK Production" = "write"
}

variable_set_names = [
"aws-credentials-integration",
"common",
"common-integration"
]
}

module "vpc-staging" {
source = "alexbasista/workspacer/tfe"
version = "0.9.0"

organization = var.organization
workspace_name = "vpc-staging"
workspace_desc = "The vpc module is responsible for the AWS resources which constitute the EKS cluster."
workspace_tags = ["staging", "vpc", "eks", "aws"]
terraform_version = "1.7.0"
execution_mode = "remote"
working_directory = "/terraform/deployments/vpc/"
trigger_patterns = ["/terraform/deployments/vpc/**/*"]

project_name = "govuk-infrastructure"
vcs_repo = {
identifier = "alphagov/govuk-infrastructure"
branch = "samsimpson1/govuk-aws"
oauth_token_id = data.tfe_oauth_client.github.oauth_token_id
}

team_access = {
"GOV.UK Production" = "write"
}

variable_set_names = [
"aws-credentials-staging",
"common",
"common-staging"
]
}

module "vpc-production" {
source = "alexbasista/workspacer/tfe"
version = "0.9.0"

organization = var.organization
workspace_name = "vpc-production"
workspace_desc = "The vpc module is responsible for the AWS resources which constitute the EKS cluster."
workspace_tags = ["production", "vpc", "eks", "aws"]
terraform_version = "1.7.0"
execution_mode = "remote"
working_directory = "/terraform/deployments/vpc/"
trigger_patterns = ["/terraform/deployments/vpc/**/*"]

project_name = "govuk-infrastructure"
vcs_repo = {
identifier = "alphagov/govuk-infrastructure"
branch = "samsimpson1/govuk-aws"
oauth_token_id = data.tfe_oauth_client.github.oauth_token_id
}

team_access = {
"GOV.UK Production" = "write"
}

variable_set_names = [
"aws-credentials-production",
"common",
"common-production"
]
}

0 comments on commit d33a00f

Please sign in to comment.