Bird
0
0

To grant a Lambda function the minimum necessary permissions to read from a DynamoDB table, which IAM feature should you use?

hard📝 Application Q8 of 15
AWS - Identity and Access Management
To grant a Lambda function the minimum necessary permissions to read from a DynamoDB table, which IAM feature should you use?
AAssign the Lambda function the AdministratorAccess policy
BCreate an IAM user with read access and embed its credentials in the Lambda code
CUse a resource-based policy on the DynamoDB table to allow Lambda access
DAttach an IAM role with a policy granting read permissions to the Lambda function
Step-by-Step Solution
Solution:
  1. Step 1: Understand Lambda permissions

    Lambda functions assume IAM roles to get permissions.
  2. Step 2: Apply least privilege principle

    Attach a role with only necessary read permissions.
  3. Final Answer:

    Attach an IAM role with a policy granting read permissions to the Lambda function -> Option D
  4. Quick Check:

    Use IAM roles for Lambda permissions [OK]
Quick Trick: Use IAM roles, not users, for Lambda permissions [OK]
Common Mistakes:
MISTAKES
  • Embedding IAM user credentials in code
  • Using overly permissive policies like AdministratorAccess
  • Relying solely on resource-based policies

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes