From d711a933973a627297802a22adba9fa912e0dee9 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sun, 6 Feb 2022 18:34:32 +0100 Subject: [PATCH] fix previous merge (#513) --- fast/stages/00-bootstrap/README.md | 8 ++++---- fast/stages/00-bootstrap/outputs.tf | 5 ++--- fast/stages/01-resman/README.md | 14 +++++++------- fast/stages/01-resman/outputs.tf | 5 ++--- fast/stages/02-networking-nva/README.md | 12 ++++++------ fast/stages/02-networking-nva/outputs.tf | 3 +-- fast/stages/02-networking-vpn/README.md | 14 +++++++------- fast/stages/02-networking-vpn/outputs.tf | 3 +-- fast/stages/02-security/README.md | 2 +- fast/stages/02-security/outputs.tf | 7 ++----- 10 files changed, 33 insertions(+), 40 deletions(-) diff --git a/fast/stages/00-bootstrap/README.md b/fast/stages/00-bootstrap/README.md index 85552a62..3842aa07 100644 --- a/fast/stages/00-bootstrap/README.md +++ b/fast/stages/00-bootstrap/README.md @@ -324,9 +324,9 @@ Names used in internal references (e.g. `module.foo-prod.id`) are only used by T | name | description | sensitive | consumers | |---|---|:---:|---| -| [billing_dataset](outputs.tf#L86) | BigQuery dataset prepared for billing export. | | | -| [project_ids](outputs.tf#L91) | Projects created by this stage. | | | -| [providers](outputs.tf#L102) | Terraform provider files for this stage and dependent stages. | ✓ | stage-01 | -| [tfvars](outputs.tf#L111) | Terraform variable files for the following stages. | ✓ | | +| [billing_dataset](outputs.tf#L85) | BigQuery dataset prepared for billing export. | | | +| [project_ids](outputs.tf#L90) | Projects created by this stage. | | | +| [providers](outputs.tf#L101) | Terraform provider files for this stage and dependent stages. | ✓ | stage-01 | +| [tfvars](outputs.tf#L110) | Terraform variable files for the following stages. | ✓ | | diff --git a/fast/stages/00-bootstrap/outputs.tf b/fast/stages/00-bootstrap/outputs.tf index 58ae4305..d7924781 100644 --- a/fast/stages/00-bootstrap/outputs.tf +++ b/fast/stages/00-bootstrap/outputs.tf @@ -15,7 +15,6 @@ */ locals { - outputs_location = pathexpand(var.outputs_location) providers = { "00-bootstrap" = templatefile("${path.module}/../../assets/templates/providers.tpl", { bucket = module.automation-tf-bootstrap-gcs.name @@ -71,13 +70,13 @@ locals { resource "local_file" "providers" { for_each = var.outputs_location == null ? {} : local.providers - filename = "${local.outputs_location}/${each.key}/providers.tf" + filename = "${pathexpand(var.outputs_location)}/${each.key}/providers.tf" content = each.value } resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${local.outputs_location}/${each.key}/terraform-bootstrap.auto.tfvars.json" + filename = "${pathexpand(var.outputs_location)}/${each.key}/terraform-bootstrap.auto.tfvars.json" content = each.value } diff --git a/fast/stages/01-resman/README.md b/fast/stages/01-resman/README.md index 8348cc31..e39cf3d2 100644 --- a/fast/stages/01-resman/README.md +++ b/fast/stages/01-resman/README.md @@ -177,12 +177,12 @@ Due to its simplicity, this stage lends itself easily to customizations: adding | name | description | sensitive | consumers | |---|---|:---:|---| -| [networking](outputs.tf#L84) | Data for the networking stage. | | 02-networking | -| [project_factories](outputs.tf#L94) | Data for the project factories stage. | | xx-teams | -| [providers](outputs.tf#L111) | Terraform provider files for this stage and dependent stages. | ✓ | 02-networking · 02-security · xx-sandbox · xx-teams | -| [sandbox](outputs.tf#L118) | Data for the sandbox stage. | | xx-sandbox | -| [security](outputs.tf#L128) | Data for the networking stage. | | 02-security | -| [teams](outputs.tf#L138) | Data for the teams stage. | | | -| [tfvars](outputs.tf#L151) | Terraform variable files for the following stages. | ✓ | | +| [networking](outputs.tf#L83) | Data for the networking stage. | | 02-networking | +| [project_factories](outputs.tf#L93) | Data for the project factories stage. | | xx-teams | +| [providers](outputs.tf#L110) | Terraform provider files for this stage and dependent stages. | ✓ | 02-networking · 02-security · xx-sandbox · xx-teams | +| [sandbox](outputs.tf#L117) | Data for the sandbox stage. | | xx-sandbox | +| [security](outputs.tf#L127) | Data for the networking stage. | | 02-security | +| [teams](outputs.tf#L137) | Data for the teams stage. | | | +| [tfvars](outputs.tf#L150) | Terraform variable files for the following stages. | ✓ | | diff --git a/fast/stages/01-resman/outputs.tf b/fast/stages/01-resman/outputs.tf index 9a7ad157..23056119 100644 --- a/fast/stages/01-resman/outputs.tf +++ b/fast/stages/01-resman/outputs.tf @@ -19,7 +19,6 @@ locals { dev = module.branch-teams-dev-projectfactory-sa.iam_email prod = module.branch-teams-prod-projectfactory-sa.iam_email } - outputs_location = pathexpand(var.outputs_location) providers = { "02-networking" = templatefile("${path.module}/../../assets/templates/providers.tpl", { bucket = module.branch-network-gcs.name @@ -69,13 +68,13 @@ locals { resource "local_file" "providers" { for_each = var.outputs_location == null ? {} : local.providers - filename = "${local.outputs_location}/${each.key}/providers.tf" + filename = "${pathexpand(var.outputs_location)}/${each.key}/providers.tf" content = each.value } resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${local.outputs_location}/${each.key}/terraform-resman.auto.tfvars.json" + filename = "${pathexpand(var.outputs_location)}/${each.key}/terraform-resman.auto.tfvars.json" content = each.value } diff --git a/fast/stages/02-networking-nva/README.md b/fast/stages/02-networking-nva/README.md index 16a989c2..1ffc4d0c 100644 --- a/fast/stages/02-networking-nva/README.md +++ b/fast/stages/02-networking-nva/README.md @@ -340,11 +340,11 @@ Don't forget to add a peering zone in the landing project and point it to the ne | name | description | sensitive | consumers | |---|---|:---:|---| -| [project_ids](outputs.tf#L43) | Network project ids. | | | -| [project_numbers](outputs.tf#L52) | Network project numbers. | | | -| [shared_vpc_host_projects](outputs.tf#L61) | Shared VPC host projects. | | | -| [shared_vpc_self_links](outputs.tf#L70) | Shared VPC host projects. | | | -| [tfvars](outputs.tf#L94) | Network-related variables used in other stages. | ✓ | | -| [vpn_gateway_endpoints](outputs.tf#L80) | External IP Addresses for the GCP VPN gateways. | | | +| [project_ids](outputs.tf#L42) | Network project ids. | | | +| [project_numbers](outputs.tf#L51) | Network project numbers. | | | +| [shared_vpc_host_projects](outputs.tf#L60) | Shared VPC host projects. | | | +| [shared_vpc_self_links](outputs.tf#L69) | Shared VPC host projects. | | | +| [tfvars](outputs.tf#L93) | Network-related variables used in other stages. | ✓ | | +| [vpn_gateway_endpoints](outputs.tf#L79) | External IP Addresses for the GCP VPN gateways. | | | diff --git a/fast/stages/02-networking-nva/outputs.tf b/fast/stages/02-networking-nva/outputs.tf index dc6b37b4..cf39b1df 100644 --- a/fast/stages/02-networking-nva/outputs.tf +++ b/fast/stages/02-networking-nva/outputs.tf @@ -17,7 +17,6 @@ # Optionally, generate providers and tfvars files for subsequent stages locals { - outputs_location = pathexpand(var.outputs_location) tfvars = { "03-project-factory-dev" = jsonencode({ environment_dns_zone = module.dev-dns-private-zone.domain @@ -34,7 +33,7 @@ locals { resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${local.outputs_location}/${each.key}/terraform-networking.auto.tfvars.json" + filename = "${pathexpand(var.outputs_location)}/${each.key}/terraform-networking.auto.tfvars.json" content = each.value } diff --git a/fast/stages/02-networking-vpn/README.md b/fast/stages/02-networking-vpn/README.md index e7df068d..e6cb4fe4 100644 --- a/fast/stages/02-networking-vpn/README.md +++ b/fast/stages/02-networking-vpn/README.md @@ -328,12 +328,12 @@ DNS configurations are centralised in the `dns.tf` file. Spokes delegate DNS res | name | description | sensitive | consumers | |---|---|:---:|---| -| [cloud_dns_inbound_policy](outputs.tf#L42) | IP Addresses for Cloud DNS inbound policy. | | | -| [project_ids](outputs.tf#L47) | Network project ids. | | | -| [project_numbers](outputs.tf#L56) | Network project numbers. | | | -| [shared_vpc_host_projects](outputs.tf#L65) | Shared VPC host projects. | | | -| [shared_vpc_self_links](outputs.tf#L75) | Shared VPC host projects. | | | -| [tfvars](outputs.tf#L92) | Network-related variables used in other stages. | ✓ | | -| [vpn_gateway_endpoints](outputs.tf#L85) | External IP Addresses for the GCP VPN gateways. | | | +| [cloud_dns_inbound_policy](outputs.tf#L41) | IP Addresses for Cloud DNS inbound policy. | | | +| [project_ids](outputs.tf#L46) | Network project ids. | | | +| [project_numbers](outputs.tf#L55) | Network project numbers. | | | +| [shared_vpc_host_projects](outputs.tf#L64) | Shared VPC host projects. | | | +| [shared_vpc_self_links](outputs.tf#L74) | Shared VPC host projects. | | | +| [tfvars](outputs.tf#L91) | Network-related variables used in other stages. | ✓ | | +| [vpn_gateway_endpoints](outputs.tf#L84) | External IP Addresses for the GCP VPN gateways. | | | diff --git a/fast/stages/02-networking-vpn/outputs.tf b/fast/stages/02-networking-vpn/outputs.tf index 894f112f..15b4c49c 100644 --- a/fast/stages/02-networking-vpn/outputs.tf +++ b/fast/stages/02-networking-vpn/outputs.tf @@ -16,7 +16,6 @@ # optionally generate providers and tfvars files for subsequent stages locals { - outputs_location = pathexpand(var.outputs_location) tfvars = { "03-project-factory-dev" = jsonencode({ environment_dns_zone = module.dev-dns-private-zone.domain @@ -33,7 +32,7 @@ locals { resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${local.outputs_location}/${each.key}/terraform-networking.auto.tfvars.json" + filename = "${pathexpand(var.outputs_location)}/${each.key}/terraform-networking.auto.tfvars.json" content = each.value } diff --git a/fast/stages/02-security/README.md b/fast/stages/02-security/README.md index 43049419..621db3e9 100644 --- a/fast/stages/02-security/README.md +++ b/fast/stages/02-security/README.md @@ -306,6 +306,6 @@ Some references that might be useful in setting up this stage: | name | description | sensitive | consumers | |---|---|:---:|---| -| [stage_perimeter_projects](outputs.tf#L40) | Security project numbers. They can be added to perimeter resources. | | | +| [stage_perimeter_projects](outputs.tf#L37) | Security project numbers. They can be added to perimeter resources. | | | diff --git a/fast/stages/02-security/outputs.tf b/fast/stages/02-security/outputs.tf index a1404835..15c75a2a 100644 --- a/fast/stages/02-security/outputs.tf +++ b/fast/stages/02-security/outputs.tf @@ -15,13 +15,10 @@ */ # optionally generate files for subsequent stages -locals { - outputs_location = pathexpand(var.outputs_location) -} resource "local_file" "dev_sec_kms" { for_each = var.outputs_location == null ? {} : { 1 = 1 } - filename = "${local.outputs_location}/yamls/02-security-kms-dev-keys.yaml" + filename = "${pathexpand(var.outputs_location)}/yamls/02-security-kms-dev-keys.yaml" content = yamlencode({ for k, m in module.dev-sec-kms : k => m.key_ids }) @@ -29,7 +26,7 @@ resource "local_file" "dev_sec_kms" { resource "local_file" "prod_sec_kms" { for_each = var.outputs_location == null ? {} : { 1 = 1 } - filename = "${local.outputs_location}/yamls/02-security-kms-prod-keys.yaml" + filename = "${pathexpand(var.outputs_location)}/yamls/02-security-kms-prod-keys.yaml" content = yamlencode({ for k, m in module.prod-sec-kms : k => m.key_ids })