A developer is troubleshooting an AWS Lambda function that processes transaction files stored in an Amazon S3 bucket and updates a database running on an Amazon RDS MySQL DB instance. The RDS instance is deployed in private subnets of a custom VPC.
To enable the Lambda function to access both Amazon S3 and the RDS instance, the developer configured the function to run within the VPC and associated it with the public subnets of the VPC. The Lambda function's security group is correctly allowed in the RDS security group's inbound rules.
During execution, the function fails with a timeout error. The logs show that the connection to the RDS DB instance is successful, but the function times out after seconds while attempting to connect to the Amazon S3 service endpoint.
Which two actions should the developer take to resolve this issue and follow AWS security best practices? (Select TWO.)
- Associate the Lambda function with the private subnets of the VPC instead of the public subnets.Cevap
- Create a Gateway VPC Endpoint for Amazon S3 and associate it with the route tables of the subnets where the Lambda function is deployed.Cevap
- CEnable the 'Assign Public IP' configuration option on the Lambda function's network interface settings.
- DAttach an Elastic IP address directly to the Elastic Network Interfaces (ENIs) created by the Lambda function in the public subnets.
- EIncrease the Lambda function's timeout configuration to a value greater than seconds to allow DNS resolution to complete.