AWS CloudFormation验证模板时一直出现错误(模板格式错误)。

13

我从昨天开始就卡在这里了,我运行了以下命令:

aws cloudformation validate-template --template-body test.json

(test.json是我的模板) 但它一直给我下面的错误:

A client error (ValidationError) occurred when calling the ValidateTemplate operation: Template format error: JSON not well-formed. (line 1, column 5).

我甚至尝试使用不同的aws模板示例进行测试,但仍然会出现相同的错误(与不同的列编号)。

有解决方案吗?

1个回答

48
您发布的模板是有效的,但命令中存在语法错误,并且它没有传达问题所在。请尝试以下内容: aws cloudformation validate-template --template-body file://template.json

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