Fix AWS resources matrix workflow auth configuration

This commit is contained in:
cloudneutral 2025-12-11 11:02:13 +08:00
parent a50fa473b5
commit c9235aef2b

View File

@ -5,7 +5,7 @@ on:
paths:
- 'iac-template/terraform-hcl-standard/aws-cloud/component/ec2/**'
- 'iac-template/terraform-hcl-standard/aws-cloud/component/object/**'
- '.github/workflows/terraform-standard-iac-pipeline-resources-matrix.yaml'
- '.github/workflows/terraform-standard-iac-pipeline-aws-resources-matrix.yaml'
workflow_dispatch:
inputs:
dry_run:
@ -21,7 +21,7 @@ env:
jobs:
terraform:
name: "${{ matrix.env }} :: pipeline (dry_run=${{ inputs.dry_run }})"
name: "${{ matrix.component }} :: pipeline (dry_run=${{ inputs.dry_run }})"
runs-on: ubuntu-latest
strategy:
@ -46,9 +46,11 @@ jobs:
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }}
aws-region: ${{ env.AWS_REGION }}
role-to-assume: ${{ env.AWS_ROLE_ARN }}
role-session-name: github-actions
role-chaining: true
role-skip-session-tagging: true
- name: Init
@ -69,6 +71,6 @@ jobs:
run: echo "Dry run enabled → skip apply step."
- name: Output
working-directory: ${{ env.BASE_DIR }}/${{ matrix.compoent }}
working-directory: ${{ env.BASE_DIR }}/${{ matrix.component }}
if: ${{ env.DRY_RUN == 'false' }}
run: terraform output -json