Teardown
Progress checklist
Overview
Section titled “Overview”demo.sh down tears the lab down in order:
- Auth check + backup
.lab-state.json→.lab-state.json.bak - EventBridge / rebuild Lambda / ECR
- UI bucket
- Consumers (both OS probes) and lab VPCs in each Region
- GPG signing secret (force-delete)
- Package buckets (empty all versions) and shared IAM roles
- Verify key resources are gone, then clear state +
.bak
Confirmation required (y). Idempotent re-runs treat already-gone resources
as success; incomplete teardown keeps state so you can fix and re-run.
-
Destroy (type
ywhen prompted):Terminal window export AWS_PROFILE=sandbox./scripts/demo.sh downAbbreviated finish:
Destroy lab resources described in …/.lab-state.json? [y/N] ystate backup: …/.lab-state.json.bak… delete-rule / delete-function / delete-repository …emptying ps3p-ui-**ACCOUNT**-syd (ap-southeast-2)tearing down consumer syd in ap-southeast-2tearing down consumer akl in ap-southeast-6… delete-secret … ps3p-gpg-<suffix> … --force-delete-without-recoveryemptying ps3p-pkgs-**ACCOUNT**-syd (ap-southeast-2)emptying ps3p-pkgs-**ACCOUNT**-akl (ap-southeast-6)down complete
Verify
Section titled “Verify”test ! -f .lab-state.json && test ! -f .lab-state.json.bak && echo "state cleared"state clearedaws s3api head-bucket --bucket ps3p-pkgs-**ACCOUNT**-syd --region ap-southeast-2aws s3api head-bucket --bucket ps3p-ui-**ACCOUNT**-syd --region ap-southeast-2An error occurred (404) when calling the HeadBucket operation: Not Foundaws lambda get-function --function-name ps3p-rebuild-<suffix> --region ap-southeast-2aws secretsmanager describe-secret --secret-id ps3p-gpg-<suffix> --region ap-southeast-2An error occurred (ResourceNotFoundException) when calling the GetFunction operation: Function not found: …An error occurred (ResourceNotFoundException) when calling the DescribeSecret operation: Secrets Manager can't find the specified secret.