Skip to main content

No project description provided

Project description

terragrunt-generator

terragrunt-generator provide a way to generate a terragrunt.hcl file with documented inputs who's coming from variables exposed by terraform module.

The result is easily configurable with a yaml file.

Requirements

  • python3.6+

Instalation

$ pip install terragrunt-generator

Usages

Exec

terragrunt-generator -u https://github.com/goabonga/terragrunt-generator.git -v main -p /examples/modules

Results

# modules main
#
# yaml config
# ```
# modules:
#   enabled: true
#   required:
#   optional: "optional"
#   # nullable:
# ```
#
include {
    path = "${find_in_parent_folders()}"
}

locals {
    all = merge(
        yamldecode(file("find_in_parent_folders("config.yaml")")),
    )
}

terraform {
    source = lookup(local.all["modules"], "enabled", true) == true ? "https://github.com/goabonga/terragrunt-generator.git////examples/modules?ref=main" : null
}

inputs = merge({
    # required - required value - required
    required = lookup(local.all["modules"], "required", "None")
    # optional - optional value
    optional = lookup(local.all["modules"], "optional", "optional")

},
  # nullable - nullable value
  (lookup(local.all["modules"], "nullable", null) == null ? {} : { nullable =  lookup(local.all["modules"], "nullable") })
)

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.6.1.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

terragrunt_generator-0.6.1-py3-none-any.whl (5.9 kB view hashes)

Uploaded Python 3

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