raymondbutcher / pretf

Generate Terraform code with Python
https://pretf.readthedocs.io/
MIT License
104 stars 14 forks source link

Add tf.execute() function #6

Closed raymondbutcher closed 5 years ago

raymondbutcher commented 5 years ago

This should find terraform in the PATH, excluding symlinks to pretf, and then execute it.

This should be similar to how Jinjaform does it:

https://github.com/claranet/jinjaform/blob/83a90ef5e473e416103ccf7b3c937ee06ad61a38/jinjaform/config.py#L24-L36

https://github.com/claranet/jinjaform#setup

# Run Jinjaform instead of Terraform.
JINJAFORM_PROJECT_ROOT=terraform
PATH_add "$(mkdir -p "${JINJAFORM_PROJECT_ROOT}/.jinjaform/bin" && cd $_ && ln -fs $(which jinjaform) terraform && pwd)"
raymondbutcher commented 5 years ago

It should now be done in pretf.run.execute() after refactoring things but same idea.