云格式生成器数据库部署中不支持的属性'AttributeType' [英] Unsupported property 'AttributeType' in CloudFormation dynamo db deployment

查看:6
本文介绍了云格式生成器数据库部署中不支持的属性'AttributeType'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用云形成模板部署Dynamo数据库,但不断收到以下错误:属性AttributeType不存在。

YAML定义如下:

 MyDynoDB:
    Type: AWS::DynamoDB::Table
    Properties: 
      TableName: 'MyDynamoDb'
      AttributeDefinitions: 
        - AttributeName: 'Id'
          AttributeType: 'S'
        - AttributeName: 'Name'
          AttributeType: 'S'
      KeySchema: 
        - AttributeName: 'Id'
          KeyType: HASH
        - AttributeName: 'Name'
          KeyType: 'S'
      ProvisionedThroughput: 
        ReadCapacityUnits: 5
        WriteCapacityUnits: 5
      StreamSpecification:
        StreamViewType: NEW_AND_OLD_IMAGES

堆栈将部署,但进入回滚模式,并出现以下错误。

CREATE_FAILED   AWS::DynamoDB::Table    MyDynoDB    Encountered unsupported property AttributeType

为什么我看到生成此错误?

更新

根据注释,我已经更新了属性和键架构定义,现在显示为:

AttributeDefinitions: 
        - 
          AttributeName: Id
          AttributeType: S
        - 
          AttributeName: Name
          AttributeType: S
      KeySchema: 
        - 
          AttributeName: Id
          KeyType: HASH
        - 
          AttributeName: Name
          KeyType: RANGE

遗憾的是,仍然看到相同的错误

推荐答案

找到问题。在对模板进行更改时,例如将AttributeType从S更改为Hash或其他属性编辑,编译后的YAML文件不会被更新。这就好像CLI没有检测到更改,因此在打包时不会使用新更改更新/覆盖文件。 为了纠正这一点,我删除了包保存到的Build文件夹并重新部署,部署成功。

这篇关于云格式生成器数据库部署中不支持的属性'AttributeType'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆