【问题标题】:How to validate or create CloudFormation stacks如何验证或创建 CloudFormation 堆栈
【发布时间】:2018-05-09 09:59:05
【问题描述】:

我添加了CloudFormation设置文件vpc.ymlfront.yml,导出vpc.yml中的一些值并导入。 我运行了以下命令,但它不起作用。

$ 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

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

【问题讨论】:

  • 请发布您的cft 以更好地了解您缺少什么。

标签: amazon-web-services amazon-cloudformation


【解决方案1】:

您遇到的错误是因为您在指定依赖于 VPCGatewayAttach 的资源之一中有 dependsOn 属性,但您的 cft 中不存在 VPCGatewayAttach

【讨论】:

  • 哦,没有dependsOn 属性也能正常工作!我们可以使用Fn::ImportValue 或其他方式将其他堆栈资源指定为dependsOn 吗?
  • 没有。不能这样。
猜你喜欢
  • 1970-01-01
  • 2021-10-12
  • 2016-07-28
  • 2018-10-01
  • 2019-12-13
  • 2020-11-09
  • 2021-06-29
  • 1970-01-01
  • 2020-11-09
相关资源
最近更新 更多