auto-terraform-apply-03-aws-github-actions-oidc #6331
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: auto-terraform-apply-03-aws-github-actions-oidc | |
permissions: | |
id-token: write # for fetching the OIDC token | |
contents: read # for actions/checkout | |
pull-requests: write # For dflook comments on PR | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 10 * * *" | |
jobs: | |
tf-apply: | |
runs-on: ubuntu-latest | |
name: 03-aws-github-actions-oidc - apply approved terraform plan | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
ref: master | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 | |
with: | |
role-to-assume: ${{ secrets.OIDC_ROLE_ARN }} | |
role-session-name: GithubActionsTerraform | |
aws-region: eu-west-1 | |
- name: Terraform apply | |
uses: dflook/terraform-apply@7d435d4d115a11e5db1e710ac969f5382f0f6f9f # v1 | |
with: | |
path: examples/03-aws-github-actions-oidc | |
auto_approve: true | |
# TODO: maybe we can try to 'docker push' here to the ECR repo as an example that the OIDC works |