Skip to main content

Configure, generate and apply Terraform modules to create and destroy Cloud Infrastructure

Project description

terragen

Terragen is a framework for generating and automatically applying Terraform modules to simplify the management of sophisticated Cloud Architectures

Config is read from the local config directory. Config is controlled by the hydra framework, check the docs for examples

Key Features

  • Simplify the creation and destruction of infra across multiple accounts and regions, using one command
  • Fine grained CLI control, all config elements can be overridden on the CLI
  • View generated Terraform files before they are applied. Each run creates a timestamped output directory
  • Control common and app specific infra separately. Infra that is shared, eg VPCs, Databases can be controlled separately but still referenced by app specific infra
  • Create base config files you can "sub-class" for specific implementations, allows you to enforce config patterns across your estate
  • Boiler plate Terraform files, like config, tfvars automatically generated
  • Variable interpolation. You can lookup values from other config files.

Installing

Terragen can be installed via pip:

pip install terragen

Documentation

TODO

Quick Start

Terragen expects two directories of configuration to be created. modules containing all terraform modules you want to configure. config containing the configuration for each module you want to deploy. A sample directory structure shown below:

--config
----__init__.py
----config.yaml
--modules
----aws
--------ec2
------------main.tf

Running

Terragen looks for a default config.yaml file in config directory. You must specify location of config directory using --config-dir or -cd, for example:

terragen --config-dir ./config

You can also create specfic config files for certain applications, eg

terragen -cd ./config --config-name sandbox

Overriding values on command line

Any config value can be overridden on the command line using dot notation, eg:

terragen --config-dir ./config build.environment=test

Debugging

Run Terragen with cfg and resolve flags to output interpolations

terragen -cd ./config --cfg job --resolve

You can enable verbose debug logging by passing the following:

terragen -cd ./config hydra.verbose=true

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terragen-0.1.1.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terragen-0.1.1-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file terragen-0.1.1.tar.gz.

File metadata

  • Download URL: terragen-0.1.1.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for terragen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d8e3518670c93ba8b8b837a301bb09b5d76c0d8091c4246be15ab16844694618
MD5 85392355d42757405eee9903cceecce7
BLAKE2b-256 2ec1f17b3aa1fed3903cb10eca5afea461b34ab244e6427e2d1570a0922f79f0

See more details on using hashes here.

File details

Details for the file terragen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: terragen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for terragen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b41f706b0dc3c2dec1718680efabb2b2e4618f07098c33dde976178b0c2fc24
MD5 77bd9dff9acb175261467203b53ff808
BLAKE2b-256 d46db6c1031c165ebe93db371ddd17e795a2c838ce1a2a5705a8a504d78e36ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page