An organization requires a new microservice backend to run on AWS Lambda within a custom VPC. The function must query an Amazon Aurora MySQL database residing in a private subnet. The function also needs to retrieve database credentials from AWS Secrets Manager without any traffic transiting the public internet.
Which configuration should a developer implement to meet these requirements securely?
- AAssociate the Lambda function with the private subnets. Deploy a NAT Gateway in a public subnet, and configure the route table of the private subnets to send internet-bound traffic to the NAT Gateway.
- Associate the Lambda function with the private subnets. Provision an interface VPC endpoint for Secrets Manager in the VPC, and configure the security groups to allow inbound HTTPS traffic from the Lambda function's security group to the endpoint.Cevap
- CAssociate the Lambda function with the private subnets. Store the credentials in Systems Manager Parameter Store, and set up a gateway VPC endpoint to route API calls directly to Parameter Store.
- DConfigure the Lambda function execution role trust policy to trust the Secrets Manager service principal, and assign an IAM policy allowing access to Secrets Manager.
Cevap
Associate the Lambda function with the private subnets. Provision an interface VPC endpoint for Secrets Manager in the VPC, and configure the security groups to allow inbound HTTPS traffic from the Lambda function's security group to the endpoint.
The correct solution involves associating the Lambda function with the private subnets where the database resides and provisioning an interface VPC endpoint for Secrets Manager. The security groups are then configured to allow inbound HTTPS traffic from the Lambda function to the endpoint. This satisfies all requirements: Lambda can query the Aurora database, and the credentials from Secrets Manager are retrieved securely over private IP addresses within the AWS network without transiting the public internet.
Adım Adım Çözüm
Anahtar Kavram
VPC endpoints enable private connection between a VPC and supported AWS services without requiring internet gateways, NAT devices, or VPN connections. Security groups must be configured to allow communication between resources and interface endpoints.