Simple script for management 3rd party external terraform modules.
Additionally, tfile supports modules from the Terraform Registry, as well as local modules and from git.
Python version >=3.8
Local
usage: terrafile [-h] [-f [FILE]] [-p PATH] [-l LEVEL] [-F]
Terraform modules control
optional arguments:
-h, --help show this help message and exit
-f [FILE], --file [FILE]
Tfile full path, if not present current directory
-p PATH, --path PATH Path for storing terraform modules, if not present current directory
-l LEVEL, --level LEVEL
Terrafile level of logging
-F, --force Force re-download terraform modules from tfile
Via Docker
docker run -it \
--name pyterrafile --rm \
-v "$(pwd)"/examples:/app kennyopennix/pyterrafile
For Terraform Registry
module-name:
source: "source"
version: "version"
version
- git tag if not present by default master
For GIT
module-name:
source: git_url
version: git_tag
provider: provider_name
version
- git tag if not present by default master
provider
- could be aws,google,etc if not present by default custom
For local module
terraform-k8s-vault-module:
source: "module_path"
Example of tfile
terraform-google-lb:
source: "GoogleCloudPlatform/lb-http/google"
version: "4.5.0"
terraform-aws-vpc:
source: https://github.com/terraform-aws-modules/terraform-aws-vpc.git
version: v2.64.0
provider: aws
From git
python -m pip install git+https://github.com/pyToshka/pyTerrafile.git
Local installation
git clone [email protected]:pyToshka/pyTerrafile.git
cd pyTerrafile
pip install .
Build docker image
git clone [email protected]:pyToshka/pyTerrafile.git
cd pyTerrafile
docker build . -t pyTerrafile