Terraform: Write a CloudFormation Template to disk

左心房为你撑大大i 提交于 2019-12-11 14:37:32

问题


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?


回答1:


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.

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.



来源:https://stackoverflow.com/questions/48538089/terraform-write-a-cloudformation-template-to-disk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!