DVA-C02 exam dumps

DVA-C02 practice question 61 of 399

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

DVA-C02 Question 61

Select 2

You are developing an AWS Lambda function that needs to access a private Amazon RDS database within a VPC in your account. How can you ensure the Lambda function can successfully connect to the database?

  1. A

    Assign the Lambda function to the same VPC and subnet as the RDS database.

  2. B

    Configure the Lambda function with appropriate security group rules that allow inbound traffic from the RDS database's security group.

  3. C

    Attach an Elastic Network Interface (ENI) to the Lambda function to enable network connectivity.

  4. D

    Ensure the RDS database's security group allows inbound traffic from the Lambda function's security group on the required port.

  5. E

    Add a VPC endpoint to the Lambda function for the RDS database.

Show answer and explanation

Correct answers: A, D

Explanation

To access private resources in a VPC, such as an RDS database, a Lambda function must be assigned to the same VPC and subnet. Additionally, the RDS database's security group must allow inbound traffic from the Lambda function's security group on the necessary port for database communication. These configurations ensure proper network connectivity and security.

  • A. Correct.

    Correct: Lambda functions that need to access resources in a private VPC must be explicitly assigned to the same VPC and subnet to establish network connectivity.

  • B. Incorrect.

    Incorrect: Lambda functions do not require inbound traffic rules. Instead, the RDS database's security group must allow inbound traffic from the Lambda's security group.

  • C. Incorrect.

    Incorrect: ENIs are automatically managed by AWS when you configure a Lambda function to use a VPC. You do not manually attach ENIs to Lambda functions.

  • D. Correct.

    Correct: The RDS database's security group must allow inbound traffic from the security group of the Lambda function on the required port (e.g., 3306 for MySQL).

  • E. Incorrect.

    Incorrect: VPC endpoints are used for private connectivity to AWS services (e.g., S3, DynamoDB) and are not applicable for direct communication between Lambda and RDS.

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