Skip to content

Commit 163865b

Browse files
feat: Updated GCP Authentication step with required attributes (#102)
1 parent 7933c1b commit 163865b

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

.github/workflows/terraform_workflow.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,9 @@ on:
6363
AWS_SESSION_TOKEN:
6464
required: false
6565
description: 'AWS Session Token to install AWS CLI'
66-
GCP_SA_KEY:
66+
GCP_CREDENTIALS:
6767
required: false
68-
description: 'GCP service account Secret access key to install GCP CLI'
69-
PROJECT_ID:
70-
required: false
71-
description: 'GCP Secret access key to install GCP CLI'
68+
description: 'The Google Cloud JSON service account key to use for authentication'
7269
env-vars:
7370
required: false
7471
description: 'Pass required environment variables'
@@ -109,13 +106,11 @@ jobs:
109106
with:
110107
creds: ${{ secrets.AZURE_CREDENTIALS }}
111108

112-
- name: Install GCP CLI
109+
- name: 'Authenticate to Google Cloud'
113110
if: ${{ inputs.provider == 'gcp' }}
114-
uses: google-github-actions/auth@v1
111+
uses: 'google-github-actions/auth@v1'
115112
with:
116-
service_account_key: ${{ secrets.GCP_SA_KEY }}
117-
project_id: ${{ secrets.PROJECT_ID }}
118-
region: ${{ inputs.gcp_region }}
113+
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
119114

120115
- name: Install doctl
121116
if: ${{ inputs.provider == 'digitalocean' }}

docs/terraform_workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
terraform_version: # Specify terraform version e.g 1.3.6
112112
destroy: # If the value is set to true, the workflow proceeds to the destroy step. However, the default value is false
113113
secrets:
114-
GCP_SA_KEY: # GCP service account Secret access key
114+
GCP_CREDENTIALS: # The Google Cloud JSON service account key to use for authentication
115115
env-vars: | # Specify env variables in following format
116116
key1=value1
117117
key2=value2

0 commit comments

Comments
 (0)