DVA-C02 exam dumps

DVA-C02 practice question 62 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 62

Select 2

You have created an AWS Lambda function that needs to access a private Amazon RDS database hosted in a VPC. How can you configure the Lambda function to ensure it can communicate with the database?

  1. A

    Configure the Lambda function to connect to the database using its public endpoint.

  2. B

    Attach the Lambda function to the same VPC as the private database and specify the appropriate subnet and security group.

  3. C

    Enable a NAT Gateway in the VPC and configure Lambda to use it for database communication.

  4. D

    Ensure the Lambda function's IAM role has permissions to access VPC resources and the database.

  5. E

    Configure the database's security group to allow inbound traffic from the Lambda function.

Show answer and explanation

Correct answers: B, E

Explanation

To access private resources in a VPC, you must attach your Lambda function to the same VPC by specifying subnets and security groups. Additionally, the database's security group must allow inbound traffic from the Lambda function's security group. These steps ensure proper network-level connectivity between the Lambda function and the private database.

  • A. Incorrect.

    Incorrect. If the database is in a private subnet, it does not have a public endpoint. This option is not valid for private resources.

  • B. Correct.

    Correct. Lambda functions can be attached to a VPC by specifying the appropriate subnets and security groups, allowing them to access private resources like the database.

  • C. Incorrect.

    Incorrect. A NAT Gateway is used to provide internet access to resources in a private subnet, but it is not required for communication between Lambda functions and private databases within the same VPC.

  • D. Incorrect.

    Incorrect. While the Lambda function's IAM role needs appropriate permissions for other AWS services, it does not directly control network-level access to the private database.

  • E. Correct.

    Correct. The database's security group must explicitly allow inbound traffic from the Lambda function's security group to establish communication.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam