From ce18d64140033276d65ec9e770fbd9c3cf9b5dbb Mon Sep 17 00:00:00 2001 From: Andrew Pearce Date: Tue, 3 Dec 2024 09:54:50 +0000 Subject: [PATCH] fix assume role for local init --- terraform/account/.envrc | 2 +- terraform/environment/.envrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/account/.envrc b/terraform/account/.envrc index 2c5a6515ed..55b5e2778d 100644 --- a/terraform/account/.envrc +++ b/terraform/account/.envrc @@ -1,5 +1,5 @@ source ../../scripts/switch-terraform-version.sh -export TF_CLI_ARGS_init="-backend-config=role_arn=arn:aws:iam::311462405659:role/operator -upgrade -reconfigure" +export TF_CLI_ARGS_init="-backend-config=\"assume_role={role_arn=\\\"arn:aws:iam::311462405659:role/operator\\\"}\" -upgrade -reconfigure" export TF_WORKSPACE=development export TF_VAR_default_role=operator export TF_VAR_pagerduty_api_key=$(aws-vault exec mlpa-dev -- aws secretsmanager get-secret-value --secret-id "pagerduty_api_key" | jq -r .'SecretString') diff --git a/terraform/environment/.envrc b/terraform/environment/.envrc index 4b56e6f36a..af13fa8790 100644 --- a/terraform/environment/.envrc +++ b/terraform/environment/.envrc @@ -1,7 +1,7 @@ #!/usr/bin/env bash source ../../scripts/switch-terraform-version.sh -export TF_CLI_ARGS_init="-backend-config=role_arn=arn:aws:iam::311462405659:role/operator -upgrade -reconfigure" +export TF_CLI_ARGS_init="-backend-config=\"assume_role={role_arn=\\\"arn:aws:iam::311462405659:role/operator\\\"}\" -upgrade -reconfigure" export TF_VAR_default_role=operator export TF_VAR_pagerduty_api_key=$(aws-vault exec mlpa-dev -- aws secretsmanager get-secret-value --secret-id "pagerduty_api_key" | jq -r .'SecretString') export TF_VAR_container_version=$(aws-vault exec management-global -- aws ssm get-parameter --name "/modernising-lpa/container-version/production" --query 'Parameter.Value' --output text)