简体   繁体   English

Terraform:将CloudFormation模板写入磁盘

[英]Terraform: Write a CloudFormation Template to disk

We are using Terraform along with a vendor supplied CloudFormation template. 我们正在使用Terraform以及供应商提供的CloudFormation模板。 It is all working except for when there are changes to the template. 除了对模板进行更改外,其他所有操作均正常。 Terraform does not show you what will change as it's all contained within the template. Terraform不会向您显示更改的内容,因为它们全部包含在模板中。 I was wondering if Terraform could write out the rendered CloudFormation template to disk where we could (in theory) use AWS native CloudFormation to create a change set to attempt to see the changes. 我想知道Terraform是否可以将渲染的CloudFormation模板写到磁盘上,我们可以在理论上使用AWS本机CloudFormation创建更改集以尝试查看更改。 Any ideas if Terraform can write this out? 如果Terraform可以写出任何想法?

Terraform works by abstracting different infrastructure types into providers . Terraform通过将不同的基础结构类型抽象到提供程序中来工作 In the case of AWS, the AWS Provider interprets your Terraform config into a set of AWS API calls. 对于AWS, AWS Provider将您的Terraform配置解释为一组AWS API调用。 It does not internally create any CloudFormation templates, and has no understanding of or mapping to CloudFormation. 它没有在内部创建任何CloudFormation模板,也没有了解或映射到CloudFormation。

If you really want to use Terraform to describe changes made via CloudFormation you will likely have to create your own tool to convert CF templates into Terraform Variable files . 如果您真的想使用Terraform来描述通过CloudFormation进行的更改,则可能必须创建自己的工具才能将CF模板转换为Terraform Variable文件 As each new variable file is generated, you could run terraform plan to see what the outcome would be. 生成每个新的变量文件时,您可以运行terraform plan来查看结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM