Skip to main content

generate terragrunt manifest from terraform module.

Project description

🚀 terragrunt-generator 🎉

codecov

🪄 What is terragrunt-generator?

terragrunt-generator is your one-stop tool to automatically generate terragrunt.hcl files with well-documented inputs from variables exposed by Terraform modules. The magic happens with a simple YAML configuration file, making your setup process as smooth as butter! 🧈✨

📋 Requirements

  • Python 3.6+

🔧 Installation

pip install terragrunt-generator

🎯 Usage

🔍 Command Overview

terragrunt-generator --help

You'll see something like this:

usage: terragrunt-generator [-h] [-V] -u URL [-v VERSION] [-p PATH]
                            [--include | --no-include] -l LOOKUP

Generate terragrunt.hcl configuration from a Terraform module.

Options:
  -h, --help            Show this help message and exit
  -V                    Show program's version number and exit
  -u URL, --url URL     The module repository URL
  -v VERSION, --version VERSION
                        The module version to use
  -p PATH, --path PATH  Define the module path if needed
  --include, --no-include
                        Include or exclude the rendering of the include block (default: True)
  -l LOOKUP, --lookup LOOKUP
                        Define the lookup path

📚 Example Usage

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

📝 Sample Output

# 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"])
})

🙌 Contribute

Got a cool idea? Found a bug? Contributions are welcome! Check out our contributing guidelines and help make terragrunt-generator even better! 🚀


Enjoy automating your Terragrunt configurations with ease! 🎉

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

terragrunt_generator-0.8.0.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

terragrunt_generator-0.8.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: terragrunt_generator-0.8.0.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for terragrunt_generator-0.8.0.tar.gz
Algorithm Hash digest
SHA256 b48568bfcd2c905359e256728c0a9bbb22b8545bc30387604e7f34e0f153405f
MD5 8117036866996cbc98e7c98b1ca8be00
BLAKE2b-256 deab37595a27807ad4907910979e1f6c898704b55ee75e0a39b0cb50f915fd37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for terragrunt_generator-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e1a68dddb7962db1534ff9f9a0e9f693981168fa12e5c3ca186b0e971daca6
MD5 d9e42fb9c543860027d36e08994efbc9
BLAKE2b-256 99ff66ba71194d8af13aeb115891849b12d7332ec78c6e02dec2c082b560eeaa

See more details on using hashes here.

Supported by

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