You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

CloudFormation部署DynamoDB栈报Encountered unsupported property AttributeType错误

问题原因及修复方案

错误1:YAML缩进不符合规范

原模板中checkpointsTable资源下的Type字段没有做缩进,导致CloudFormation无法正确识别资源的类型配置,属于基础YAML语法错误。

错误2:KeySchema字段配置错误

这是触发报错的核心原因:AWS::DynamoDB::Table的KeySchema配置块仅支持AttributeName和KeyType两个属性,你错误将键类型字段写为AttributeType,而AttributeType是AttributeDefinitions块的专属配置属性,不属于KeySchema的支持属性,因此触发不支持属性的报错。

修正后模板

Resources:
  checkpointsTable:
    Type: AWS::DynamoDB::Table
    Properties: 
      AttributeDefinitions:
        - AttributeName: sf_instance_table_key
          AttributeType: S
      BillingMode: PAY_PER_REQUEST
      KeySchema: 
        - AttributeName: sf_instance_table_key
          KeyType: HASH
      TableName: !Ref tableName
      Tags: 
        - Key: "Division"
          Value: !Ref division

内容的提问来源于stack exchange,提问作者Piotr Fic

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.24 05:45:09