Skip to main content

A Terragrunt rapid development tool to simplify overriding the source parameter in a terraform.tfvars file.

Project description

Project description

A Terragrunt rapid development tool to simplify overriding the source parameter in a terraform.tfvars file.


terragrunt-source is a simple script that parses the source line from the terraform.tfvars file in the current working directory producing a path to a local source tree that can be used by terragrunt during development. The path to the local source tree is looked up in the environment variable TERRAGRUNT_DEFAULT_MODULES_REPO.

This is best illustrated be an example. If you are in a directory that contains a terraform.tfvars file with the following content:

terragrunt = {
  include {
    path = "${find_in_parent_folders()}"

  terraform {
    source = ""

And if TERRAGRUNT_DEFAULT_MODULES_REPO is set to /usr/src/modules then then we expect the following output:

$ terragrunt-source

Then we can use terragrunt like so:

$ terragrunt plan --terragrunt-source `terragrunt-source`

Another way this can be run is as follows:

$ TERRAGRUNT_SOURCE=`terragrunt-source` terragrunt plan

Quick start

  1. Install terragrunt-source:

    $ pip install terragrunt-source
  2. Append the following to your ~/.bashrc:

    export TERRAGRUNT_DEFAULT_MODULES_REPO=/path/to/your/checked/out/code
    terragrunt-source() {
        TERRAGRUNT_SOURCE=$($(which terragrunt-source)) terragrunt $@
  3. Reload your ~/.bashrc:

    $ source ~/.bashrc
  4. Change to a Terragrunt configuration directory:

    $ terragrunt-source plan

Project details

Download files

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

Files for terragrunt-source, version 0.1.0a3
Filename, size File type Python version Upload date Hashes
Filename, size terragrunt_source-0.1.0a3-py2.py3-none-any.whl (4.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page