A developer created a Lambda function that runs on a schedule to list all S3 buckets in an account and store that list in a DynamoDB table. When running the function with the AWSLambdaBasicExecutionRole managed policy, the function fails with a permissions error. Which combination of permissions will fix the error? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Permission that allows the Lambda function to list S3 buckets, Permission that allows the Lambda function to write to DynamoDB.
Why this is the answer
The Lambda function needs specific permissions to perform its intended actions. Listing S3 buckets requires the s3:ListAllMyBuckets or s3:ListBucket permission. Storing data in DynamoDB requires write permissions, such as dynamodb:PutItem, dynamodb:BatchWriteItem, or dynamodb:UpdateItem. The AWSLambdaBasicExecutionRole only provides permissions for CloudWatch Logs, not for interacting with other AWS services like S3 or DynamoDB. Therefore, these additional permissions must be explicitly added to the Lambda function's execution role. Cross-account IAM roles are not necessary here as the function operates within a single account. Permissions for S3 or DynamoDB to invoke the Lambda function are irrelevant because the function is triggered by a schedule, not by these services.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed