diff --git a/fast/stages/00-bootstrap/README.md b/fast/stages/00-bootstrap/README.md index 3842aa07..85552a62 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#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. | ✓ | | +| [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. | ✓ | | diff --git a/fast/stages/00-bootstrap/outputs.tf b/fast/stages/00-bootstrap/outputs.tf index 8912fb87..58ae4305 100644 --- a/fast/stages/00-bootstrap/outputs.tf +++ b/fast/stages/00-bootstrap/outputs.tf @@ -15,6 +15,7 @@ */ locals { + outputs_location = pathexpand(var.outputs_location) providers = { "00-bootstrap" = templatefile("${path.module}/../../assets/templates/providers.tpl", { bucket = module.automation-tf-bootstrap-gcs.name @@ -70,13 +71,13 @@ locals { resource "local_file" "providers" { for_each = var.outputs_location == null ? {} : local.providers - filename = "${var.outputs_location}/${each.key}/providers.tf" + filename = "${local.outputs_location}/${each.key}/providers.tf" content = each.value } resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${var.outputs_location}/${each.key}/terraform-bootstrap.auto.tfvars.json" + filename = "${local.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 e39cf3d2..8348cc31 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#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. | ✓ | | +| [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. | ✓ | | diff --git a/fast/stages/01-resman/outputs.tf b/fast/stages/01-resman/outputs.tf index ef44c4ad..9a7ad157 100644 --- a/fast/stages/01-resman/outputs.tf +++ b/fast/stages/01-resman/outputs.tf @@ -19,6 +19,7 @@ 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 @@ -68,13 +69,13 @@ locals { resource "local_file" "providers" { for_each = var.outputs_location == null ? {} : local.providers - filename = "${var.outputs_location}/${each.key}/providers.tf" + filename = "${local.outputs_location}/${each.key}/providers.tf" content = each.value } resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${var.outputs_location}/${each.key}/terraform-resman.auto.tfvars.json" + filename = "${local.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 1ffc4d0c..16a989c2 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#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. | | | +| [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. | | | diff --git a/fast/stages/02-networking-nva/outputs.tf b/fast/stages/02-networking-nva/outputs.tf index 39c5d2ef..dc6b37b4 100644 --- a/fast/stages/02-networking-nva/outputs.tf +++ b/fast/stages/02-networking-nva/outputs.tf @@ -17,6 +17,7 @@ # 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 +34,7 @@ locals { resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${var.outputs_location}/${each.key}/terraform-networking.auto.tfvars.json" + filename = "${local.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 e6cb4fe4..e7df068d 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#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. | | | +| [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. | | | diff --git a/fast/stages/02-networking-vpn/outputs.tf b/fast/stages/02-networking-vpn/outputs.tf index 4efe9bc6..894f112f 100644 --- a/fast/stages/02-networking-vpn/outputs.tf +++ b/fast/stages/02-networking-vpn/outputs.tf @@ -16,6 +16,7 @@ # 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 @@ -32,7 +33,7 @@ locals { resource "local_file" "tfvars" { for_each = var.outputs_location == null ? {} : local.tfvars - filename = "${var.outputs_location}/${each.key}/terraform-networking.auto.tfvars.json" + filename = "${local.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 621db3e9..43049419 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#L37) | Security project numbers. They can be added to perimeter resources. | | | +| [stage_perimeter_projects](outputs.tf#L40) | 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 8f296d86..a1404835 100644 --- a/fast/stages/02-security/outputs.tf +++ b/fast/stages/02-security/outputs.tf @@ -15,10 +15,13 @@ */ # 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 = "${var.outputs_location}/yamls/02-security-kms-dev-keys.yaml" + filename = "${local.outputs_location}/yamls/02-security-kms-dev-keys.yaml" content = yamlencode({ for k, m in module.dev-sec-kms : k => m.key_ids }) @@ -26,7 +29,7 @@ resource "local_file" "dev_sec_kms" { resource "local_file" "prod_sec_kms" { for_each = var.outputs_location == null ? {} : { 1 = 1 } - filename = "${var.outputs_location}/yamls/02-security-kms-prod-keys.yaml" + filename = "${local.outputs_location}/yamls/02-security-kms-prod-keys.yaml" content = yamlencode({ for k, m in module.prod-sec-kms : k => m.key_ids })