Commit 49478a77 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

Merge branch 'master' into 'master'

fix: terraform backend initlization

See merge request to-be-continuous/terraform!114
parents 3f6b0e2f 06314f96
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -24,9 +24,6 @@ spec:
---
.tf-commands:
  init:
    - !reference [ .tf-commands, default, init ]
    # init Assume Role with Web Identity Configuration
    # see: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#assume-role-with-web-identity-configuration-reference
    - |
      if [[ "$ENV_TYPE" ]]
      then
@@ -47,7 +44,9 @@ spec:
        export AWS_ROLE_ARN="${env_role_arn:-$AWS_OIDC_ROLE_ARN}"
        export AWS_ROLE_SESSION_NAME="GitLabRunner-${CI_PROJECT_ID}-${CI_PIPELINE_ID}"
      fi

    - !reference [ .tf-commands, default, init ]
    # init Assume Role with Web Identity Configuration
    # see: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#assume-role-with-web-identity-configuration-reference
variables:
  AWS_OIDC_AUD: $[[ inputs.aws-oidc-aud ]]
  AWS_OIDC_ROLE_ARN: $[[ inputs.aws-oidc-role-arn ]]