Clean up

To avoid incurring ongoing AWS charges after completing the workshop, follow the steps below to delete all resources created during this workshop.

These steps are irreversible. Once deleted, all user accounts in the Cognito User Pool and all files in the S3 bucket will be permanently lost. Make sure you no longer need the resources before proceeding.

Step 1 — Delete the Cognito User Pool

  • Open Amazon Cognito console.
    • Select User pools on the left menu.

    • Select the radio button next to User pool - jbm5in (your User Pool).

    • Click the Delete button.

      Cognito User pools - select and click Delete

    • In the Delete user pool dialog:

      • Check both prerequisite checkboxes:
        • Delete Cognito domain …
        • Deactivate deletion protection
      • Enter the User Pool name (e.g., User pool - jbm5in) in the confirmation field.
      • Click Delete.

      Delete user pool dialog - confirm and delete

    • Confirm the banner shows “User pool has been deleted successfully”.

      Cognito - User pool deleted successfully

Step 2 — Delete the SAM Application (CloudFormation Stack)

  • Run the following commands to delete the SAM stacks.

    sam delete --stack-name fcaj-book-shop
    sam delete --stack-name aws-sam-cli-managed-default
    

    sam delete will prompt you to confirm before deleting. Enter y for each prompt. This command deletes the CloudFormation stack along with all Lambda functions, API Gateway, DynamoDB table, and IAM roles created by SAM.

Step 3 — Delete the S3 Bucket

  • Empty the S3 bucket first, then delete it.

    aws s3 rm s3://fcaj-book-shop-by-tranvix --recursive
    

    aws s3 rm - emptying the bucket

  • Open Amazon S3 Console.

    • Select the radio button next to fcaj-book-shop-by-tranvix.

    • Click the Delete button.

      S3 Console - select bucket and click Delete

    • On the Delete bucket page:

      • Type the bucket name fcaj-book-shop-by-tranvix in the confirmation field.
      • Click Delete bucket.

      Delete bucket confirmation - type name and confirm

    • Confirm the banner shows “Successfully deleted bucket”.

      S3 - bucket deleted successfully

You have successfully completed the cleanup. All AWS resources created during this workshop have been removed, and you will not be charged for them going forward.

If you also want to delete the aws-sam-cli-managed-default S3 bucket (created automatically by SAM CLI), follow the same steps in Step 3 for that bucket as well.