From 03fafdc5a1fa4169292f8f675324eaf8d7fd9683 Mon Sep 17 00:00:00 2001 From: shenlan Date: Tue, 30 Sep 2025 16:34:08 +0800 Subject: [PATCH] Load AWS region from backend credentials --- iac_modules/pulumi/iac_run.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/iac_modules/pulumi/iac_run.sh b/iac_modules/pulumi/iac_run.sh index f7e47555..9bdd7669 100755 --- a/iac_modules/pulumi/iac_run.sh +++ b/iac_modules/pulumi/iac_run.sh @@ -118,7 +118,11 @@ except yaml.YAMLError as exc: exports = [] iac_state = find_section(data, "iac_state") -maybe_export("IAC_STATE_BACKEND", select_backend(find_section(iac_state, "backend")), exports) + backend_section = find_section(iac_state, "backend") + maybe_export("IAC_STATE_BACKEND", select_backend(backend_section), exports) + backend_region = find_value(backend_section, "region", "aws_region", "default_region") + maybe_export("AWS_REGION", backend_region, exports) + maybe_export("AWS_DEFAULT_REGION", backend_region, exports) state_auth = find_section(iac_state, "auth") maybe_export("AWS_ACCESS_KEY_ID", find_value(state_auth, "ak", "access_key"), exports)