A developer is troubleshooting a Node.js AWS Lambda function that processes events from an Amazon DynamoDB stream. The function is configured to run inside two private subnets of a custom VPC to write caching updates to an Amazon ElastiCache for Redis cluster in the same subnets. The function also makes HTTPS calls to an external third-party service to validate customer addresses. The developer observes two symptoms in Amazon CloudWatch Logs: first, the function fails to connect to the external address validation API, resulting in connection timeout errors; second, even when address validation succeeds, the function execution duration frequently runs close to the maximum configured timeout of seconds because the database connections in the connection pool remain active, preventing the Node.js event loop from exiting. Which two actions should the developer take to resolve these issues? (Select two.)
- Deploy a NAT Gateway in a public subnet of the VPC, and add a route in the route tables of the Lambda function's private subnets that targets the NAT Gateway for destination .Cevap
- Set the context.callbackWaitsForEmptyEventLoop property to false in the Lambda handler code.Cevap
- CEnable the public IP address setting in the Lambda function's VPC configuration and move the function ENIs to a public subnet.
- DConfigure an Internet Gateway in the VPC, and update the route tables of the Lambda function's private subnets to route directly to the Internet Gateway.
- EIncrease the Lambda function's timeout configuration to minutes and implement a background process to force close connections after seconds.