terragrunt-generator


Nameterragrunt-generator JSON
Version 0.8.0 PyPI version JSON
download
home_pageNone
Summarygenerate terragrunt manifest from terraform module.
upload_time2024-09-15 13:33:56
maintainerNone
docs_urlNone
authorChris
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# 🚀 terragrunt-generator 🎉

[![codecov](https://codecov.io/gh/goabonga/terragrunt-generator/branch/main/graph/badge.svg?token=LZYOP61FF7)](https://codecov.io/gh/goabonga/terragrunt-generator)

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

```bash
pip install terragrunt-generator
```

## 🎯 Usage

### 🔍 Command Overview

```bash
terragrunt-generator --help
```

You'll see something like this:

```plaintext
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

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

### 📝 Sample Output

```hcl
# 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](CONTRIBUTING.md) and help make `terragrunt-generator` even better! 🚀

---

Enjoy automating your Terragrunt configurations with ease! 🎉

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "terragrunt-generator",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Chris",
    "author_email": "goabonga@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/de/ab/37595a27807ad4907910979e1f6c898704b55ee75e0a39b0cb50f915fd37/terragrunt_generator-0.8.0.tar.gz",
    "platform": null,
    "description": "\n# \ud83d\ude80 terragrunt-generator \ud83c\udf89\n\n[![codecov](https://codecov.io/gh/goabonga/terragrunt-generator/branch/main/graph/badge.svg?token=LZYOP61FF7)](https://codecov.io/gh/goabonga/terragrunt-generator)\n\n## \ud83e\ude84 What is terragrunt-generator?\n\n**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! \ud83e\uddc8\u2728\n\n## \ud83d\udccb Requirements\n\n- Python 3.6+\n\n## \ud83d\udd27 Installation\n\n```bash\npip install terragrunt-generator\n```\n\n## \ud83c\udfaf Usage\n\n### \ud83d\udd0d Command Overview\n\n```bash\nterragrunt-generator --help\n```\n\nYou'll see something like this:\n\n```plaintext\nusage: terragrunt-generator [-h] [-V] -u URL [-v VERSION] [-p PATH]\n                            [--include | --no-include] -l LOOKUP\n\nGenerate terragrunt.hcl configuration from a Terraform module.\n\nOptions:\n  -h, --help            Show this help message and exit\n  -V                    Show program's version number and exit\n  -u URL, --url URL     The module repository URL\n  -v VERSION, --version VERSION\n                        The module version to use\n  -p PATH, --path PATH  Define the module path if needed\n  --include, --no-include\n                        Include or exclude the rendering of the include block (default: True)\n  -l LOOKUP, --lookup LOOKUP\n                        Define the lookup path\n```\n\n### \ud83d\udcda Example Usage\n\n```bash\nterragrunt-generator \\\n-u https://github.com/terraform-google-modules/terraform-google-project-factory.git \\\n-v v14.2.1 \\\n-l 'project'\n```\n\n### \ud83d\udcdd Sample Output\n\n```hcl\n# terraform-google-modules v14.2.1\n# https://github.com/terraform-google-modules/terraform-google-project-factory/tree/v14.2.1/\n\ninclude {\n    path = find_in_parent_folders()\n}\n\nlocals {\n    source = \"github.com/terraform-google-modules/terraform-google-project-factory.git?ref=v14.2.1\"\n    all = merge(\n        yamldecode(file(find_in_parent_folders(\"config.yaml\"))),\n    )\n}\n\nterraform {\n    source = lookup(local.all, \"project\", false) == false ? null : lookup(local.all.project, \"enabled\", false) == false ? null : local.source\n}\n\ninputs = merge({\n    billing_account = lookup(local.all.project, \"billing_account\", \"\")\n    name = lookup(local.all.project, \"name\", \"\")\n    org_id = lookup(local.all.project, \"org_id\", \"\")\n    activate_api_identities = lookup(local.all.project, \"activate_api_identities\", [])\n    activate_apis = lookup(local.all.project, \"activate_apis\", [\"compute.googleapis.com\"])\n})\n```\n\n## \ud83d\ude4c Contribute\n\nGot a cool idea? Found a bug? Contributions are welcome! Check out our [contributing guidelines](CONTRIBUTING.md) and help make `terragrunt-generator` even better! \ud83d\ude80\n\n---\n\nEnjoy automating your Terragrunt configurations with ease! \ud83c\udf89\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "generate terragrunt manifest from terraform module.",
    "version": "0.8.0",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "99ff66ba71194d8af13aeb115891849b12d7332ec78c6e02dec2c082b560eeaa",
                "md5": "d9e42fb9c543860027d36e08994efbc9",
                "sha256": "f9e1a68dddb7962db1534ff9f9a0e9f693981168fa12e5c3ca186b0e971daca6"
            },
            "downloads": -1,
            "filename": "terragrunt_generator-0.8.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d9e42fb9c543860027d36e08994efbc9",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 24672,
            "upload_time": "2024-09-15T13:33:55",
            "upload_time_iso_8601": "2024-09-15T13:33:55.876003Z",
            "url": "https://files.pythonhosted.org/packages/99/ff/66ba71194d8af13aeb115891849b12d7332ec78c6e02dec2c082b560eeaa/terragrunt_generator-0.8.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "deab37595a27807ad4907910979e1f6c898704b55ee75e0a39b0cb50f915fd37",
                "md5": "8117036866996cbc98e7c98b1ca8be00",
                "sha256": "b48568bfcd2c905359e256728c0a9bbb22b8545bc30387604e7f34e0f153405f"
            },
            "downloads": -1,
            "filename": "terragrunt_generator-0.8.0.tar.gz",
            "has_sig": false,
            "md5_digest": "8117036866996cbc98e7c98b1ca8be00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 22697,
            "upload_time": "2024-09-15T13:33:56",
            "upload_time_iso_8601": "2024-09-15T13:33:56.838054Z",
            "url": "https://files.pythonhosted.org/packages/de/ab/37595a27807ad4907910979e1f6c898704b55ee75e0a39b0cb50f915fd37/terragrunt_generator-0.8.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-15 13:33:56",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "terragrunt-generator"
}
        
Elapsed time: 1.03506s