Skip to main content

terragrunt-generator
terragrunt-generator

Generate documented terragrunt.hcl manifests from Terraform module variables.

CI Codecov License: MIT Python uv

terragrunt-generator generates terragrunt.hcl configuration files - with documented inputs - from the variables exposed by a Terraform module. Point it at a module (a git repository or a local directory), tell it where to look up values, and it emits a ready-to-edit Terragrunt manifest plus an optional YAML config skeleton.

Documentation

The project site is published from main to GitHub Pages: https://goabonga.github.io/terragrunt-generator/.

Requirements

  • Python 3.13+

Installation

pip install terragrunt-generator

Or run it without installing, using uv:

uvx terragrunt-generator --help

Usage

terragrunt-generator \
  -u https://github.com/terraform-google-modules/terraform-google-project-factory.git \
  -v v14.2.1 \
  -l 'project'

This reads the module's variable blocks and prints a terragrunt.hcl whose inputs are wired to a yamldecode-based config lookup:

# terraform-google-modules v14.2.1
# https://github.com/terraform-google-modules/terraform-google-project-factory/tree/v14.2.1/

include {
    path = find_in_parent_folders()
}

locals {
    source = "github.com/terraform-google-modules/terraform-google-project-factory.git?ref=v14.2.1"
    all = merge(
        yamldecode(file(find_in_parent_folders("config.yaml"))),
    )
}

terraform {
    source = lookup(local.all, "project", false) == false ? null : lookup(local.all.project, "enabled", false) == false ? null : local.source
}

inputs = merge({
    billing_account = lookup(local.all.project, "billing_account", "")
    name = lookup(local.all.project, "name", "")
    org_id = lookup(local.all.project, "org_id", "")
    activate_api_identities = lookup(local.all.project, "activate_api_identities", [])
    activate_apis = lookup(local.all.project, "activate_apis", ["compute.googleapis.com"])
})

See the usage guide for the full option reference and the per-environment YAML workflow.

Development

git clone https://github.com/goabonga/terragrunt-generator.git
cd terragrunt-generator
uv sync

# Quality gates (mirrored in CI).
uv run ruff check src tests
uv run ruff format --check src tests
uv run mypy src
uv run pytest --cov=terragrunt_generator

# Install the pre-commit + commit-msg hooks.
uv run pre-commit install

Versioning and release

Releases are automated. Every push to main runs multicz bump --commit --tag --push - driven by Conventional Commits - then publishes to PyPI and deploys the docs.

# Preview the next release against the current branch.
multicz status

Contributing

See CONTRIBUTING.md for the workflow, the commit-message convention, and the test/lint expectations. By participating you agree to the Code of Conduct.

Security issues: please follow the disclosure process in SECURITY.md.

License

Distributed under the MIT License.

Download files

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

Source Distribution

terragrunt_generator-1.1.3.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

terragrunt_generator-1.1.3-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file terragrunt_generator-1.1.3.tar.gz.

File metadata

  • Download URL: terragrunt_generator-1.1.3.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for terragrunt_generator-1.1.3.tar.gz
Algorithm Hash digest
SHA256 aa5a4b073291000394c02175a03b845938aee9c03b5fe14a0143e23e6be97730
MD5 8c2fd283969186790333c5a9a71aca14
BLAKE2b-256 f09224dc4aabf48b5d885ce540a33daddeae95c7a39068f9b5eb2956b38dee7b

See more details on using hashes here.

Provenance

The following attestation bundles were made for terragrunt_generator-1.1.3.tar.gz:

Publisher: ci.yml on goabonga/terragrunt-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file terragrunt_generator-1.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for terragrunt_generator-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 66f50ca61dcb89e7ba040b78bafffac6c2658dc307967e4cb4758460ba257474
MD5 65371989f3326cc9add4c145a95a9c36
BLAKE2b-256 ad02b51d746a8267d8458c6c686cc6b21b016d13dbe12962a9c02c9cf609c667

See more details on using hashes here.

Provenance

The following attestation bundles were made for terragrunt_generator-1.1.3-py3-none-any.whl:

Publisher: ci.yml on goabonga/terragrunt-generator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.0

2 files

0.17.1

2 files

0.17.0

2 files

0.16.2

2 files

0.16.1

2 files

0.16.0

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.0

2 files

0.7.6

2 files

0.7.5

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.4

2 files

0.5.3

2 files

0.4.1

2 files

0.4.0

2 files

0.3.6

2 files

0.3.2

2 files

0.2.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page