0

I want to create a new provider for terraform. It is suppose to read the state files produced by Azure provider and create an Ansible inventory file out of it. I am using this guide as a base https://www.terraform.io/docs/extend/writing-custom-providers.html

These are my solutions until now:

  1. Reading the states JSON files with go.
  2. using depends_on = ["Azure.example"] in my Ansible provider and get access to variables how it is done here https://stackoverflow.com/a/45492093/4244999

How can I read the state files into a provider as variables with terraform functions?

  • Could you please describe more in detail what you have done so far? Perhaps provide some simplified code sample. – rudolf_franek Sep 03 '18 at 15:48
  • 1
    Why not use something like https://github.com/mantl/terraform.py or even https://github.com/adammck/terraform-inventory? – ydaetskcoR Sep 03 '18 at 19:45

0 Answers0