Terraform:将CloudFormation模板写入磁盘 [英] Terraform: Write a CloudFormation Template to disk

查看:121
本文介绍了Terraform:将CloudFormation模板写入磁盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们将Terraform与供应商提供的CloudFormation模板一起使用。
一切正常,除了对模板进行更改时。 Terraform不会向您显示更改内容,因为所有内容都包含在模板中。
我想知道Terraform是否可以将渲染的CloudFormation模板写到磁盘上,我们可以在理论上使用AWS本机CloudFormation创建一个更改集以尝试查看更改。
Terraform是否可以写出任何想法?

We are using Terraform along with a vendor supplied CloudFormation template. 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. 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. Any ideas if Terraform can write this out?

推荐答案

Terraform通过将不同的基础结构类型抽象为提供者。对于AWS, AWS提供程序会将Terraform配置解释为一组AWS API调用。它不会在内部创建任何CloudFormation模板,也不了解或映射到CloudFormation。

Terraform works by abstracting different infrastructure types into providers. In the case of AWS, the AWS Provider interprets your Terraform config into a set of AWS API calls. It does not internally create any CloudFormation templates, and has no understanding of or mapping to CloudFormation.

如果您真的想使用Terraform来描述通过CloudFormation进行的更改,则可能必须创建自己的工具以将CF模板转换为 Terraform可变文件。生成每个新的变量文件时,您可以运行 terraform plan 来查看结果。

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. As each new variable file is generated, you could run terraform plan to see what the outcome would be.

这篇关于Terraform:将CloudFormation模板写入磁盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆