Skip to content

Delete Dev Environment #5

Delete Dev Environment

Delete Dev Environment #5

name: "Delete Dev Environment"
on:
workflow_dispatch:
defaults:
run:
shell: bash
env:
AWS_REGION: ca-central-1
permissions:
id-token: write # This is required for requesting the OIDC JWT
contents: read # This is required for actions/checkout
jobs:
terraform-destroy:
runs-on: ubuntu-latest
steps:
- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@8c3f20df09ac63af7b3ae3d7c91f105f857d8497 # v4.0.0
with:
role-to-assume: arn:aws:iam::800095993820:role/notification-terraform-apply
role-session-name: TerragruntDestroy
aws-region: ${{ env.AWS_REGION }}
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Install 1Pass CLI
run: |
curl -o 1pass.deb https://downloads.1password.com/linux/debian/amd64/stable/1password-cli-amd64-latest.deb
sudo dpkg -i 1pass.deb
- name: One Password Fetch
run: |
op read op://4eyyuwddp6w4vxlabrr2i2duxm/"TFVars - Dev"/notesPlain > /var/tmp/dev.tfvars
- name: Setup Terraform tools
uses: cds-snc/terraform-tools-setup@v1
env: # In case you want to override default versions
CONFTEST_VERSION: 0.30.0
TERRAFORM_VERSION: 1.6.2
TERRAGRUNT_VERSION: 0.44.4
TF_SUMMARIZE_VERSION: 0.2.3
- name: Inject token authentication
run: |
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
- name: Destroy aws/system_status_static_site
run: |
cd env/dev/system_status_static_site
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/system_status
run: |
cd env/dev/system_status
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/lambda-google-cidr
run: |
cd env/dev/lambda-google-cidr
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/quicksight
run: |
cd env/dev/quicksight
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/database-tools
run: |
cd env/dev/database-tools
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/heartbeat
run: |
cd env/dev/heartbeat
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/lambda-api
run: |
cd env/dev/lambda-api
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/rds
run: |
cd env/dev/rds
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/elasticache
run: |
cd env/dev/elasticache
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/eks
run: |
cd env/dev/eks
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/cloudfront
run: |
cd env/dev/cloudfront
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/ses_validation_dns_entries
run: |
cd env/dev/ses_validation_dns_entries
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/dns
run: |
cd env/dev/dns
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/pinpoint_to_sqs_sms_callbacks
run: |
cd env/dev/pinpoint_to_sqs_sms_callbacks
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/sns_to_sqs_sms_callbacks
run: |
cd env/dev/sns_to_sqs_sms_callbacks
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/ses_to_sqs_email_callbacks
run: |
cd env/dev/ses_to_sqs_email_callbacks
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/ses_receiving_emails
run: |
cd env/dev/ses_receiving_emails
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/ecr
run: |
cd env/dev/ecr
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars
- name: Destroy aws/common
run: |
cd env/dev/common
terragrunt destroy --terragrunt-non-interactive -auto-approve -var-file /var/tmp/dev.tfvars