An organization's order-fulfillment system uses an AWS Lambda function to process batch payloads and write them to an Amazon Aurora PostgreSQL database located in a private subnet of a VPC. The Lambda function is configured to access the database directly by running within the same private VPC subnets. Database credentials must be retrieved from AWS Secrets Manager on each execution. During load testing, the Lambda function experiences connection timeouts when trying to retrieve secrets from Secrets Manager. Additionally, high concurrency causes the database to reject connections due to reaching its maximum connection limit. Which combination of actions should the developer take to resolve these issues? (Select two.)
- Create an Interface VPC endpoint (AWS PrivateLink) for AWS Secrets Manager in the VPC, and associate it with the route tables and subnets used by the Lambda function.Answer
- Set up an Amazon RDS Proxy for the Aurora database and configure the Lambda function to connect to the proxy endpoint instead of the database instance.Answer
- CMove the Lambda function to a public subnet within the VPC, assign a public IP address to the function, and configure a route to route Secrets Manager traffic directly through an Internet Gateway.
- DMigrate the database credentials from AWS Secrets Manager to Systems Manager Parameter Store, and configure the Lambda function to retrieve them using the default endpoint without a VPC endpoint.
- EIncrease the Lambda function's execution timeout to 15 minutes, and instantiate the database connection pool inside the Lambda handler function on every invocation.
Answer
To resolve the issues, the developer must create an Interface VPC endpoint (AWS PrivateLink) for AWS Secrets Manager in the VPC, and set up an Amazon RDS Proxy for the Aurora database to manage connection pooling.
Creating an Interface VPC Endpoint (AWS PrivateLink) for AWS Secrets Manager creates private network interfaces in the subnets, enabling the Lambda function to reach Secrets Manager without leaving the AWS network. Setting up Amazon RDS Proxy pools database connections, preventing concurrent Lambda invocations from exhausting the database instance's connection limits.
Step-by-Step Solution
Key Concept
VPC endpoints are required for private VPC subnets to access public AWS services without a NAT Gateway, and RDS Proxy manages connection pooling for highly concurrent serverless environments.