运行Dyanamo DB并创建AWS策略时出错

时间:2018-01-24 16:31:39

标签: amazon-web-services amazon-dynamodb

我为Dynamodb云形成模板定义了一个IAM策略,如下所示,我收到以下错误:

  

属性值用户必须是String of String

类型

任何想法我做错了什么?

myDynamoPolicy:
   Type: AWS::IAM::Policy
   Properties: 
     PolicyDocument:
       Version: 2012-10-17
       Statement:
         Sid: AllAPIActionsOnBooks
         Effect: Allow
         Action: dynamodb:*
         Resource: 
           Ref: myDynamoDBTable
     PolicyName: DynamoDBOwnerPolicy
     Users:
        Ref: IAMUsers

2 个答案:

答案 0 :(得分:1)

根据AWS文档,Users属性必须是数组。它应该是这样的:

myDynamoPolicy:
  Type: AWS::IAM::Policy
  Properties: 
    PolicyDocument:
      Version: 2012-10-17
      Statement:
        Sid: AllAPIActionsOnBooks
        Effect: Allow
        Action: dynamodb:*
        Resource: 
          Ref: myDynamoDBTable
    PolicyName: DynamoDBOwnerPolicy
    Users:
      -
        Ref: "IAMUsers"

可以找到CloudFormation模板参考here

答案 1 :(得分:0)

您的用户字段似乎为空。

相关问题