A developer is deploying an AWS Lambda function that processes transaction requests. The function is configured to run within the private subnets of a custom VPC. The Lambda function must connect to a private Amazon RDS PostgreSQL database cluster in the same VPC, call a public API endpoint of an external payment provider, and retrieve parameters from AWS Systems Manager Parameter Store. Which two network and security configurations should the developer implement to enable this connectivity? (Select two.)
- Configure the RDS database security group to allow inbound TCP traffic on port from the security group associated with the Lambda function.Cevap
- Configure a route in the private subnet route table pointing to a NAT Gateway deployed in a public subnet.Cevap
- CEnable public IP assignment on the Lambda function and configure a route in the private subnet route table pointing to the Internet Gateway.
- DModify the trust policy of the Lambda function's IAM execution role to allow the rds.amazonaws.com service principal to assume the role.
- EMigrate the configurations to AWS Secrets Manager to utilize a Gateway VPC Endpoint for database and external API routing.
Cevap
To enable connectivity, the developer must allow inbound TCP traffic on port from the Lambda function's security group in the RDS database's security group, and configure a route in the private subnet route table directing outbound internet traffic () to a NAT Gateway deployed in a public subnet.
To connect the Lambda function to the RDS database, the database security group must explicitly allow inbound traffic from the security group associated with the Lambda function. Additionally, since the Lambda function runs in a private VPC subnet, it cannot access external endpoints directly. Configuring a route pointing to a NAT Gateway in a public subnet allows the Lambda function to route traffic to the external payment API and Systems Manager Parameter Store.
Adım Adım Çözüm
Anahtar Kavram
VPC security group rules and routing configurations for Lambda functions in private subnets.