2017-11-25 183 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

嗯,好的。謝謝! –