Clean Up Resources

After completing the workshop, deleting all provisioned resources is an essential step to prevent unexpected cloud charges and keep your AWS account clean.

Please perform the teardown according to the following sequence:

  1. Delete manually created SQS queues and subscriptions.
  2. Empty the Amazon S3 bucket.
  3. Delete the AWS CloudFormation stack.
  4. Verify on the Console to ensure all resources have been completely decommissioned.

Delete Manually Created SQS Queue

  1. Open the Amazon SQS Console.
  2. Select the queue you created manually in Chapter 5: ColdBrewExpressQueue.
  3. Click the Delete button on the action bar above the table.

Select ColdBrewExpressQueue

  1. Type delete into the confirmation field, then click Delete.

Confirm SQS Queue Deletion

  1. Verify that ColdBrewExpressQueue has disappeared from the queues list.

Queue Deleted Successfully


Delete Email Subscription on Amazon SNS

  1. Open the Amazon SNS Console.
  2. In the left navigation menu, click Subscriptions.
  3. Locate and select your personal Email subscription pointing to the CoffeeOrders topic.
  4. Click the Delete button.

Select Email Subscription to Delete

Confirm Subscription Deletion


Empty the Amazon S3 Bucket

AWS CloudFormation cannot automatically delete an Amazon S3 Bucket if it still contains objects (such as the index.html file). You must empty the bucket before deleting the CloudFormation stack.

Empty via the Console

  1. Open the Amazon S3 Console.
  2. Click on the coffee shop bucket (beginning with aws-event-driven-architectures-wo-coffeeshopbucket-...).
  3. Click the Empty button on the top toolbar.

Select S3 Bucket to Empty

  1. Type permanently delete into the confirmation field, then click the Empty button.

Confirm Permanent Deletion of Objects in S3

  1. Click Exit to return to the buckets list.

Bucket Emptied

Quick Empty via AWS CLI

Run the following command in your terminal window:

aws s3 rm s3://<S3BucketName> --recursive

Delete the AWS CloudFormation Stack

Once the S3 bucket is cleared, CloudFormation will automatically tear down all remaining resources in a single operation.

  1. Open the AWS CloudFormation Console.
  2. Select the stack: aws-event-driven-architectures.
  3. Click button “Delete stack”.

Select CloudFormation Stack

  1. In the confirmation dialog, click Delete stack.

Confirm Delete Stack

  1. The stack status will transition to DELETE_IN_PROGRESS. CloudFormation will sequentially remove:

    • S3 Bucket and Bucket Policy.
    • SNS Topic CoffeeOrders and remaining subscriptions.
    • All SQS Queues (BaristaQueue, VIPExpressQueue, and BaristaDLQ).
    • Lambda Function order-publisher and its Function URL.
    • IAM Execution Role.
  2. After about 1 to 2 minutes, the stack will complete its deletion process and automatically vanish from the active stacks list.

Stack Completely Deleted


Verify Removal on AWS Management Console

  1. Verify SQS: Open Amazon SQS; no workshop queues should remain.
  2. Verify SNS: Open Amazon SNS; the CoffeeOrders topic should be deleted.
  3. Verify Lambda: Open AWS Lambda; the order-publisher function should no longer appear in the list.
  4. Verify S3: Open Amazon S3; the workshop bucket should be permanently deleted.

You have completed the Building an Event-Driven Architecture with Amazon SNS and SQS workshop!

Through this lab, you have:

  • Successfully designed and deployed a complete Event-Driven Architecture (EDA).
  • Mastered the Fan-Out pattern to distribute events asynchronously to both Email and kitchen queues.
  • Maximized the power of Amazon SNS Subscription Filter Policies for intelligent attribute-based routing.
  • Applied fault tolerance with a Dead-Letter Queue (DLQ) to isolate poison pill messages without disrupting the system.
  • Deployed an interactive static frontend on Amazon S3 and integrated it seamlessly with AWS Lambda Function URLs.