|
10 | 10 | required: false |
11 | 11 | type: string |
12 | 12 | default: './examples/complete/' |
| 13 | + provider: |
| 14 | + required: true |
| 15 | + type: string |
| 16 | + default: gcp |
| 17 | + description: 'Cloud provider to run the workflow. e.g. azurerm or aws or gcp' |
13 | 18 | terraform_version: |
14 | 19 | description: 'Terraform version to use. Leave empty for the latest version.' |
15 | 20 | required: false |
|
24 | 29 | required: false |
25 | 30 | default: false |
26 | 31 | type: string |
| 32 | + token_format: |
| 33 | + required: false |
| 34 | + type: string |
| 35 | + default: access_token |
| 36 | + description: 'Output format for the generated authentication token. For OAuth 2.0 access tokens, specify "access_token". For OIDC tokens, specify "id_token". To skip token generation, leave this value empty' |
| 37 | + access_token_lifetime: |
| 38 | + required: false |
| 39 | + type: string |
| 40 | + default: 300s |
| 41 | + description: 'Desired lifetime duration of the access token, in seconds' |
| 42 | + project_id: |
| 43 | + required: false |
| 44 | + type: string |
| 45 | + description: 'ID of the default project to use for future API calls and invocations.' |
| 46 | + create_credentials_file: |
| 47 | + required: false |
| 48 | + type: string |
| 49 | + default: false |
| 50 | + description: 'If true, the action will securely generate a credentials file which can be used for authentication via gcloud and Google Cloud SDKs.' |
27 | 51 | secrets: |
28 | 52 | AWS_ACCESS_KEY_ID: |
29 | 53 | description: 'aws access keys' |
|
34 | 58 | GCP_CREDENTIALS: |
35 | 59 | description: 'The Google Cloud JSON service account key to use for authentication' |
36 | 60 | required: false |
| 61 | + WORKLOAD_IDENTITY_PROVIDER: |
| 62 | + required: false |
| 63 | + description: 'The full identifier of the Workload Identity Provider' |
| 64 | + SERVICE_ACCOUNT: |
| 65 | + required: false |
| 66 | + description: 'The service account to be used' |
37 | 67 |
|
38 | 68 |
|
39 | 69 | jobs: |
@@ -84,10 +114,16 @@ jobs: |
84 | 114 | aws-region: us-east-1 |
85 | 115 |
|
86 | 116 | - name: 'Authenticate to Google Cloud' |
87 | | - if: ${{ inputs.gcp_credentials == 'true' }} |
| 117 | + if: ${{ inputs.provider == 'gcp' }} |
88 | 118 | uses: 'google-github-actions/auth@v2' |
89 | 119 | with: |
90 | 120 | credentials_json: '${{ secrets.GCP_CREDENTIALS }}' |
| 121 | + create_credentials_file: ${{ inputs.create_credentials_file }} |
| 122 | + token_format: ${{ inputs.token_format }} |
| 123 | + workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }} |
| 124 | + service_account: ${{ secrets.SERVICE_ACCOUNT }} |
| 125 | + access_token_lifetime: ${{ inputs.access_token_lifetime }} |
| 126 | + project_id: ${{ inputs.project_id }} |
91 | 127 |
|
92 | 128 | # - Installing terraform version based on version extract. |
93 | 129 | - name: Install Terraform v${{ inputs.terraform_version || needs.versionExtract.outputs.maxVersion }} |
|
0 commit comments