Clean Up Resources to Avoid AWS Charges
Clean Up AWS Resources
To avoid unexpected charges, you need to delete the AWS resources created during this workshop in the following order:
1. Delete EventBridge Rule
- Go to AWS Console → EventBridge
- Select Rules
- Select the DatabaseBackup rule
- Click Delete
- Confirm deletion
2. Delete API Gateway
- Go to AWS Console → API Gateway
- Select FlyoraAPI
- Choose Actions → Delete API
- Confirm deletion by entering the API name
- Click Delete
3. Delete Lambda Functions
- Go to AWS Console → Lambda
- Delete the following Lambda functions:
- DynamoDB_API_Handler
- AutoImportCSVtoDynamoDB
- DatabaseBackupFunction
- For each function:
- Select the function → Actions → Delete
- Confirm deletion
4. Delete DynamoDB Tables
- Go to AWS Console → DynamoDB
- Select Tables
- Delete all tables created from CSV files:
- Select a table → Delete
- Confirm deletion by typing
delete
- Repeat for all tables (Products, Orders, Customers, Reviews, etc.)
5. Delete S3 Buckets and Objects
5.1. Delete Database Bucket
- Go to AWS Console → S3
- Select the flyora-bucket-database bucket
- Delete all objects in the bucket:
- Click Empty bucket
- Confirm by typing
permanently delete
- After the bucket is empty:
- Select the bucket → Delete bucket
- Confirm by entering the bucket name
5.2. Delete Backup Bucket
- Select the flyora-bucket-backup bucket
- Delete all objects:
- Click Empty bucket
- Confirm deletion
- Delete the bucket:
- Click Delete bucket
- Confirm by entering the bucket name
6. Delete IAM User and Access Key
- Go to AWS Console → IAM → Users
- Select the test user
- Go to the Security credentials tab
- Delete the Access Key you created:
- Select the Access Key → Actions → Delete
- Return to the Users list
- Select the test user → Delete user
- Confirm deletion
7. Delete IAM Roles
7.1. Delete LambdaAPIAccessRole
- Go to AWS Console → IAM → Roles
- Select LambdaAPIAccessRole
- Detach the attached policies:
AmazonDynamoDBFullAccessCloudWatchLogsFullAccessAWSXRayDaemonWriteAccess
- Click Delete role
- Confirm deletion
7.2. Delete LambdaS3DynamoDBRole
- Select LambdaS3DynamoDBRole
- Detach the policies:
AmazonS3FullAccessAmazonDynamoDBFullAccess_v2
- Click Delete role
- Confirm deletion
7.3. Delete LambdaDynamoDBBackupRole
- Select LambdaDynamoDBBackupRole
- Detach the policies:
AmazonDynamoDBReadOnlyAccessAmazonS3FullAccessAWSLambdaBasicExecutionRole
- Click Delete role
- Confirm deletion
8. Delete CloudWatch Logs
- Go to AWS Console → CloudWatch
- Select Logs → Log groups
- Find and delete the related log groups:
/aws/lambda/DynamoDB_API_Handler/aws/lambda/AutoImportCSVtoDynamoDB/aws/lambda/DatabaseBackupFunction/aws/apigateway/FlyoraAPI
- Select log group → Actions → Delete log group(s)
- Confirm deletion
9. Delete X-Ray Traces (Optional)
X-Ray traces automatically expire after 30 days and don’t incur storage charges, but you can manually delete them if desired.
- Go to AWS Console → X-Ray
- Select Traces
- Traces will be automatically deleted after the default retention period
10. Delete RDS and Subnet groups
- Go to Subnet groups, select the created subnet group, and click Delete.
- Go to Databases, select the created database → Actions → Delete.
11. Delete BirdShopChatBot Lambda and Layer
- Go to Functions, select BirdShopChatBot → Actions → Delete.
- Go to Layers, select the created layer, and click Delete.
12. Delete VPC, NAT Gateway, Elastic IP, and EC2
- Go to VPC, select the created NAT gateway → Actions → Delete NAT gateway.
- Select Elastic IPs → Actions → Release Elastic IP addresses.
- After deleting the NAT gateway and Elastic IP, go to Your VPCs, select the created VPC → Actions → Delete VPC.
- Go to EC2, select Instances, choose the created EC2 instance → Instance state → Terminate instance.
13. Delete Cloudfront
- Go to CloudFront, select the created distribution → Actions → Disable. Wait until the status changes to Disabled.
- Select the checkbox for the disabled distribution again.
- Choose Delete and confirm the deletion. The distribution cannot be recovered once deleted.
Final Verification
After completing the steps above, verify the following services to ensure no resources remain:
- ✅ EventBridge: No rules remaining
- ✅ API Gateway: No APIs remaining
- ✅ Lambda: No functions remaining (3 functions)
- ✅ DynamoDB: No tables remaining
- ✅ S3: No buckets remaining (2 buckets)
- ✅ Cloudfront: No more distribution
- ✅ IAM Users: No test user remaining
- ✅ IAM Roles: No created roles remaining (3 roles)
- ✅ CloudWatch Logs: No related log groups remaining
- ✅ X-Ray: Traces will expire automatically
- ✅ RDS: Successfully deleted
- ✅ NAT gateway: No longer exists
- ✅ Elastic IP: No longer exists
- ✅ EC2 : Terminated
Make sure you’ve deleted all resources to avoid unexpected charges. Pay special attention to S3 buckets as they can accumulate data over time.