Skip to content

Commit

Permalink
adding terraform destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
CloudyBae committed Apr 13, 2024
1 parent 7d430a3 commit de36fec
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 114 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ name: 'Terraform'
on:
push:
branches: [ "deploy" ]
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
terraform:
name: 'Terraform'
terraform-apply:
name: 'Terraform Apply'
runs-on: ubuntu-latest
defaults:
run:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: 'Terraform Destroy'

on:
workflow_dispatch:

permissions:
id-token: write
contents: read

jobs:
terraform-destroy:
name: 'Terraform Destroy'
runs-on: ubuntu-latest
defaults:
run:
shell: bash

steps:
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: "${{ secrets.AWS_ARN }}"
aws-region: us-east-1

- name: Checkout
uses: actions/checkout@v3

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: 1.4.6

- name: Terraform Init
run: terraform init
working-directory: terraform

- name: Terraform Destroy
run: terraform destroy -auto-approve
working-directory: terraform
112 changes: 0 additions & 112 deletions .github/workflows/terraform-plan.txt

This file was deleted.

0 comments on commit de36fec

Please sign in to comment.