Chapter 11 of 12
LIVE BUILD
Step 6, clean up
Step 6. Clean up
Delete in this order, so nothing is left running:
- Service
course-web-svc: set desired tasks to 0, then Delete service. - EC2, Load balancers: delete
course-web-alb. Target groups: deletecourse-web-tg. - Cluster
course-demo: Delete cluster. Then open CloudFormation and check that the stack whose name starts withInfra-ECS-Cluster-course-demois gone. If it is still there, delete it: it holds the Auto Scaling group and the EC2 instances, which keep running (and billing) until it is gone. - VPC, NAT gateways: delete the NAT gateway and wait until it shows Deleted. Then Elastic IPs: release the address it used.
- VPC, Your VPCs: select
course-vpc, Delete VPC. The console also deletes the subnets, internet gateway, route tables, S3 gateway endpoint and security groups in it. Instances, the load balancer and the NAT gateway have to be gone first, which is why this step comes last. - Task definition
course-web: deregister revision 1. CloudWatch Logs: delete the/ecs/course-weblog group.
The two IAM roles the wizards created,
ecsInstanceRoleandecsTaskExecutionRole, can stay. They cost nothing and the next build reuses them.- Service

