AWS CloudFormation遇到了不支持的属性类型。

4
我将尝试使用AWS Cloudformation和YAML定义创建DynamoDB表。当我从YAML文件中删除Type时,会出现错误提示,提示必须包含Type。因此,我认为我缺少某些内容,但似乎找不到它。
以下是YAML定义内容:
Resources:
    devDdbDataTable:
      Type: 'AWS::DynamoDB::Table'
      Properties:
        Tags:
          - Key: access_key
            Value: '123'
        AttributeDefinitions:
          - AttributeName: device_id
            Type: 'N'
          - AttributeName: device_ip
            Type: S
          - AttributeName: data
            Type: S
          - AttributeName: created_at
            Type: S
          - AttributeName: ttl
            Type: S
        KeySchema:
          - AttributeName: device_id
            Type: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TimeToLiveSpecification:
          AttributeName: ttl
          Enabled: true
1个回答

3
问题不在于 Resources.devDdbDataTable.Type,而是在于 Resources.devDdbDataTable.Properties.AttributeDefinitions.Type

AttributeDefinitions 应该是一个类似这样的列表:

AttributeDefinitions:
  - AttributeName: device_id
    AttributeType: 'N'

所以将 Type 更改为 AttributeType

请注意,“AttributeDefinitions”部分必须仅包含表和任何索引的“KeySchema”中引用的属性。 - cementblocks

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接