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 delete 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 clean up by deleting each of the services (posts, threads, and users) that are running in your cluster:
    • Navigate to the Amazon ECS console and select Clusters.
    • Select the BreakTheMonolith-Demo cluster.
    • In the Services tab, select a service and then select Delete.
    • Confirm the deletion.
    • Repeat the steps until all the services are deleted.

    Before proceeding to the next step, you need to either wait for all running tasks to terminate or select the Tasks tab and select Stop All.

    ♻ Repeat these steps for each of your services on the cluster.
  • Step 2. Delete Listeners

    delete listeners
  • Step 3. Delete Target Groups

    • Navigate to Target Groups in the EC2 console.
    • Check the checkbox at the top of the list (next to Name) to select all target groups.
    • Select Actions then select Delete.
    • Confirm the deletion.
    delete target group
  • Step 4. Delete your AWS CloudFormation Stack

    • Navigate to the AWS CloudFormation console.
    • In the left navigation menu, select Stacks.
    • Check the box next to the Cloudformation stack BreakTheMonolith-Demo.
    • Select Delete.
    • Confirm the deletion.
    • 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.
    • Select a task definition (api, posts, threads, or users).
    • On the Task Definition Name page, select the checkbox next to the task name.
    • Select Actions then from the drop-down list select Deregister.
    • Confirm your action.

    ♻ Repeat these steps for all four task definitions.

  • Step 6. Delete Amazon ECR Repositories

    • Navigate to Repositories in the Amazon ECR console.
    • Select the checkbox next to a repository and then select Delete.
    • Confirm the deletion.
    • Repeat the steps until all the repositories are deleted.

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 »