简体   繁体   中英

is there a way to convert ARM templates and CLI scripts into a terraform template?

I know that we have the resource azurerm_template_deployment to deploy arm templates. But is there any way we can convert them into terraform? Or do we have to do it manually.

I have tried to use the azurerm_template_deployment but looking for a way to convert them into terrafrom template

There is no tool to convert ARM templates or CLI scripts into a terraform template. (tf files) As discussed here in github issues , they wouldn't plan to develop a tool to convert ARM Templates to Terraform code for a variety of reasons.

Let's say: how do they manage fields that have been removed but are still submitted via an ARM Template!

There is a tool known as aztfy that can generate terraform code from existing resources.

Alternatively, there is an terraform import command to get the destroyed or deprecated files into terraform state files. It identifies the existing resource ID and returns it to the deployment.

terraform import <azurerm_resource> <ResourceID>

Refer SO worked by me to check in brief on how to perform terraform import .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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