A developer is building a highly secure, serverless healthcare application. The application needs to write temporary data to the /tmp directory of an AWS Lambda function. Which approach should the developer use to encrypt that temporary data?
Choose an answer
Tap an option to check your answer.
Correct answer: Give the Lambda function a role and key policy that allow access to an AWS KMS key; use that key to generate a data key and encrypt data before writing it to /tmp..
Why this is the answer
The correct approach is to use AWS Key Management Service (KMS) to encrypt the temporary data. AWS Lambda's /tmp directory is ephemeral storage, meaning its contents are lost after the function invocation. To encrypt data written to /tmp, the encryption must happen before the data is written. A KMS key can be used to generate a data key, which then encrypts the data locally within the Lambda function's execution environment. The Lambda function's IAM role needs permissions to use the KMS key, and the KMS key policy must allow the role to perform cryptographic operations. Incorrect options: EBS volume encryption is not applicable here because Lambda's /tmp directory is not backed by an EBS volume. Generating a symmetric key with OpenSSL at startup is less secure and harder to manage than using a managed service like KMS. It also introduces the challenge of securely storing and rotating that key. Using an on-premises HSM introduces latency and complexity, and is generally not suitable for serverless functions that require fast, scalable, and fully managed encryption solutions.
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