-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1.02 KB
/
destroy.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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