Metadata-Version: 2.1
Name: terragen
Version: 0.1.0
Summary: Configure, generate and apply Terraform modules to create and destroy Cloud Infrastructure
Home-page: https://github.com/hunt3ri/terragen
Author: Iain Hunter
Author-email: iain.hunter@outlook.com
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.8.0
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: attrs
Requires-Dist: hydra-core
Requires-Dist: Jinja2
Requires-Dist: toml


# 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](https://hydra.cc/docs/intro/)

## 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:

```commandline
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:
```commandline
--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:
```commandline
terragen --config-dir ./config
```
You can also create specfic config files for certain applications, eg
```commandline
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:
```commandline
terragen --config-dir ./config build.environment=test
```

## Debugging
Run Terragen with cfg and resolve flags to output interpolations
```commandline
terragen -cd ./config --cfg job --resolve
```

You can enable verbose debug logging by passing the following:
```commandline
terragen -cd ./config hydra.verbose=true
```


