Answer - A and C.
Options B and D are incorrect since you have to mention the Subnet and Security IDs for the Lambda function to access the resources in the VPC.The AWS Documentation mentions the following.
You can enable AWS Lambda to access resources in a Virtual Private Cloud (VPC)
Your Lambda functions can now access Amazon RDS databases, Amazon Redshift data warehouses, Amazon ElasticCache nodes, and other endpoints that are accessible only from within a particular VPC (e.g., web service running on EC2)
You must provide additional VPC-specific configuration information such as VPC subnet IDs and security group IDs in order to enable your Lambda functions to access resources in an Amazon VPC.
For more information on configuring a lambda function to access resources in a VPC, please refer to the below link-
https://docs.aws.amazon.com/lambda/latest/dg/vpc.html https://aws.amazon.com/about-aws/whats-new/2016/02/access-resources-within-a-vpc-using-aws-lambda/
To ensure that an AWS Lambda function can access resources in a VPC, you need to configure the following:
Subnet IDs - When you create a Lambda function, you need to specify the VPC and subnet IDs that it should run in. The subnet IDs allow the Lambda function to access resources within the VPC.
Security Group IDs - You also need to specify the security group IDs that the Lambda function should use. Security groups act as a virtual firewall that controls inbound and outbound traffic to the resources within the VPC. You can configure the security groups to allow or restrict access based on IP addresses, protocols, and ports.
In summary, to ensure that AWS Lambda functions can access EC2 instances in a VPC, you need to configure the subnet IDs and security group IDs in the Lambda function.