Generates and modifies terraform code in JSON syntax.
Project description
tfadm - Terraform administrator
Tfadm (or Terraform Administrator) is a program that generates and modifies terraform code in JSON syntax.
The goal is to help system administrators easily manage Infrastructure as Code (IaC), simplify documentation, reduce training time for new employees, and enable users with little or no knowledge of terraform code to operate the system.
In no way does tfadm attempts to replace terraform command functionalities. Tfadm just enables you to automate the creation and modification of terraform code.
Some of tfadm features are:
- Generates and modifies terraform code in bulk;
- Converts existing infrastructure into terraform code;
- Associates existing infrastructure with the terraform resources, if not already under terraform management.
- Copies changes made directly to the infrastructure into terraform code;
Install
Install and update using pip:
python3 -m pip install -U tfadm
tfadm version
Install and update using pip and virtual environments:
python3 -m venv --clear --upgrade-deps --prompt tfadm ~/.venv/tfadm
source ~/.venv/tfadm/bin/activate
pip install --upgrade pip
pip install -U tfadm
tfadm version
To leave your virtual environment, simply run:
deactivate
Usage
tfadm [OPTIONS] COMMAND [ARGS]...
Options
-V
,--version
- Show the version and exit.
-h
,--help
- Show help message and exit.
Commands
create
- Creates an object from stdin.
help
- Show help message and exit.
resources
- Lists the available resources.
sync
- Copies changes to the infrastructure into terraform code.
update
- Updates an object from stdin.
version
- Show the version and exit.
Use tfadm COMMAND --help
for more information about a given command.
Resources
Tfadm depends on a set of configuration files (resources) to operate, in YAML format.
See tfadm-resources to get started.
Dependencies
- $ click_, to create the "beautiful" command line interface;
- Jinja, to allow code expressions in resource files more safely (not yet used as a template engine);
- parse, to do the the opposite of format() in a very specific situation, which most likely could be done with regular expressions;
- python-slugify, python-slugify, to create slugs that can be used to name terraform blocks;
- PyYAML, to parse configuration files and data from stdin and dump data to stdout.
Author
tfadm was created by Nuno Cardoso.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.