A Lambda function that runs on a schedule must authenticate to a third-party system with an API key. The API key must remain encrypted at rest. Which approach meets this requirement?
Choose an answer
Tap an option to check your answer.
Correct answer: Store the API key in the Lambda function’s environment variables and use a customer-managed AWS KMS key to encrypt the environment variable..
Why this is the answer
Storing the API key in the Lambda function's environment variables and encrypting it with a customer-managed AWS KMS key is the most secure and recommended approach. Lambda environment variables are encrypted at rest by default using an AWS-managed key, but using a customer-managed key provides additional control and auditability. This method ensures the key is encrypted at rest and only decrypted when the Lambda function executes, minimizing exposure. Prompting a user for a password on the first run is impractical for a scheduled function and doesn't encrypt the key at rest. Hard-coding the API key is a severe security vulnerability, exposing the key in source control and making rotation difficult. While HTTPS is crucial for secure communication, using Lambda@Edge or HTTPS alone does not address the requirement of encrypting the API key at rest.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed