Question 1,400 of 1,570
SCS-C02 Identity and Access Management Practice Question
An AWS Lambda function needs to read from a DynamoDB table. What is the best practice for granting the Lambda function the necessary permissions?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Create an IAM role with the necessary permissions and attach it as the Lambda function's execution role.
Attaching an IAM role as the Lambda function's execution role is the standard and secure method for granting permissions to AWS services. The Lambda service assumes the role to obtain temporary credentials for accessing DynamoDB. Option A is wrong because resource-based policies are used for services like S3 buckets or SQS queues, not for DynamoDB table access by Lambda. Option B is wrong because IAM users are for human identities, not for service-to-service access; using an execution role is the proper approach. Option D is wrong because embedding credentials in code is insecure and violates best practices.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use a resource-based policy on the DynamoDB table to allow the Lambda function.
Why it's wrong here
DynamoDB does not support resource-based policies for Lambda access.
- ✗
Create an IAM user with the necessary permissions and assign it to the Lambda function.
Why it's wrong here
Lambda functions cannot be assigned IAM users; they use roles.
- ✓
Create an IAM role with the necessary permissions and attach it as the Lambda function's execution role.
Why this is correct
This is the recommended approach, allowing secure and temporary credentials.
- ✗
Embed the IAM user's access key and secret key in the Lambda function code.
Why it's wrong here
Hardcoding credentials is insecure and not a best practice.
Quick reference
AWS S3 Storage Class Comparison
| Storage Class | Min Duration | Retrieval | Use Case |
|---|---|---|---|
| S3 Standard | None | Immediate | Frequently accessed data |
| S3 Standard-IA | 30 days | Immediate | Infrequent access, rapid retrieval |
| S3 One Zone-IA | 30 days | Immediate | Non-critical infrequent data |
| S3 Intelligent-Tiering | None | Immediate–hours | Unknown or changing access patterns |
| S3 Glacier Instant | 90 days | Milliseconds | Archive with instant retrieval |
| S3 Glacier Flexible | 90 days | Minutes–hours | Archive, flexible retrieval |
| S3 Glacier Deep Archive | 180 days | Hours | Long-term compliance archive |
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 20, 2026
This SCS-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SCS-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.