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
相关产品推荐
相关产品推荐

