A developer has deployed an AWS Lambda function inside a private subnet of a custom VPC to process user registration events. The function needs to retrieve database credentials from AWS Secrets Manager to perform database updates. However, the VPC does not have a NAT Gateway or internet access, and the Lambda function executions are timing out with connection errors to the Secrets Manager service endpoint. Which two actions should the developer take to resolve this issue? (Select TWO.)
- Create an interface VPC endpoint (AWS PrivateLink) for AWS Secrets Manager in the VPC.Cevap
- Configure the security group of the VPC endpoint to allow inbound HTTPS traffic on port 443 from the security group of the Lambda function.Cevap
- CAttach an Internet Gateway to the VPC and configure the private subnet's route table to route all outbound traffic through the Internet Gateway.
- DModify the Lambda function configuration to assign a public IP address and place the function in a public subnet.
- EIncrease the Lambda function's timeout configuration to 15 minutes and double the memory allocation to handle connection retries.
Cevap
Create an interface VPC endpoint (AWS PrivateLink) for AWS Secrets Manager in the VPC, and configure the security group of the VPC endpoint to allow inbound HTTPS traffic from the security group of the Lambda function.
The correct options are creating an interface VPC endpoint for AWS Secrets Manager and configuring the endpoint's security group to allow inbound HTTPS traffic from the Lambda function. Since the Lambda function is running in a private subnet with no NAT Gateway or internet access, it cannot resolve or connect to the public Secrets Manager API endpoints. Creating an interface VPC endpoint (AWS PrivateLink) creates local ENIs in the subnets, enabling private routing to the service. For the connection to succeed, the security group attached to the VPC endpoint must permit inbound TCP traffic on port 443 from the security group of the Lambda function.
Adım Adım Çözüm
Anahtar Kavram
Configuring private access to AWS services from a VPC using interface VPC endpoints and proper security group configurations.
Tahmini Süre:2m 0s