Skip to content

Authenticate the Terraform workflows with OIDC (#188) #43

Authenticate the Terraform workflows with OIDC (#188)

Authenticate the Terraform workflows with OIDC (#188) #43

name: Apply Terraform changes on merge
on:
push:
branches:
- main # or any other branch you want to trigger the deployment
paths:
- '**/*.tf'
jobs:
terraform-apply:
name: Terraform Apply
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
id-token: write
contents: read
pull-requests: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::035866691871:role/devops-security-tf-apply
role-session-name: devopssecuritytfapply
aws-region: us-west-2
- name: Terraform Apply
uses: dflook/terraform-apply@v1
with:
path: terraform
backend_config_file: terraform/prod.backend.tfvars
auto_approve: true