A team is migrating an on-premises batch utility to run as an AWS Lambda function inside a custom VPC. The function must connect to a database running on an Amazon RDS instance within the private subnets of the VPC. Additionally, the function needs to fetch static configuration files from Amazon S3 and make API calls to an external payment processor over the internet. During initial testing, the Lambda function succeeds in connecting to the database but experiences connection timeouts when trying to access S3 and the external payment processor.
Which of the following actions should the developer take to resolve these connectivity issues? (Select two.)
- Configure a NAT Gateway in a public subnet of the VPC, and update the private subnet's route table to route `` traffic to the NAT Gateway.Cevap
- Create a Gateway VPC Endpoint for Amazon S3, and associate it with the route table of the private subnet where the Lambda function resides.Cevap
- CMove the Lambda function configuration to a public subnet of the VPC and enable the auto-assign public IP setting on the function.
- DUpdate the Lambda function's trust policy to grant `s3:GetObject` permission for the S3 bucket configuration path.
- EEmbed AWS access key credentials directly within the Lambda function code to bypass VPC routing for the S3 SDK client calls.
Cevap
To resolve the connectivity issues, the developer must configure a NAT Gateway in a public subnet to allow internet-bound traffic from the private subnet, and create a Gateway VPC Endpoint for Amazon S3 to enable private direct communication with S3.
To allow the Lambda function in the private subnet to connect to external services over the internet, a NAT Gateway must be deployed in a public subnet and the private subnet's route table updated to route internet-bound traffic (represented by the `` route) to the NAT Gateway. Additionally, to access Amazon S3 without routing traffic through the NAT Gateway (which incurs extra cost and processing overhead), a Gateway VPC Endpoint for Amazon S3 should be created and associated with the private subnet's route table. This enables direct, private connectivity to S3.
Adım Adım Çözüm
Anahtar Kavram
VPC Networking for AWS Lambda and Private Service Access
Tahmini Süre:2m 0s