Option A is not correct. If the function reaches the maximum configured memory, in this case
128 MB, the function gets terminated with an error message as below, not as request timed out.
REPORT RequestId: xxxxxxxx Duration: xxxxx ms Billed Duration: xxxxx ms
Memory Size: 128 MB Max Memory Used: 129 MB RequestId: xxxxxxx Process exited before completing request
Option B is correct. AWS Lambda functions can run within a private VPC with the resources allocated inside the subnet provided during configuration.
For the lambda function to access S3 service endpoint from within private VPC, there should be a NAT Gateway or S3 VPC Endpoint configured in the route table associated with the subnet which was chosen during Lambda function setup. If not, the request would get timed out.
Option C is not correct. Bucket need not be configured as environment variable.
Lambda function environment variables are used to configure additional parameters that can be passed to lambda function.
Option D is not correct. As long as Lambda function has internet access, it can access S3 service endpoints irrespective of S3 bucket region.