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: Destroy | |
on: | |
workflow_dispatch: | |
jobs: | |
destroy: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: terraform | |
permissions: | |
id-token: write | |
contents: read | |
pull-requests: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.inputs.branch }} | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ vars.AWS_IAM_ROLE }} | |
aws-region: ${{ vars.AWS_REGION }} | |
- name: Setup Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
cli_config_credentials_token: ${{ secrets.TF_CLOUD_USER_API_TOKEN }} | |
- name: Terraform Init | |
run: terraform init | |
- name: Terraform Destroy | |
run: terraform destroy -auto-approve |