Tear down
Progress checklist
Overview
Section titled “Overview”Tear down means remove everything this walkthrough created. Two confirms, in order:
export AWS_PROFILE=sandboxexport AWS_REGION=ap-southeast-2export S3X_LAB_ALLOW_AWS=1./scripts/demo.sh down # type LAB_SUFFIX./scripts/image.sh down # type s3x-hotlookup-harness| Step | Wrapper | Deletes |
|---|---|---|
| 1 | demo.sh down | EC2, Standard + directory buckets, VPC / endpoints / SG, lab IAM, .lab-state.json |
| 2 | image.sh down | ECR repo + images, CodeBuild project, source bucket, CodeBuild role, .image-state.json |
Skipping step 2 leaves billable ECR storage and the CodeBuild source bucket.
demo.sh down terminate EC2 → empty + delete both buckets → VPC endpoints → subnet / routes / IGW → VPC → lab IAM
image.sh down → CodeBuild project → source bucket → ECR images + repo → CodeBuild role-
Remove the lab (
demo.sh down).Terminal window export AWS_PROFILE=sandboxexport AWS_REGION=ap-southeast-2export S3X_LAB_ALLOW_AWS=1./scripts/demo.sh downLooks like (verified; type your stored
LAB_SUFFIXwhen prompted — IDs are yours):This will delete VPC vpc-…, buckets, instance, and IAM for LAB_SUFFIX=20260920120148Type the LAB_SUFFIX to confirm: 20260920120148Waiting for instance termination…+ aws … ec2 terminate-instances --instance-ids i-…+ aws … s3api delete-bucket --bucket s3x-hotlookup-20260920120148-123456789012+ aws … s3api delete-bucket --bucket s3x-hotlookup-20260920120148--apse2-az1--x-s3+ aws … ec2 delete-vpc-endpoints --vpc-endpoint-ids vpce-… vpce-…+ aws … ec2 delete-subnet …+ aws … ec2 delete-route-table …+ aws … ec2 detach-internet-gateway …+ aws … ec2 delete-internet-gateway …+ aws … ec2 delete-vpc --vpc-id vpc-…Teardown complete. Removed …/.lab-state.json -
Remove the image pipeline (
image.sh down).Required for a clean account. Type
s3x-hotlookup-harnessto confirm.Terminal window export AWS_PROFILE=sandboxexport AWS_REGION=ap-southeast-2export S3X_LAB_ALLOW_AWS=1./scripts/image.sh downLooks like (verified):
This deletes ECR repo s3x-hotlookup-harness, CodeBuild s3x-hotlookup-harness,bucket s3x-hotlookup-cb-123456789012, and role s3x-hotlookup-codebuildType the ECR repository name to confirm: s3x-hotlookup-harness+ aws … ecr batch-delete-image …+ aws … ecr delete-repository --repository-name s3x-hotlookup-harness …Image pipeline teardown complete. -
Manual lab order (only if you cannot use the wrappers).
Terminal window # stop harness container on the instance, then:aws ec2 terminate-instances --instance-ids "$INSTANCE_ID"aws ec2 wait instance-terminated --instance-ids "$INSTANCE_ID"aws s3 rm "s3://${STD_BUCKET}" --recursiveaws s3api delete-bucket --bucket "$STD_BUCKET"aws s3 rm "s3://${DIR_BUCKET}" --recursiveaws s3api delete-bucket --bucket "$DIR_BUCKET"# delete vpc endpoints, then subnet/route/igw/vpc# remove role from instance profile, delete profile, delete-role-policy, delete-role# then still run: ./scripts/image.sh down
Verify
Section titled “Verify”Sweep with the cleanup checklist. Nothing with the
s3x-hotlookup- prefix should remain.
After the lab, read Where Express fits — single-AZ latency is not multi-AZ durability; do not keep the only copy of important data on Express.