Cleanup

In this step, we will clean up all resources, we created during this lab, so that no further cost will occur.

1. Delete the AWS SAM template

In your Cloud9 IDE, run the following command to delete the resources we created with our AWS SAM template:

cd ~/environment/wild-rydes-async-messaging/lab-3
aws cloudformation delete-stack \
    --stack-name wild-rydes-async-msg-3

2. Delete the AWS Lambda created Amazon CloudWatch Log Group

Run the following command to delete all the log groups associated with the labs.

aws logs describe-log-groups --query 'logGroups[*].logGroupName' --output table | awk '{print $2}' | \
    grep ^/aws/lambda/wild-ryde | while read x; \
    do  echo "deleting $x" ; aws logs delete-log-group --log-group-name $x; \
done 

3. Delete S3 bucket used to upload code package

You can delete the S3 bucket by going to the console or using the CLI. Please follow one of the options below to delete the bucket.

3. Delete the Amazon S3 bucket

In your Amazon S3 console, filter for the bucket you have created to upload your code artifacts with AWS SAM, select the bucket and click the Delete button in the top.

Detailed description

You are done!

3. Delete the Amazon S3 bucket

In your Cloud9 IDE, run the following command to delete the Amazon S3 bucket we created earlier:

aws s3 rb s3://${BUCKET_NAME} —-force

You are done!