From 6e832dc51bbf81b625149ecd394d4acfc832e81d Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Tue, 21 Jan 2025 09:45:11 +0100 Subject: [PATCH 1/2] Small fix to net test add-on context expansion --- fast/addons/2-networking-test/context.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fast/addons/2-networking-test/context.tf b/fast/addons/2-networking-test/context.tf index 9f95ecc734..60e458e3b7 100644 --- a/fast/addons/2-networking-test/context.tf +++ b/fast/addons/2-networking-test/context.tf @@ -39,6 +39,7 @@ locals { _subnets = { for k, v in local._subnet_attrs : k => merge(v, v.region_alias == null ? {} : { id = try(replace(v.id, v.region, v.region_alias)) + region = coalesce(v.region_alias, v.region) }) } # derive product of instances and zones and expand instance contexts @@ -52,7 +53,7 @@ locals { var.subnet_self_links[v.network_id][local._subnets[v.subnet_id].id], v.subnet_id ) - zone = "${local._subnets[v.subnet_id].region}-${z}" + zone = "${local._subnets[v.subnet_id].region_alias}-${z}" }) ] ]) From 5db683c15639930e8d431c55eec150063ca46537 Mon Sep 17 00:00:00 2001 From: Ludo Date: Tue, 21 Jan 2025 10:00:47 +0100 Subject: [PATCH 2/2] linting --- fast/addons/2-networking-test/README.md | 1 + fast/addons/2-networking-test/context.tf | 2 +- fast/addons/2-networking-test/outputs.tf | 7 +++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/fast/addons/2-networking-test/README.md b/fast/addons/2-networking-test/README.md index 28de8715b7..ce4bfd0ced 100644 --- a/fast/addons/2-networking-test/README.md +++ b/fast/addons/2-networking-test/README.md @@ -112,4 +112,5 @@ terraform apply |---|---|:---:|---| | [instance_addresses](outputs.tf#L17) | Instance names and addresses. | | | | [instance_ssh](outputs.tf#L24) | Instance SSH commands. | | | +| [service_account_emails](outputs.tf#L33) | Service account emails. | | | diff --git a/fast/addons/2-networking-test/context.tf b/fast/addons/2-networking-test/context.tf index 60e458e3b7..04790e8a26 100644 --- a/fast/addons/2-networking-test/context.tf +++ b/fast/addons/2-networking-test/context.tf @@ -38,7 +38,7 @@ locals { # recompose subnet ids checking for context substitutions _subnets = { for k, v in local._subnet_attrs : k => merge(v, v.region_alias == null ? {} : { - id = try(replace(v.id, v.region, v.region_alias)) + id = try(replace(v.id, v.region, v.region_alias)) region = coalesce(v.region_alias, v.region) }) } diff --git a/fast/addons/2-networking-test/outputs.tf b/fast/addons/2-networking-test/outputs.tf index 2273805f29..a62486655b 100644 --- a/fast/addons/2-networking-test/outputs.tf +++ b/fast/addons/2-networking-test/outputs.tf @@ -29,3 +29,10 @@ output "instance_ssh" { ) } } + +output "service_account_emails" { + description = "Service account emails." + value = { + for k, v in module.service-accounts : k => v.email + } +}