nerdexam
Amazon

DVA-C02 · Question #453

A developer is creating a solution to track an account's Amazon S3 buckets over time. The developer has created an AWS Lambda function that will run on a schedule. The function will list the account's

The correct answer is B. Permission for the Lambda function to list buckets in Amazon S3 C. Permission for the Lambda function to write in DynamoDB. The Lambda execution role needs explicit permissions to perform the actions the function takes: listing S3 buckets and writing items to DynamoDB.

Submitted by neha2k· Mar 5, 2026Security

Question

A developer is creating a solution to track an account's Amazon S3 buckets over time. The developer has created an AWS Lambda function that will run on a schedule. The function will list the account's S3 buckets and will store the list in an Amazon DynamoDB table. The developer receives a permissions error when the developer runs the function with the AWSLambdaBasicExecutionRole AWS managed policy. Which combination of permissions should the developer use to resolve this error? (Choose two.)

Options

  • ACross-account IAM role
  • BPermission for the Lambda function to list buckets in Amazon S3
  • CPermission for the Lambda function to write in DynamoDB
  • DPermission for Amazon S3 to invoke the Lambda function
  • EPermission for DynamoDB to invoke the Lambda function

How the community answered

(43 responses)
  • A
    5% (2)
  • B
    79% (34)
  • D
    12% (5)
  • E
    5% (2)

Why each option

The Lambda execution role needs explicit permissions to perform the actions the function takes: listing S3 buckets and writing items to DynamoDB.

ACross-account IAM role

A cross-account IAM role is unnecessary because the Lambda function and both services (S3 and DynamoDB) reside in the same AWS account.

BPermission for the Lambda function to list buckets in Amazon S3Correct

The s3:ListAllMyBuckets (or s3:ListBuckets) permission must be attached to the Lambda execution role so the function can enumerate S3 buckets; AWSLambdaBasicExecutionRole only grants CloudWatch Logs access.

CPermission for the Lambda function to write in DynamoDBCorrect

The dynamodb:PutItem (or dynamodb:BatchWriteItem) permission must also be attached so the function can persist the bucket list to the DynamoDB table.

DPermission for Amazon S3 to invoke the Lambda function

Permissions for S3 to invoke Lambda are used for S3 event triggers; the function is not being triggered by S3 here.

EPermission for DynamoDB to invoke the Lambda function

DynamoDB does not invoke Lambda functions in this scenario; the function writes to DynamoDB, so the permission must be on the Lambda role, not on DynamoDB.

Concept tested: IAM execution role permissions for Lambda accessing S3 and DynamoDB

Source: https://docs.aws.amazon.com/lambda/latest/dg/lambda-intro-execution-role.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice