Moving from on-premises to the cloud doesn't solve cost optimization challenges for organizations.Creating EC2 instances and forgetting to delete associated snapshots can lead to unnecessary costs in AWS.To address this issue, a lambda function can be created to automatically delete snapshots not attached to any volume or EC2 instance.By using Boto3 module in Python, lambda functions can be executed to optimize costs by removing stale snapshots.