0
0
DynamoDBquery~10 mins

IAM policy for DynamoDB - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - IAM policy for DynamoDB
Define Policy Name
Specify Effect: Allow/Deny
List Actions (e.g., dynamodb:PutItem)
Set Resources (Table ARNs)
Add Conditions (optional)
Attach Policy to User/Role/Group
User/Role can access DynamoDB as per policy
This flow shows how to create an IAM policy for DynamoDB step-by-step, from naming to attaching it for access control.
Execution Sample
DynamoDB
{
  "Version": "2012-10-17",
  "Statement": [{
    "Effect": "Allow",
    "Action": ["dynamodb:PutItem", "dynamodb:GetItem"],
    "Resource": "arn:aws:dynamodb:us-east-1:123456789012:table/MyTable"
  }]
}
This policy allows PutItem and GetItem actions on a specific DynamoDB table.
Execution Table
StepFieldValueEffect on Access
1Version2012-10-17Defines policy language version
2StatementArray of permissionsGroups permissions together
3EffectAllowGrants permission for listed actions
4Action[dynamodb:PutItem, dynamodb:GetItem]Specifies allowed DynamoDB operations
5Resourcearn:aws:dynamodb:us-east-1:123456789012:table/MyTableLimits actions to this table only
6Attach PolicyUser/Role/GroupEnables access as per policy
7Access ResultUser can PutItem and GetItem on MyTableAccess granted as per policy
💡 Policy fully defined and attached, user access controlled accordingly
Variable Tracker
FieldInitialAfter Step 3After Step 5Final
EffectNoneAllowAllowAllow
ActionNoneNone[PutItem, GetItem][PutItem, GetItem]
ResourceNoneNonearn:aws:dynamodb:us-east-1:123456789012:table/MyTablearn:aws:dynamodb:us-east-1:123456789012:table/MyTable
Key Moments - 3 Insights
Why do we specify the Resource ARN in the policy?
Specifying the Resource ARN limits the policy's effect to that specific DynamoDB table, preventing access to other tables. See execution_table step 5.
What happens if Effect is set to Deny instead of Allow?
Setting Effect to Deny explicitly blocks the actions listed, overriding any Allow permissions. This is shown in execution_table step 3 where Effect controls permission.
Can we list multiple actions in the Action field?
Yes, the Action field accepts an array of actions, allowing multiple DynamoDB operations in one policy, as shown in execution_table step 4.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, what is the Effect value at step 3?
ADeny
BAllow
CNone
DConditional
💡 Hint
Check the 'Effect' field value in execution_table row with Step 3
At which step is the Resource ARN specified in the policy?
AStep 5
BStep 4
CStep 2
DStep 6
💡 Hint
Look for the 'Resource' field in execution_table rows
If we add 'dynamodb:DeleteItem' to the Action list, what changes in variable_tracker?
AResource ARN changes
BEffect changes to Deny
CAction field will include DeleteItem
DNo change
💡 Hint
Check how the Action field values are tracked in variable_tracker
Concept Snapshot
IAM Policy for DynamoDB:
- Define 'Version' and 'Statement'
- 'Effect' is Allow or Deny
- 'Action' lists DynamoDB operations
- 'Resource' limits to specific tables
- Attach policy to user/role for access control
Full Transcript
This visual execution shows how to create an IAM policy for DynamoDB. First, you define the policy version and group permissions in a statement. Then, set the Effect to Allow to grant access. Specify the DynamoDB actions like PutItem and GetItem. Limit the policy to a specific table using the Resource ARN. Finally, attach the policy to a user or role to enable access. The execution table tracks each step and the variable tracker shows how fields like Effect, Action, and Resource change. Key moments clarify why Resource limits access, the role of Effect, and multiple actions. The quiz tests understanding of these steps and changes.