用于对 DynamoDB 表进行读取、写入、更新和删除访问的 IAM 策略 - Amazon DynamoDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

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

如果您需要允许应用程序创建、读取、更新和删除 Amazon DynamoDB 表、索引和流中的数据,请使用此策略。替换Amazon区域名称、账户 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/*" ] } ] }

扩展此策略以覆 DynamoDB 所有Amazon此账户的区域,请对区域和表名使用通配符 (*)。例如:

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