In this module, you will terminate the resources you created during this tutorial. You will stop the services running on Amazon ECS, delete the ALB, and rollback the AWS CloudFormation stack to terminate the ECS cluster, including all underlying EC2 instances.

Cleaning up is not required, but will help you avoid ongoing charges for keeping these services running. Start Cleaning


Follow the instructions below to delete the AWS resources you created in each module.

  • Step 1. Turn off your Services

    Start cleaning up by spinning down each of the services you have running on your cluster.
    • posts
    • threads
    • users
     
    Update Service
    • Open your cluster and click into a service.
    • Select Update
    • Change Number of tasks to 0
    • Select Update Service
    • Select View Service to go back
     
    Delete Service
    • Select delete on the service console page and confirm.
    • You will get a confirmation message and your cluster will be empty.
    ♻ Repeat these steps for each of your services on the cluster.
    empty cluster
  • Step 2. Delete Listeners

    delete listeners
  • Step 3. Delete Target Groups

    • Navigate to Target Groups in the EC2 console.
    • Check the box at the top of the list to select all target groups.
    • Select Actions > Delete.
    • Confirm Delete.
    delete target group
  • Step 4. Rollback your AWS CloudFormation Stack

    • Navigate to the AWS CloudFormation console.
    • Check the box next to the Cloudformation stack you created earlier: BreakTheMonolith-Demo.
    • Select Actions > Delete Stack.
    • Confirm Delete.
    • The stack status should change to DELETE_IN_PROGRESS.

     

    WARNING! Leaving a stack running will result in charges on your AWS account.

    delete stacks
  • Step 5. Deregister Task Definitions

    • Navigate to Task Definitions in the Amazon ECR console.
    • Click into a task definition. You will see a list of task definition revisions.
    • Select all using the checkbox at the top of the list.
    • Select Actions > Deregister and confirm.

     

    ♻ Repeat these steps for all four task definitions

  • Step 6. Delete Amazon ECR Repositories

    • Navigate to Repositories in the Amazon ECR console.
    • Check the box at the top of the list to select all repositories
    • Select Delete Repository and confirm.
    • You will see a confirmation message and should have no more repositories.
    delete repositories

Learn More

Get an overview of running and managing large scale applications as microservices using Amazon Elastic Container Service (Amazon ECS). Watch the Presentation »

Get Help

Learn more about using Amazon ECS to build and operate containerized architectures on AWS.
See Amazon ECS Resources »

Dive Deeper

Learn best practices for building and running microservices on AWS to speed up deployment cycles, foster innovation, and improve scalability. Read the Whitepaper »