Clean Up Resources
Clean Up Resources
After completing the workshop, it’s essential to clean up AWS resources to avoid unexpected costs beyond the Free Tier. This section guides you through deleting the resources created: CloudFront, S3, API Gateway, Lambda, DynamoDB, and IAM.
Why Clean Up:
- Cost Savings: Prevent unnecessary charges from unused resources.
- Security: Remove IAM permissions and resources to avoid unauthorized access.
- Organization: Keep your AWS account tidy for future projects.
Clean Up Resources
Delete CloudFront Distribution
- Go to CloudFront.
- Select the distribution you created (e.g.,
d1234567890abcdef.cloudfront.net
). - Click Disable, wait for the status to change to Disabled.
- Click Delete to remove the distribution.

Delete S3 Bucket
- Go to S3.
- Select the bucket you created (e.g.,
blog-workshop-<your-account-id>
). - Click Empty, type
permanently delete
to confirm, then select Empty. - After the bucket is emptied, click Delete, enter the bucket name in the confirmation field, and click Delete bucket.

Delete API Gateway
- Go to API Gateway.
- Select the
BlogAPI
API. - Click Actions → Delete, enter the API name to confirm, then click Delete.

Delete Lambda Functions
- Go to Lambda.
- Select the
getPosts
function, click Actions → Delete, and confirm. - Repeat for the
createPost
function.

Delete DynamoDB Table
- Go to DynamoDB.
- Select the
Posts
table. - Click Actions → Delete table, enter the table name to confirm, then click Delete.

Clean Up IAM Resources
- Go to IAM.
- Under Policies, select the
lambda-blog-policy
(or similar), click Delete, and confirm. - Under Roles, select the
lambda-blog-role
, click Delete, and confirm.

Ensure the S3 bucket is emptied before deleting it.
Double-check resources to avoid deleting those used by other projects.
If deletion fails (e.g., resources in use), check dependencies (like Lambda permissions or API Gateway integrations).
Done
- You have successfully cleaned up all resources related to the workshop, preventing further costs.