DEV Community

Discussion on: Caching SSM Parameter Store values in Lambda

Collapse
 
bestickley profile image
Ben Stickley • Edited

First of all, great article!
Do you need the caching logic you've described here? I would think you should simply request the parameters outside of the lambda event handler so that for the life of the lambda you have access to the parameters. Once you don't have enough requests, that lambda will be recycled and upon another request the lambda will be spun up again.

Collapse
 
bestickley profile image
Ben Stickley

I guess the only time you'd need the caching logic is if you expect the lambda to live longer than an hour which is possible.

Collapse
 
ryands17 profile image
Ryan Dsouza

Thanks a lot!

The caching logic can be kept smaller as well so even if the Lambda execution environment retained, you can refresh those secrets in cases you need them to update in a specific time period.