AWS Parameters and Secrets Lambda Extension lifetime

1

I came to know that AWS Parameters and Secrets Lambda Extension has been launched recently to improve the application performance as it decreases the latency and the cost of retrieving parameters and secrets. Source:- https://aws.amazon.com/about-aws/whats-new/2022/10/aws-parameters-secrets-lambda-extension/

The above link also states that "This lightweight and easy-to-use extension caches parameters and secrets, and persists them throughout the lifecycle of the Lambda function".

So does it mean that this extension creates 1 instance per 1 lambda instance. For e.g. say I have a lambda that has an input as customerid. Gets me the customer phone number from the back-end API which is authenticated via credentials stored in secret manager.

if I receive 5 simultaneous requests to this lambda I would have 5 instances of lambda. Would I have 5 instances of the extensions or 1? And if no requests are received for the next 1 hour I believe all lambda instances and extension instances are de-allocated?

if yes, what is the benefit of using this extension over storing the secrets in a global variable in the lambda? (read the secret onto the variable for the first time from the secret manager)

Thanks Hari

질문됨 일 년 전279회 조회
1개 답변
0

The extension runs in your execution environment, so if you're running 5 functions in parallel then you have 5 execution environments so 5 independent instances of the extension.

Yes you could store a retreived secret in a global var rather than using the extension's caching - there's not much difference really. But there's still an advantage to using the extension for that initial retrieval if it means you reduce SDK initialisation cost.

전문가
답변함 일 년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠