Q23 — AWS DOP-C02 Ch.2
Question 23 of 100 | ← Chapter 2
A company running many workloads on AWS observes increasing Amazon EBS costs over time. The DevOps team notices many unattached EBS volumes. Although some unattached volumes are associated with active workloads, volumes older than 14 days are confirmed idle and no longer needed. A DevOps engineer must create automation to delete unattached EBS volumes that have been unattached for 14 days.
- A. Use AWS Config with a configuration change trigger type and the EC2 volume resource type, and configure the managed rule `ec2-volume-inuse-check`. Create a new Amazon CloudWatch Events rule scheduled to run an AWS Lambda function every 14 days to delete specified EBS volumes.
- B. Configure a volume lifecycle policy using Amazon EC2 and Amazon Data Lifecycle Manager. Set the interval for unattached EBS volumes to 14 days and the retention rule to delete. Set the policy target volumes to *.
- C. Create an Amazon CloudWatch Events rule to run an AWS Lambda function daily. The Lambda function should locate unattached EBS volumes, tag them with the current date, and delete unattached volumes whose tag date is older than 14 days. ✓
- D. Use AWS Trusted Advisor to detect EBS volumes detached for more than 14 days. Execute an AWS Lambda function to create snapshots, then delete the EBS volumes.
Correct Answer: C. Create an Amazon CloudWatch Events rule to run an AWS Lambda function daily. The Lambda function should locate unattached EBS volumes, tag them with the current date, and delete unattached volumes whose tag date is older than 14 days.
Explanation
Reference: https://aws.amazon.com/blogs/mt/controlling-your-aws-costs-by-deleting-unused-amazon-ebs-volumes/