Terraform Destroy #2
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: Terraform Destroy | |
on: | |
workflow_dispatch: | |
permissions: write-all | |
jobs: | |
destroy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: configure aws credentials | |
uses: aws-actions/[email protected] | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_ARN }} | |
role-session-name: GitHub_to_AWS_via_FederatedOIDC | |
aws-region: ${{ secrets.AWS_REGION }} | |
- name: install terraform | |
uses: hashicorp/setup-terraform@v2 | |
- name: checkout repository | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: terraform init | |
run: terraform init | |
working-directory: terraform/environments/prod | |
- name: terraform destroy | |
run: terraform destroy -auto-approve | |
working-directory: terraform/environments/prod |