Bird
0
0

You have a Lambda function that retrieves a secret from Secrets Manager. You want to minimize latency and API calls. What is a recommended approach?

hard📝 Application Q9 of 15
AWS - Advanced Security
You have a Lambda function that retrieves a secret from Secrets Manager. You want to minimize latency and API calls. What is a recommended approach?
AStore the secret in environment variables of the Lambda function.
BCall Secrets Manager API on every function invocation without caching.
CCache the secret in the Lambda execution environment between invocations.
DEmbed the secret directly in the Lambda function code.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Lambda execution environment reuse

    Lambda may reuse the same environment for multiple invocations, allowing caching of data between calls.
  2. Step 2: Identify best practice to reduce latency and API calls

    Caching the secret in memory reduces repeated API calls and improves performance.
  3. Final Answer:

    Cache the secret in the Lambda execution environment between invocations. -> Option C
  4. Quick Check:

    Reduce latency = cache secrets in Lambda environment [OK]
Quick Trick: Cache secrets in Lambda memory to reduce API calls [OK]
Common Mistakes:
  • Calling Secrets Manager every invocation causing latency
  • Storing secrets in environment variables (less secure)
  • Hardcoding secrets in code risking exposure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes