A developer configures an existing Lambda function to use VPC subnets, but Lambda reports that its execution role cannot create network interfaces. Which change addresses this failure?
Show the answer
Correct answerD. Attach AWSLambdaVPCAccessExecutionRole to the function's execution role.
AWhy not this: A function resource-based policy controls invocation access rather than execution-role permissions.
BWhy not this: Security group rules filter network traffic; they do not authorize EC2 network-interface API operations.
CWhy not this: Invocation permission for the deployment identity does not grant network-interface permissions to the execution role.
DWhy this is right: This managed policy grants the execution role the network-interface permissions needed for Lambda VPC connectivity.
The AWSLambdaVPCAccessExecutionRole managed policy grants the execution role permissions Lambda needs to manage VPC network interfaces. Invocation permissions control who can call the function, not whether Lambda can establish VPC connectivity.