Assistance Needed with AWS Lambda Function to Delete Stale Snapshots

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:

  1. Configuring the IAM role that allows the Lambda function to describe and delete snapshots.
  2. 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

Dear KodeKloud Team / @rob_kodekloud

I hope you’re doing well.

I wanted to follow up on my previous message regarding the issues I’m facing with IAM policy configuration for an AWS Lambda function. I am still encountering difficulties with the DescribeSnapshot and DeleteSnapshot actions due to IAM policy restrictions and would greatly appreciate any guidance or resources you could provide.

If there’s any additional information you need from me to assist with this, please let me know. Your support on this matter would be highly valued.

Thank you for your attention to this request, and I look forward to your response.