An IAM policy controls who can access your DynamoDB tables and what actions they can perform. It helps keep your data safe by giving only the right people permission.
You want to allow an application to read and write data in a specific DynamoDB table.
You need to restrict a user to only view items in a DynamoDB table but not change them.
You want to let a service create or delete DynamoDB tables automatically.
You want to prevent unauthorized users from accessing your DynamoDB data.
You want to give temporary access to DynamoDB for a specific task.
Always specify the exact table ARN in the Resource to limit access.
Use Allow to grant permissions and Deny to block them explicitly.
Test policies with least privilege to avoid giving too many permissions.
Summary
An IAM policy controls who can do what with your DynamoDB tables.
Use Action to specify allowed or denied DynamoDB operations.
Always limit access by specifying the table Resource ARN.
Practice
(1/5)
1. What does the Action element specify in an IAM policy for DynamoDB?
easy
A. The allowed or denied DynamoDB operations
B. The AWS region where the table is located
C. The encryption method used by the table
D. The billing mode of the DynamoDB table
Solution
Step 1: Understand the role of Action in IAM policies
The Action element defines which DynamoDB operations (like read, write) are allowed or denied.
Step 2: Differentiate from other policy elements
Other elements like Resource specify the table, but Action controls what can be done.
Final Answer:
The allowed or denied DynamoDB operations -> Option A
Quick Check:
Action = Allowed/Deny operations [OK]
Hint: Action controls what operations are allowed or denied [OK]
Common Mistakes:
Confusing Action with Resource
Thinking Action specifies table location
Mixing Action with encryption or billing settings
2. Which of the following is the correct syntax to specify a DynamoDB table resource ARN in an IAM policy?
easy
A. "Resource": "arn:aws:s3:::mybucket"
B. "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
C. "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table"
D. "Resource": "arn:aws:dynamodb:us-east-1:123456789012:database/MyTable"
Solution
Step 1: Identify correct ARN format for DynamoDB table
The ARN format for a DynamoDB table is: arn:aws:dynamodb:<region>::table/.
Step 2: Compare options to the correct format
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable" matches the correct format exactly. "Resource": "arn:aws:s3:::mybucket" is for S3, C misses table name, D uses wrong resource type.
Final Answer:
"Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable" -> Option B
Quick Check:
Resource ARN for DynamoDB table = "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable" [OK]
Hint: DynamoDB table ARN ends with 'table/YourTableName' [OK]
Common Mistakes:
Using S3 ARN format instead of DynamoDB
Omitting the table name in ARN
Using 'database' instead of 'table' in ARN
3. Given this IAM policy snippet, what DynamoDB actions are allowed?
The ARN ends with 'table' but does not specify the table name, so it does not point to any specific table.
Step 2: Understand impact of incomplete ARN
Without a full ARN including the table name, the policy does not grant access to any resource.
Final Answer:
Resource ARN is incomplete; missing table name -> Option A
Quick Check:
Resource ARN must include table name [OK]
Hint: Resource ARN must specify full table name [OK]
Common Mistakes:
Thinking Action must be an array always
Confusing Effect Allow with Deny
Assuming Condition is required for access
5. You want to create an IAM policy that allows a user to read from any DynamoDB table in your account but only write to a specific table named 'Inventory'. Which policy setup is correct?