exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 106 discussion

A company is updating an application to move the backend of the application from Amazon EC2 instances to a serverless model. The application uses an Amazon RDS for MySQL DB instance and runs in a single VPC on AWS. The application and the DB instance are deployed in a private subnet in the VPC.

The company needs to connect AWS Lambda functions to the DB instance.

Which solution will meet these requirements?

  • A. Create Lambda functions inside the VPC with the AWSLambdaBasicExecutionRole policy attached to the Lambda execution role. Modify the RDS security group to allow inbound access from the Lambda security group.
  • B. Create Lambda functions inside the VPC with the AWSLambdaVPCAccessExecutionRole policy attached to the Lambda execution role. Modify the RDS security group to allow inbound access from the Lambda security group.
  • C. Create Lambda functions with the AWSLambdaBasicExecutionRole policy attached to the Lambda execution role. Create an interface VPC endpoint for the Lambda functions. Configure the interface endpoint policy to allow the lambda:InvokeFunclion action for each Lambda function's Amazon Resource Name (ARN).
  • D. Create Lambda functions with the AWSLambdaVPCAccessExecutionRole policy attached to the Lambda execution role. Create an interface VPC endpoint for the Lambda functions. Configure the interface endpoint policy to allow the lambda:InvokeFunction action for each Lambda function's Amazon Resource Name (ARN).
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
MrTee
Highly Voted 1 year, 6 months ago
Selected Answer: B
The AWSLambdaVPCAccessExecutionRole policy allows the Lambda function to create elastic network interfaces (ENIs) in the VPC and use the security groups attached to those ENIs for controlling inbound and outbound traffic.
upvoted 14 times
...
Khaja2k
Most Recent 3 months, 3 weeks ago
Selected Answer: B
B: This option ensures that the Lambda functions have the necessary permissions to access resources within the VPC and that the RDS security group is configured to allow inbound access from the Lambda functions. D: Reason for eliminating this is creating an interface VPC endpoint and configuring the endpoint policy is unnecessary for this scenario as it complicates the setup without addressing the VPC access requirements directly.
upvoted 1 times
...
sumanshu
4 months ago
Selected Answer: B
Lambda functions need to run inside the VPC to access resources like the RDS instance, which is located within the private subnet. The AWSLambdaVPCAccessExecutionRole policy is required for Lambda functions to connect to resources inside a VPC. This policy allows Lambda functions to use Elastic Network Interfaces (ENIs) to connect to the VPC. The security group associated with the RDS instance must allow inbound connections from the Lambda function's security group.
upvoted 2 times
sumanshu
4 months ago
A) Eliminated - AWSLambdaBasicExecutionRole provides basic permissions to write logs to Amazon CloudWatch but does not grant the necessary permissions for Lambda to connect to resources in a VPC
upvoted 1 times
sumanshu
2 months, 2 weeks ago
D) Eliminated - lambda:InvokeFunction permissions relate to calling Lambda functions, not connecting to a database.
upvoted 1 times
...
...
...
65703c1
5 months ago
Selected Answer: B
B is the correct answer.
upvoted 1 times
...
SerialiDr
9 months, 2 weeks ago
Selected Answer: B
This is the correct solution. The AWSLambdaVPCAccessExecutionRole policy includes permissions that allow the Lambda function to access resources within a VPC, such as an RDS instance. Additionally, modifying the RDS security group to allow inbound access from the Lambda security group is necessary to enable network connectivity between the Lambda functions and the RDS instance.
upvoted 3 times
...
KarBiswa
10 months, 1 week ago
Selected Answer: B
https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
upvoted 1 times
...
Nagasoracle
1 year ago
Selected Answer: D
Answer : D
upvoted 2 times
...
love777
1 year, 1 month ago
Selected Answer: D
While Lambda functions cannot run directly in private subnets, they can be configured to access resources within a VPC by creating a VPC endpoint for Lambda. AWS Lambda supports VPC Endpoints for Lambda, which allow Lambda functions to securely access resources within a VPC without needing to traverse the public internet. You should attach the AWSLambdaVPCAccessExecutionRole policy to your Lambda execution role to enable it to create network interfaces in your VPC for accessing resources. By configuring an interface VPC endpoint for Lambda, you can enable the Lambda function to communicate with resources within the private subnet and the RDS instance.
upvoted 4 times
...
Baba_Eni
1 year, 4 months ago
Selected Answer: B
https://docs.aws.amazon.com/aws-managed-policy/latest/reference/AWSLambdaVPCAccessExecutionRole.html https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html
upvoted 3 times
...
Prem28
1 year, 4 months ago
ans- opt d Option A does not allow Lambda functions to access resources in the VPC. Option B does not create an interface VPC endpoint, which means that Lambda functions will be exposed to the public internet. Option C does not configure the interface endpoint policy to allow the lambda:InvokeFunction action, which means that Lambda functions will not be able to invoke each other.
upvoted 3 times
jipark
1 year, 2 months ago
I definitely agree. Lambda cannot be installed inside VPC, instead, AWSLambdaVPCAccessExectutionRole allow to connect via ENI.
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago