A NixOS way to create terraform json files.
- Using terranix is very similar to use terraform, you can use the terraform reference material without much hassle.
- The full power of the nix language (map, filter, reduce, … )
- The full power of the module system of NixOS
- The full power of all the tooling in
pkgsof NixOS (fetchgit,fetchurl,writers, …)
- Documentation generation out of a
config.nixas json or man page.
What is Terraform?
Terraform a tool to interact with APIs via declarative files. Instead of write imperative scripts, you define the setup you like to have and terraform will make it happen.
What is config.tf.json?
config.tf is the file that contains the setup you which to realize behind one or multiple APIs. The majority of your work will be to create theses files.
What are Providers?
Providers are the thing that enables terraform to talk to APIs. There is a huge list of providers available on the Terraform website.
What is Terraform State?
Terraform is not capable of seeing the state behind APIs, because APIs never share all information. This is why terraform creates a state file on every run to provide information for the next runs.
It is not always clear what ends up in this state file, and is the reason why secrets have to be handled with care!
What is terranix?
terranix is a tool that enables you to render the
config.tf.json file. It uses the NixOS module system and gives you tools like
terranix-doc-json to generate documentation of terranix modules.
–with-nullsoption, which will not strip nulls from the result.