A Lambda function creates temporary files under 10 MB during each invocation. The files are read and modified multiple times while the function runs and do not need to persist afterward. Where is the appropriate place to store these temporary files?
Choose an answer
Tap an option to check your answer.
Correct answer: the /tmp directory.
Why this is the answer
The /tmp directory is the correct choice because it provides ephemeral, local storage directly attached to the Lambda execution environment. It's designed for temporary files needed during a function's invocation, with a maximum size of 512 MB. Since the files are under 10 MB and don't need to persist, /tmp is efficient and cost-effective. Amazon EFS provides persistent, scalable file storage, but it's overkill and more complex for temporary, non-persistent files. Amazon EBS is block storage typically used with EC2 instances, not directly with Lambda functions. Amazon S3 is object storage for persistent data, which would introduce unnecessary latency and cost for temporary files that are frequently read and modified within a single invocation.
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