Skip to content

Lambda test event yields no results

0

Hi re:Post! Thank you in advance for your time and help.

This query is in referring to a previous post, "How to automate daily delete snapshots and automate daily copy snapshots between regions", specifically testing the Lambda function ( Lambda-Function-RDS-Snapshot-Management).

So I tested it and nothing happened.

No snaps moved, no snaps deleted.

Enter image description here

Only got this output: "Executing function: succeeded "

" Executing function: succeeded (logs ) Details { "statusCode": 200, "body": ""Hello from Lambda!"" } "

and

" START RequestId: 0cc60224-130d-4525-89d8-45056891e216 Version: $LATEST END RequestId: 0cc60224-130d-4525-89d8-45056891e216 REPORT RequestId: 0cc60224-130d-4525-89d8-45056891e216 Duration: 1.67 ms Billed Duration: 2 ms Memory Size: 128 MB Max Memory Used: 36 MB Init Duration: 81.65 ms "

So what was the point of this test?

What did it test?

How do I conduct a real test?

Best Regards, Donald

asked a year ago49 views

1 Answer
0
Accepted Answer

Based on the output you shared, it appears that your Lambda function test was successful but didn't perform the RDS snapshot operations you expected. Let me explain what happened and how to conduct a more effective test.

The output you're seeing is from a default "Hello World" Lambda function template, not your actual RDS snapshot management code. The function simply returned a success message with "Hello from Lambda!" in the body, which indicates that:

  1. Your Lambda function executed without errors
  2. It's returning the default template response
  3. No actual RDS snapshot operations were performed

The logs show a very short execution time (1.67 ms), which is too brief for any meaningful RDS operations to have occurred.

To conduct a real test of your RDS snapshot management function:

  1. Ensure your Lambda function contains the actual code for managing RDS snapshots (not just the Hello World template)
  2. Verify that your function has the necessary IAM permissions (rds:DescribeDBSnapshots, rds:CopyDBSnapshot, rds:DeleteDBSnapshot, and for cross-region operations, rds:CrossRegionCommunication)
  3. Create a test event that includes any required parameters your function needs (source region, target region, retention period, etc.)
  4. After running the test, check CloudWatch Logs for detailed execution information beyond the basic START/END/REPORT entries

If your function is properly configured, you should see log entries showing the snapshots being processed, and the execution time should be longer since RDS operations take more time than simply returning a string.

For cross-region snapshot copying specifically, make sure your function has the proper permissions and that your code is correctly identifying the snapshots to copy or delete based on your criteria.
Sources
Create your first Lambda function - AWS Lambda
Cannot find permissions for: rds:DescribeDBSnapshots, rds:CopyDBSnapshot, rds:DeleteDBSnapshot when creating Role. | AWS re:Post

answered a year ago

  • How do I "Ensure your Lambda function contains the actual code for managing RDS snapshots (not just the Hello World template)" ? There was no "Hello World template" just this empty json:

    {

    }

    What goes in between the brackets?

    Thanks!

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.