【问题标题】:AWS Cloudformation Encountered unsupported property TypeAWS Cloudformation 遇到不支持的属性类型
【发布时间】:2018-08-11 21:14:52
【问题描述】:

我正在尝试使用 AWS Cloudformation 和 YAML 定义创建 DynamoDB 表。当我从 YAML 文件中删除类型时,我收到类型必须存在的错误。所以我想我错过了一些似乎无法找到的东西。

以下是 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

【问题讨论】:

    标签: amazon-web-services amazon-dynamodb amazon-cloudformation


    【解决方案1】:

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

    AttributeDefinitions 应该是这样的列表:

    AttributeDefinitions:
      - AttributeName: device_id
        AttributeType: 'N'
    

    所以将Type 更改为AttributeType。

    【讨论】:

    • 另请注意AttributeDefinitions 部分只能包含在表的KeySchemas 和任何索引中引用的属性。
    猜你喜欢
    • 2018-10-13
    • 1970-01-01
    • 2019-10-16
    • 1970-01-01
    • 2020-06-28
    • 1970-01-01
    • 2021-05-31
    • 1970-01-01
    • 2019-11-02
    相关资源
    最近更新 更多