-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.06 KB
/
terraform-destroy.yml
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
39
40
41
42
43
---
name: Destroy CloudFront Environment
on:
pull_request:
types:
- closed
jobs:
terraform-destroy:
name: Destroy CloudFront Environment
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
concurrency:
group: terraform-apply-refs/pull/${{ github.event.number }}/merge
cancel-in-progress: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::771971951923:role/bpm-preview-provisioning
audience: sts.amazonaws.com
role-duration-seconds: 900
- name: Initialize Terraform
run: terraform init -backend-config="key=refs/pull/${{ github.event.number }}/merge.tfstate"
- name: Terraform Destroy
run: terraform destroy -var=ref=refs/pull/${{ github.event.number }}/merge -auto-approve