Commit aed889f2 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

fix(gcp): reduce scope of GCP App Default Creds script to template

parent a30c2180
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ spec:
        export AWS_ROLE_SESSION_NAME="GitLabRunner-${CI_PROJECT_ID}-${CI_PIPELINE_ID}"
      fi
    - !reference [ .tf-commands, default, init ]

variables:
  AWS_OIDC_AUD: $[[ inputs.aws-oidc-aud ]]
  AWS_OIDC_ROLE_ARN: $[[ inputs.aws-oidc-role-arn ]]
+38 −39
Original line number Diff line number Diff line
@@ -51,8 +51,7 @@ variables:
  GCP_PROD_OIDC_ACCOUNT: $[[ inputs.gcp-prod-oidc-account ]]
  GCP_PROD_OIDC_PROVIDER: $[[ inputs.gcp-prod-oidc-provider ]]

.gcp-provider-auth:
  before_script:
.tf-gcp-adc:
  - echo "Installing GCP authentication with env GOOGLE_APPLICATION_CREDENTIALS file"
  - echo $GCP_JWT > "$CI_BUILDS_DIR/.auth_token.jwt"
  - |-
@@ -97,6 +96,6 @@ variables:
      aud: "$GCP_OIDC_AUD"
  before_script:
    - !reference [.tf-base, before_script]
    - !reference [.gcp-provider-auth, before_script]
    - !reference [.tf-gcp-adc]
    - !reference [.tf-commands, init]
    - !reference [.tf-commands, select_workspace]