AWS Certified Developer – Associate (DVA-C02) — Question 51

A developer is designing an AWS Lambda function that creates temporary files that are less than 10 MB during invocation. The temporary files will be accessed and modified multiple times during invocation. The developer has no need to save or retrieve these files in the future.
Where should the temporary files be stored?

Answer options

Correct answer: A

Explanation

The correct answer is the /tmp directory because AWS Lambda provides a temporary file storage area in this directory, which can be utilized during function execution without persistent storage needs. The other options, such as Amazon EFS, Amazon EBS, and Amazon S3, are not suitable since they are designed for persistent storage, which is unnecessary for temporary files that do not need to be retained after invocation.