Real-time use case to detach unused EBS volumes
In this section, you will see how you can save costs by cleaning up unused Elastic Block Storage (EBS) volumes. EBS costs are always overlooked, as the life cycle of an EBS volume is independent of the instance life cycle, which means that even if you delete an EC2 instance, the EBS volume of it is still there and incurs a cost.
As discussed in the last use case, there are multiple ways to achieve the end goal, but the approach we are going to use is a combination of Lambda and CloudWatch rules. We are following this approach as it gives us a high level of flexibility; for example, you can filter the volume based on whether they are used or unused.
To create a Lambda function, please follow the same steps (1-5) as described in the Real-time use case to clean up an unused AMI section. There are a few parameters you need to change:
- Similar to step 1, in this real-time use case, please change the function name to a new name...