DVA-C02 · Question #226
A developer is creating an AWS Lambda function that will generate and export a file. The function requires 100 MB of temporary storage for temporary files while running. These files will not be needed
The correct answer is C. Store the files in the /tmp directory and delete the files at the end of the Lambda function.. The /tmp directory is a dedicated temporary storage location provided by AWS Lambda for storing temporary files during the execution of the function. It's cost-effective and efficient because it doesn't involve additional AWS services or storage AWS Lambda automatically manages t
Question
A developer is creating an AWS Lambda function that will generate and export a file. The function requires 100 MB of temporary storage for temporary files while running. These files will not be needed after the function is complete. How can the developer MOST efficiently handle the temporary files?
Options
- AStore the files in Amazon Elastic Block Store (Amazon EBS) and delete the files at the end of the
- BCopy the files to Amazon Elastic File System (Amazon EFS) and delete the files at the end of the
- CStore the files in the /tmp directory and delete the files at the end of the Lambda function.
- DCopy the files to an Amazon S3 bucket with a lifecycle policy to delete the files.
How the community answered
(15 responses)- A7% (1)
- C93% (14)
Explanation
The /tmp directory is a dedicated temporary storage location provided by AWS Lambda for storing temporary files during the execution of the function. It's cost-effective and efficient because it doesn't involve additional AWS services or storage AWS Lambda automatically manages the /tmp directory for you, including clearing its contents after the function execution is complete. You don't need to explicitly delete the files; Lambda takes care of it.
Community Discussion
No community discussion yet for this question.