Terrajinja CLI
Is a intermediate command line interface that accepts YAML/Jinja2 template files as input in order to generate a terraform deployment
CLI command structure
Each command is represented as a command or subcommand, and there are a number of command and subcommand options available:
$ tjcli <command> {deploy,template,init} [args]
- init - creates the config directory structure
- template - list or add templates to your config
- deploy - create a deployment for your config
for additional help ad the --help parameter to the sub command e.g.:
$ tjcli template --help
Getting started
start by installing the cli using pip
$ pip install terrajinja-cli
next step is to choose a place to store your config, in general this is a git repository. you can then create the initial directory stucture in that directory
$ tjcli init
creating directory project/deployments
creating directory project/templates
creating directory project/parameters
to get some inspiration look at the available templates that have already been created for your inspiration.
$ tjcli template --list
available templates:
gitlab-runner: for creating a gitlab runner on kubernetes
you can add any of these templates to your project
$ tjcli template --add gitlab-runner
requesting to add template {args.template}...
dest: project/templates/generic_gitlab_runner_v0.0.1.yaml
adding: templates / generic_gitlab_runner_v0.0.1.yaml
dest: project/parameters/gitlab_runner.yaml
adding: parameters / gitlab_runner.yaml
Configuring a deployment
Terra jinja expects the following paths to contain YAML or Jinja2 template files:
| directory | files | description |
|---|---|---|
| parameters | YAML only | main input to be used by all deployments |
| deployments | YAML/Jinja2 | this defines the accepted parameters and what templates to execute |
| templates | YAML/Jinja2 | the templates define the terraform modules to execute |
Please refer to the documentation for the full file specifications
Deploying your deployment
Which deployment is available depends on the files you created in the deployments directory e.g.:
$ tjcli deploy -d my_deployment -a mailrelay -e test
Note that the parameters are dynamicly based on the deployment file, so the actual parameters availabe will vary on your config.
Once terrajinja created your deployment you can run cdktf to apply or destroy your deployment. e.g.:
cdktf apply
History
0.0.1 (14-03-2024)
- First code creation
Metadata
Release files for terrajinja-cli 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| terrajinja_cli-1.0.0.tar.gz | 41.7 kB | Without provenance | Details for terrajinja_cli-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| terrajinja_cli-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for terrajinja_cli-1.0.0-py3-none-any.whl |
Total release size: 53.6 kB
Release files / terrajinja_cli-1.0.0.tar.gz
| Download URL | terrajinja_cli-1.0.0.tar.gz |
|---|---|
| Size | 41.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
02cb1f863755928e26d0a4f3447e8691cfd10b5ce05d8f07b4f9182816a4ba98
|
|
BLAKE2b-256 checksum How to use checksums |
da504087c2d8fa7149ab9afc1899ec6850f80a9a55e9453bdbbf681fea5c1361
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Release files / terrajinja_cli-1.0.0-py3-none-any.whl
| Download URL | terrajinja_cli-1.0.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fee6bbd771250a428b3c88b22013af9762ebfe0f0233251af04aff09720fe420
|
|
BLAKE2b-256 checksum How to use checksums |
306bc39de689ea516b24377611e812bc4f9bc16f2fb916d55de7b038b98b6b2b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.5
|
Security for terrajinja-cli 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.