Dear KodeKloud Team,
I hope this message finds you well. I am currently working on a project where I need to automate the deletion of stale snapshots in AWS using a Lambda function. As part of this task, I have created an EC2 instance, attached a volume to it, and successfully created a snapshot of the volume.
The Lambda function is intended to trigger an event that checks for and deletes any stale snapshots. However, I am encountering issues with the DescribeSnapshot
and DeleteSnapshot
actions due to IAM policy restrictions. Despite my efforts, I am unable to create a policy that resolves these errors.
Could you please provide guidance or resources on how to properly set up the necessary IAM policies for this Lambda function? Specifically, I need help with:
- Configuring the IAM role that allows the Lambda function to describe and delete snapshots.
- Ensuring that the function can be triggered correctly to automate the deletion process.
Any advice or direction you could provide would be greatly appreciated.
Thank you for your support and assistance.
Best regards,
Gaurav Mathur