DVA-C02 exam dumps

DVA-C02 practice question 77 of 399

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

DVA-C02 Question 77

Select 2

You are developing a serverless application using AWS Lambda and Amazon DynamoDB. The application requires the ability to perform Create, Read, Update, and Delete (CRUD) operations on items in a DynamoDB table. Which of the following steps are necessary to ensure the Lambda function can perform these operations?

  1. A

    Attach an IAM policy to the Lambda function's execution role that grants specific permissions to the DynamoDB table.

  2. B

    Set up a VPC endpoint for DynamoDB to allow private communication between Lambda and DynamoDB.

  3. C

    Ensure the Lambda function's execution role has the 'AmazonDynamoDBFullAccess' managed policy attached.

  4. D

    Use the AWS SDK in the Lambda function to interact with the DynamoDB table.

  5. E

    Enable DynamoDB Streams to capture data changes for the table.

Show answer and explanation

Correct answers: A, D

Explanation

To enable a Lambda function to perform CRUD operations on a DynamoDB table, the Lambda function's execution role must include an appropriate IAM policy granting the necessary permissions. Additionally, the AWS SDK must be used within the Lambda function to programmatically interact with the DynamoDB table. Other options, such as enabling DynamoDB Streams or setting up a VPC endpoint, are unrelated to the basic functionality required for CRUD operations in this scenario.

  • A. Correct.

    Correct. The Lambda function needs an IAM policy attached to its execution role that explicitly grants permissions for the necessary CRUD operations on the DynamoDB table.

  • B. Incorrect.

    Incorrect. A VPC endpoint for DynamoDB is not required unless the Lambda function is deployed inside a private VPC, which is not mentioned in the scenario.

  • C. Incorrect.

    Incorrect. While the 'AmazonDynamoDBFullAccess' policy would grant permissions, it is generally not recommended due to the principle of least privilege. Instead, a specific policy should be created for the required actions.

  • D. Correct.

    Correct. The AWS SDK is required to perform CRUD operations programmatically within the Lambda function. The SDK provides the necessary methods to interact with DynamoDB.

  • E. Incorrect.

    Incorrect. DynamoDB Streams is used to capture changes to the table, not for performing CRUD operations.

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