A developer is building a serverless data processing application. A Lambda function is triggered by an Amazon S3 object upload event. The function must download the uploaded file (which can be up to in size), process the contents, and send the results to a third-party payment gateway endpoint on the public internet. The function also needs to log transaction details to an Amazon RDS PostgreSQL database instance located inside a private subnet of a custom VPC. To optimize performance and security, which of the following actions should the developer take when configuring and developing the Lambda function? (Select TWO.)
- Increase the ephemeral storage (/tmp) configuration of the Lambda function to at least to accommodate the downloaded files.Answer
- Deploy the Lambda function in the private subnets of the VPC and route outbound internet traffic through a NAT Gateway.Answer
- CStore the database credentials as hardcoded strings inside the Lambda function handler code to minimize connection establishment overhead.
- DDeploy the Lambda function in the private subnets of the VPC without a NAT Gateway to ensure secure communication with both the private database and the public payment gateway.
- ERely on the default ephemeral storage size, assuming that AWS Lambda automatically deletes files in /tmp immediately after each invocation completes to free up space.
Answer
Increase the ephemeral storage (/tmp) configuration of the Lambda function to at least to accommodate the downloaded files, and deploy the Lambda function in the private subnets of the VPC and route outbound internet traffic through a NAT Gateway.
To process the file, the developer must increase the Lambda ephemeral storage (/tmp) configuration from its default of to at least . Furthermore, because the function needs to connect to an RDS database inside a private VPC subnet and call a public payment gateway, the function must be attached to the VPC private subnets with a NAT Gateway configured in a public subnet to route outbound internet traffic.
Step-by-Step Solution
Key Concept
AWS Lambda VPC networking configuration and ephemeral storage scaling.
Estimated Time:2m 0s