2017-11-25 182 views
0

我添加了CloudFormation设置文件vpc.ymlfront.yml,导出一些值在vpc.yml并导入它们。 我运行了下面的命令,但它不起作用。如何验证或创建CloudFormation堆栈

$ aws cloudformation validate-template --template-body file://front.yml 
An error occurred (ValidationError) when calling the ValidateTemplate operation: Template format error: Unresolved resource dependencies [VPCGatewayAttach] in the Resources block of the template 

什么是堆栈导入其他值的有效命令是什么?

+0

请张贴您的'cft'来更好地了解您错过的东西。 – Asdfg

回答

0

您正在获取的错误是因为您在VPCGatewayAttach中指定了依赖关系的其中一个资源中有dependsOn属性,但在您的cft中不存在VPCGatewayAttach

+0

哦,没有'dependsOn'属性,它工作正常! 我们可以使用'Fn :: ImportValue'或其他指定其他堆栈资源为'dependsOn'吗? –

+0

不可以。 – Asdfg

+0

嗯,好的。谢谢! –