我为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
答案 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)
您的用户字段似乎为空。