-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
init commit: testing delete action to help keep aws accounts clean
- Loading branch information
1 parent
8eafcd7
commit f8e8437
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Dispatch - Delete Leaf Stack | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: "The leaf stack to delete" | ||
required: true | ||
|
||
env: | ||
EXAMPLES_PATH: ./Examples # No trailing slash plz! | ||
|
||
jobs: | ||
cdk-destroy-leaf: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: write | ||
contents: read | ||
environment: "${{ inputs.environment }}" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
## Install Everything / Setup Env Vars: | ||
- name: Setup CDK | ||
uses: ./.github/workflows/composite-setup-cdk | ||
with: | ||
secrets: ${{ toJson(secrets) }} | ||
vars: ${{ toJson(vars) }} | ||
|
||
## Log into AWS: | ||
- uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-region: "${{ vars.AWS_REGION }}" | ||
role-to-assume: "arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ vars.AWS_DEPLOY_ROLE }}" | ||
|
||
## Destroy the Leaf Stack: | ||
- name: "Destroying: ${{ inputs.environment }}" | ||
run: | | ||
make cdk-destroy-leaf \ | ||
config-file="${{ env.EXAMPLES_PATH }}/${{ inputs.environment }}" \ | ||
container-id=$(echo "${{ inputs.environment }}" | sed -E 's/-example\.ya?ml$//i') |