A Lambda function needs a 2 GB reference file on every invocation, too large to bundle comfortably and slow to download each time. What fits?
- Exam domain
- Data Ingestion and Transformation34% of the exam
- Difficulty
- Medium
- In this mock
- 33 questions on this domainPractise this domain
Why the exam asks this
Task Statement 1.4: Apply programming concepts.
Objective in the exam guide: Use and mount storage volumes from within Lambda functions.
Some processing needs large reference data, such as models or lookup tables. Knowing Lambda can mount persistent storage avoids awkward workarounds.
Why B is the answer
Mount an Amazon EFS file system to the Lambda function
Lambda can mount an EFS file system, giving shared, persistent file access without downloading each time.
Remember: Large shared files for Lambda: mount Amazon EFS.
How it works
Lambda functions can mount an Amazon EFS file system and read and write files on it.
The data persists across invocations and can be shared between functions.
This avoids downloading large files on every run or bundling them in the deployment package.
Clues in the question
The words that point to the answer, and what each one tells you.
- 2 GB reference file on every invocation
- Large, shared, persistent data.
In detail
- EFS access requires the function to be connected to a VPC.
- Several functions can share the same file system.
Side by side with look-alikes
| Option | Fit for a 2 GB shared file |
|---|---|
| Mount EFS | Yes |
| Download each time | Slow |
| Environment variable | Far too small |
| Pre-filled /tmp | Not possible |
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. Store it in the function's /tmp before deploymentWrong
/tmp is empty at the start of a new execution environment; files cannot be pre-placed there at deploy time.
B. Mount an Amazon EFS file system to the Lambda functionRight
Large shared files for Lambda: mount Amazon EFS.
C. Bundle the file in an environment variableWrong
Environment variables are tiny.
D. Download it from S3 on every invocationWrongMost tempting
Downloading 2 GB each time is slow and costly.
Why it tempts: S3 is the usual home for data files. But pulling 2 GB each time adds latency and cost.
In practice
- Place the function in a VPC with access to the EFS mount targets.
Use case
An illustrative scenario, not a real incident.
A geocoding function mounts an EFS volume with a 2 GB lookup table and reads it directly.
See how it works
flowchart LR F1["Lambda function A"] --> E["EFS: lookup tables"] F2["Lambda function B"] --> E
How to read this chart
- "Lambda function A" leads to "EFS: lookup tables".
- "Lambda function B" leads to "EFS: lookup tables".