An organization has deployed a retail transaction processing system. The core component is a serverless function that handles purchase validation. This function runs inside private subnets of an Amazon VPC to connect to a secure backend database cluster. To finalize transactions, the function must also perform an outbound HTTPS call to an external payment processor.
During high-traffic periods, two issues are observed:
1. The function fails to connect to the external payment processor, resulting in network connection timeouts.
2. The backend database cluster runs out of available database connections, causing transaction failures.
Which combination of architectural and code modifications should the developer implement to resolve these issues? (Select TWO.)
- Deploy a NAT Gateway in a public subnet, and add a route in the private subnets' route table directing destination to the NAT Gateway.Answer
- Declare and initialize the database connection client outside of the Lambda handler method, enabling reuse across warm execution contexts.Answer
- CAssociate the Lambda function with public subnets in the VPC and enable the Assign Public IP configuration option in the function's network settings.
- DAttach an Internet Gateway directly to the private subnets where the function is deployed and configure a route for to point to the Internet Gateway.
- ECreate and destroy the database connection pool inside the Lambda handler function on each invocation to ensure connections do not remain open during idle times.