A software developer is writing a data reconciliation script that runs on AWS Lambda. The script must retrieve credentials from AWS Secrets Manager and query a PostgreSQL database hosted on an Amazon RDS instance that resides in the private subnets of a custom VPC. The Lambda function must run inside the custom VPC to connect to the database. Security policies require that all network traffic between the Lambda function, the database, and AWS Secrets Manager remains entirely within the VPC.
Which of the following actions should the developer take to establish secure and functional network connectivity for the Lambda function? (Select TWO.)
- Configure the Lambda function to connect to the private subnets of the VPC, and create an Interface VPC Endpoint for AWS Secrets Manager with Private DNS enabled.Cevap
- Configure the security group of the Amazon RDS instance to allow inbound database traffic from the security group assigned to the Lambda function.Cevap
- CConfigure the Lambda function to connect directly to the public subnets of the VPC to enable direct access to both the RDS database and the public Secrets Manager endpoint.
- DModify the IAM trust relationship of the Lambda execution role to trust the Amazon RDS service principal (rds.amazonaws.com).
- EStore the database credentials in Systems Manager Parameter Store, and enable native automatic rotation using the Parameter Store console.
Cevap
The correct actions are: configuring the Lambda function to connect to the private subnets of the VPC while creating an Interface VPC Endpoint for AWS Secrets Manager, and configuring the security group of the Amazon RDS instance to allow inbound traffic from the Lambda function's security group.
To connect the Lambda function to the database securely, the function must reside in the same VPC private subnets. An Interface VPC Endpoint (PrivateLink) for AWS Secrets Manager is required to allow the function to call Secrets Manager APIs over private IP addresses. Additionally, the RDS security group must explicitly allow inbound traffic from the security group associated with the Lambda function.
Adım Adım Çözüm
Anahtar Kavram
VPC Security for Developers
Tahmini Süre:2m 30s