Teardown and Cleanup
Reverse-provisioning teardown order
Section titled “Reverse-provisioning teardown order”- Cleanup API and hosting surfaces first ( AMPLIFY
AWS Amplify — hosts the walkthrough dashboard frontend and connects it to the query API URL. and API Gateway
Amazon API Gateway — exposes HTTP routes for latest telemetry and recent events. The browser reads data through API Gateway, not DynamoDB directly. workflow) - Destroy TERRAFORM
HashiCorp Terraform — provisions shared infrastructure (IoT rules fan-out, Lambda, DynamoDB, API Gateway, Amplify). -managed infrastructure - Deprovision device credentials and IoT Core
AWS IoT Core — managed MQTT broker with X.509 device authentication for ESP32 telemetry and events. registration
Terraform destroy
Section titled “Terraform destroy”terraform -chdir=terraform destroyDevice deprovisioning
Section titled “Device deprovisioning”Full teardown (device + CloudFormation stack):
FORCE=1 REMOVE_LOCAL=1 AWS_REGION=ap-southeast-2 THING_NAME=esp32-c ./aws/deprovision.shPartial cleanup:
# Device only — keep Phase 1 CloudFormation stackFORCE=1 DEVICE_ONLY=1 AWS_REGION=ap-southeast-2 THING_NAME=esp32-c ./aws/deprovision.sh
# Shared infra only — delete stack esp32-demo-phase1; keep Thing/certsFORCE=1 INFRA_ONLY=1 AWS_REGION=ap-southeast-2 ./aws/deprovision.shFORCE=1 is required — the script deletes AWS resources.
Source and supporting links
Section titled “Source and supporting links”- Source repository: esp32-aws-iot-demo
- Payload spec: PAYLOAD.md
- Firmware/system architecture: ARCHITECTURE.md
- AWS provisioning notes: aws/README.md
- Terraform notes: terraform/README.md