A developer has deployed an AWS Lambda function inside the private subnets of a custom VPC. The function processes metadata uploads, writes records to an Amazon Aurora PostgreSQL database located in the same private subnets, and notifies an external analytics endpoint (https://analytics.example.com/api/log) via HTTPS. During testing, the developer notices that the Lambda function intermittently fails due to execution timeouts when calling the external API. Additionally, under heavy concurrent load, the Aurora database runs out of available connections, causing subsequent invocations to fail. The database connection client is currently initialized inside the Lambda handler function.
Which two actions should the developer take to resolve the timeout failures and prevent database connection exhaustion? (Select TWO.)
- Update the route table associated with the Lambda function's subnets to route traffic destined for 0.0.0.0/0 to a NAT Gateway.Answer
- Initialize the database connection client outside of the Lambda handler function, allowing the connection to be reused across warm execution contexts.Answer
- CMove the Lambda function to the public subnets of the VPC to grant it direct access to the Internet Gateway.
- DIncrease the Lambda function's timeout configuration to 15 minutes to allow sufficient time for new database connections to be established.
- EConfigure the security group attached to the Lambda function to allow inbound HTTPS traffic from the external analytics service's IP addresses.