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 72 discussion

A developer creates a VPC named VPC-A that has public and private subnets. The developer also creates an Amazon RDS database inside the private subnet of VPC-A. To perform some queries, the developer creates an AWS Lambda function in the default VPC. The Lambda function has code to access the RDS database. When the Lambda function runs, an error message indicates that the function cannot connect to the RDS database.

How can the developer solve this problem?

  • A. Modify the RDS security group. Add a rule to allow traffic from all the ports from the VPC CIDR block.
  • B. Redeploy the Lambda function in the same subnet as the RDS instance. Ensure that the RDS security group allows traffic from the Lambda function.
  • C. Create a security group for the Lambda function. Add a new rule in the RDS security group to allow traffic from the new Lambda security group.
  • D. Create an IAM role. Attach a policy that allows access to the RDS database. Attach the role to the Lambda function.
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 2 years ago
Selected Answer: B
To solve this problem, the developer should redeploy the Lambda function in the same subnet as the RDS instance and ensure that the RDS security group allows traffic from the Lambda function. This will allow the Lambda function to access the RDS database within the private subnet of VPC-A. The developer should also make sure that the Lambda function is configured with the appropriate network settings and permissions to access resources within the VPC.
upvoted 15 times
...
Fyssy
Highly Voted 2 years ago
Selected Answer: B
Redeploy
upvoted 13 times
...
sumanshu
Most Recent 4 months ago
Selected Answer: B
Lambda function in the default VPC cannot communicate with the RDS in VPC-A, because they are in different VPCs with no connection (like a VPC peering or transit gateway).
upvoted 1 times
...
mallikarjun_angadi
5 months, 2 weeks ago
Selected Answer: C
B is InCorrect because Deploying the Lambda function in the same private subnet as the RDS instance is not feasible, Lambda function needs to access other resources or services outside the VPC.
upvoted 2 times
...
mallikarjun_angadi
5 months, 2 weeks ago
B is incorrect because deploying lambda in private subnet. Cannot access other resources
upvoted 1 times
...
raasankar
7 months, 3 weeks ago
Selected Answer: B
C would need a vpc peering, So B is the best option as we are redeploying to same subnet.
upvoted 1 times
...
65703c1
11 months, 1 week ago
Selected Answer: B
B is the correct answer.
upvoted 1 times
...
Vaibs099
1 year ago
they are in different VPC, hence C is not possible unless there is VPC Peering.
upvoted 1 times
...
badsati
1 year ago
Selected Answer: B
By deploying the Lambda function in the same subnet as the RDS instance (VPC-A), the Lambda function will have access to the resources within the same VPC, including the RDS database. Additionally, the RDS security group should be configured to allow inbound traffic from the Lambda function's security group. Therefore, the correct solution is Option B.
upvoted 2 times
...
DeaconStJohn
1 year, 1 month ago
Selected Answer: B
Redeploy as no access has been set up between VPCs
upvoted 1 times
...
maurice2005
1 year, 1 month ago
Selected Answer: B
A and B wont work since lambda is on default vpc which is not vpc-a D won't work since since it's network access in the first place.
upvoted 1 times
...
SerialiDr
1 year, 2 months ago
Selected Answer: B
Option B ("Redeploy the Lambda function in the same subnet as the RDS instance. Ensure that the RDS security group allows traffic from the Lambda function.") is the most accurate approach if the Lambda function and RDS are to communicate within the same VPC. It directly addresses the need for the Lambda function to access the VPC and the security group configuration.
upvoted 2 times
...
cauchy06
1 year, 3 months ago
Selected Answer: C
No need for redeploy. ChatGPT also says C.
upvoted 1 times
toan_nguyen
1 year, 2 months ago
ChatGPT don't know anything. It's only read data
upvoted 5 times
...
...
SerialiDr
1 year, 3 months ago
Selected Answer: B
B. Redeploy the Lambda function in the same subnet as the RDS instance. Ensure that the RDS security group allows traffic from the Lambda function: This is a viable solution. Placing the Lambda function in the same VPC as the RDS instance (preferably in a private subnet for security reasons) and ensuring the security groups are correctly configured to allow traffic between the Lambda function and the RDS instance will enable connectivity. C. Create a security group for the Lambda function. Add a new rule in the RDS security group to allow traffic from the new Lambda security group: This option would be correct if the Lambda function and the RDS instance were in the same VPC. However, since they are in different VPCs, simply adjusting security groups won't address the cross-VPC connectivity issue.
upvoted 6 times
...
nickolaj
1 year, 3 months ago
Selected Answer: B
Option C would be the correct choice, but it doesn't include the route configuration between subnets needed to access the RDS. I chose option B, but according to architectural best practices, it's not the ideal solution.
upvoted 2 times
...
a_win
1 year, 4 months ago
Selected Answer: C
Seems more efficient solution.
upvoted 1 times
...
KarBiswa
1 year, 4 months ago
Selected Answer: B
https://docs.aws.amazon.com/vpc/latest/userguide/default-vpc.html The default VPC is the public subnet, this is the main trick
upvoted 1 times
BaYaga
1 year, 4 months ago
Have you even read the documentation that you're providing. It says clearly: You can use a default VPC as you would use any other VPC: Add additional nondefault subnets. Modify the main route table. Add additional route tables. Associate additional security groups. Update the rules of the default security group. Add AWS Site-to-Site VPN connections. Add more IPv4 CIDR blocks. Access VPCs in a remote Region by using a Direct Connect gateway. For information about Direct Connect gateway options, see Direct Connect gateways in the AWS Direct Connect User Guide. You can use a default subnet as you would use any other subnet; add custom route tables and set network ACLs. You can also specify a specific default subnet when you launch an EC2 instance.
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