Delete Dev Environment #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: Set environment variables | |
uses: ./.github/actions/setvars | |
with: | |
envVarFile: ./.env | |
- 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 | |
- name: Destroy aws/system_status | |
run: | | |
cd env/dev/system_status | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/lambda-google-cidr | |
run: | | |
cd env/dev/lambda-google-cidr | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/quicksight | |
run: | | |
cd env/dev/quicksight | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/database-tools | |
run: | | |
cd env/dev/database-tools | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/heartbeat | |
run: | | |
cd env/dev/heartbeat | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/lambda-api | |
run: | | |
cd env/dev/lambda-api | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/rds | |
run: | | |
cd env/dev/rds | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/elasticache | |
run: | | |
cd env/dev/elasticache | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/eks | |
run: | | |
cd env/dev/eks | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/cloudfront | |
run: | | |
cd env/dev/cloudfront | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/ses_validation_dns_entries | |
run: | | |
cd env/dev/ses_validation_dns_entries | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/dns | |
run: | | |
cd env/dev/dns | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/pinpoint_to_sqs_sms_callbacks | |
run: | | |
cd env/dev/pinpoint_to_sqs_sms_callbacks | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/sns_to_sqs_sms_callbacks | |
run: | | |
cd env/dev/sns_to_sqs_sms_callbacks | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/ses_to_sqs_email_callbacks | |
run: | | |
cd env/dev/ses_to_sqs_email_callbacks | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/ses_receiving_emails | |
run: | | |
cd env/dev/ses_receiving_emails | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/ecr | |
run: | | |
cd env/dev/ecr | |
terragrunt destroy --terragrunt-non-interactive -auto-approve | |
- name: Destroy aws/common | |
run: | | |
cd env/dev/common | |
terragrunt destroy --terragrunt-non-interactive -auto-approve |