用于对 DynamoDB 表进行读取、写入、更新和删除访问的 IAM policy - Amazon DynamoDB

用于对 DynamoDB 表进行读取、写入、更新和删除访问的 IAM policy

如果您需要允许应用程序创建、读取、更新和删除 Amazon DynamoDB 表、索引和流中的数据,请使用此策略。请根据情况替换 AWS 区域名称、账户 ID 以及表名称或通配符(*)。

{ "Version": "2012-10-17", "Statement": [ { "Sid": "DynamoDBIndexAndStreamAccess", "Effect": "Allow", "Action": [ "dynamodb:GetShardIterator", "dynamodb:Scan", "dynamodb:Query", "dynamodb:DescribeStream", "dynamodb:GetRecords", "dynamodb:ListStreams" ], "Resource": [ "arn:aws:dynamodb:us-west-2:123456789012:table/Books/index/*", "arn:aws:dynamodb:us-west-2:123456789012:table/Books/stream/*" ] }, { "Sid": "DynamoDBTableAccess", "Effect": "Allow", "Action": [ "dynamodb:BatchGetItem", "dynamodb:BatchWriteItem", "dynamodb:ConditionCheckItem", "dynamodb:PutItem", "dynamodb:DescribeTable", "dynamodb:DeleteItem", "dynamodb:GetItem", "dynamodb:Scan", "dynamodb:Query", "dynamodb:UpdateItem" ], "Resource": "arn:aws:dynamodb:us-west-2:123456789012:table/Books" }, { "Sid": "DynamoDBDescribeLimitsAccess", "Effect": "Allow", "Action": "dynamodb:DescribeLimits", "Resource": [ "arn:aws:dynamodb:us-west-2:123456789012:table/Books", "arn:aws:dynamodb:us-west-2:123456789012:table/Books/index/*" ] } ] }

要扩展此策略以覆盖此帐户所有 AWS 区域的所有 DynamoDB 表,请使用通配符 (*) 作为区域和表名。例如:

"Resource":[ "arn:aws:dynamodb:*:123456789012:table/*/", "arn:aws:dynamodb:*:123456789012:table/*/index/*" ]