After finishing the workshop, delete all created resources to avoid unnecessary AWS charges.
[!CAUTION] Delete resources in the correct order! Some services depend on others (e.g. you must remove NAT Gateway before its EIP can be released). Follow the steps below carefully.
| Service | Approx. Monthly Cost |
|---|---|
| NAT Gateway | ~$35 |
| RDS Multi-AZ | ~$28 |
| ECS Fargate (2 tasks) | ~$20 |
| ALB | ~$18 |
| EC2 (2x t3.micro) | ~$15 |
| Total | ~$116/month |
Console: Amplify → Your app → Actions → Delete app
Console: CloudFront → Distributions → Select distribution → Disable (wait ~5 min) → Delete
Console: Elastic Beanstalk → Applications → Smartinvoice-api → Environments → Smartinvoice-api-env → Actions → Terminate environment
Wait for environment to terminate fully before proceeding.
Console: ECS → Clusters → smartinvoice-cluster
smartinvoice-ocr-task-service → Delete service (set desired tasks to 0 first)Console: EC2 → Load Balancers → Select alb-smartinvoice-ocr → Actions → Delete
Delete the target group tg-ocr-ai as well.
Console: RDS → Databases → smartinvoice-db → Actions → Delete
Console: ECR → Repositories → Delete smartinvoice-backend and smartinvoice-ocr
Wait for status Deleted, then:
Console: VPC → Elastic IPs → Select the allocated EIP → Release Elastic IP address
Console: VPC → Your VPCs → smartinvoice-vpc → Actions → Delete VPC
This will also delete associated subnets, route tables, internet gateway, and security groups.
Console: Systems Manager → Parameter Store → Select all /SmartInvoice/prod/* parameters → Delete
Console: SQS → Select smartinvoice-ocr-queue and smartinvoice-vietqr-queue → Delete
Console: Cognito → User Pools → smart-invoice pool → Delete
Console: IAM → Roles → Delete:
aws-elasticbeanstalk-ec2-roleaws-elasticbeanstalk-service-roleecsTaskExecutionRolesmartinvoice-ecs-task-roleConsole: S3 → Select smart-invoice-shield-storage → Empty (delete all objects first) → Delete bucket
Console: CloudWatch → Log groups → Delete /ecs/smartinvoice-ocr-task and any other log groups created.
After cleanup, verify in the AWS Console:
[!TIP] Use AWS Cost Explorer (Billing → Cost Explorer) to monitor any lingering charges from the lab for the next 24–48 hours.