1

is there any code generator for Azure Terraform?

Actually i am trying to add Azure app service to existing resource group. For this we need a state configuration file, which can be generated only ( Terraform import ) if we have full Terraform code already written for that resource group.

I saw, Using Terraform to import existing resources on Azure and Update existing app service with Terraform ,but here i am talking about the thousands of resource groups.

Thanks

Gill

gsgill76
  • 339
  • 1
  • 4
  • 14

2 Answers2

0

You would, to my knowledge, need to use terraform import against all of the existing resources that you have / want to consumse via terraform.

In saying that if you only want to manage the Azure App Service with Terraform and not everything else you can just simply pass all the requirements for the resource in and only manage this in the terraform state file.

Lachie White
  • 1,246
  • 2
  • 14
  • 21
0

Hi Lachie thanks for reply, I Found the solution using AZ2TF tool.

Thanks to Mr Agarciamiravet, who explained all the steps to use AZ2TF tool ( by using Docker) at

https://recetasdevops.com/migra-tu-infraestructura-actual-de-azure-a-terraform-con-py-az2tf/

this worked very well for me.

Thanks Gill

gsgill76
  • 339
  • 1
  • 4
  • 14
  • Glad to hear that worked for you @gsgill76, Just make sure you modularise that infrastrcuture after you have imported the state, otherwise you will be in pain later. I am happy to edit my answer to include the AZ2TF Tool if you are unable to mark your own as the answer? – Lachie White Jan 15 '20 at 01:06
  • Hi @gsgill76, I'd really love to know how you got the AZ2TF tool working, as I'm sadly not getting any such joy from it. Are you able to share any such information please? – hitman126 Sep 27 '21 at 10:34