Skip to content

Destroy

Destroy #1

name: Destroy
on:
workflow_dispatch:
inputs:
aws_resource_identifier:
description: Resource Identifier for deployed resources
tf_state_bucket:
description: Bucket containing tf-state
tf_state_bucket_destroy:
default: true
type: boolean
environment:
descritpion: Environment name
required: true
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
destroy:
runs-on: ubuntu-latest
environment:
name: ${{ github.event.inputs.environment }}
steps:
- id: destroy
name: Destroy
uses: bitovi/[email protected]
with:
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID_JIRA_INTEGRATIONS}}
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY_JIRA_INTEGRATIONS}}
aws_default_region: us-east-1
stack_destroy: "true"
aws_resource_identifier: ${{ github.event.inputs.aws_resource_identifier }}
tf_state_bucket: ${{ github.event.inputs.tf_state_bucket }}
tf_state_bucket_destroy: ${{ github.event.inputs.tf_state_bucket_destroy }}
# Provide a secret called `DOT_ENV` to append environment variables to the .env file
dot_env: ${{ secrets.DOT_ENV }}
- if: ${{ steps.deploy.outputs.vm_url != '' }}
name: Print result created
run: |
echo "## VM Created! :rocket:" >> $GITHUB_STEP_SUMMARY
echo " ${{ steps.deploy.outputs.vm_url }}" >> $GITHUB_STEP_SUMMARY
- if: ${{ steps.deploy.outputs.vm_url == '' }}
name: Print result destroyed
run: |
echo "## VM Destroyed! :boom:" >> $GITHUB_STEP_SUMMARY
echo "Buckets and whole infrastructure should be gone now!" >> $GITHUB_STEP_SUMMARY