Skip to main content

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

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.0.tar.gz (4.7 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-0.6.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file terragrunt-generator-0.6.0.tar.gz.

File metadata

  • Download URL: terragrunt-generator-0.6.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.14

File hashes

Hashes for terragrunt-generator-0.6.0.tar.gz
Algorithm Hash digest
SHA256 bc786b4f8152a296f7774f1832f2f7aefcca5f150fe98cf1219b21a95a73613b
MD5 8337ea01b2daa91b54984c6680e1146f
BLAKE2b-256 cb701a739d0502c456cb4a74e432955778f1ba3f3ef2312db471c34ddfa97fdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for terragrunt_generator-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a749016f01ec9b496e579dfee7bfe7db551d82c1a856dcd4ea27637c125bd65
MD5 d8ed85b3f00216efe2faf98198a3b4cb
BLAKE2b-256 eb6477301e2802d6f0784863ba448526847aaf3b5869dc55477ddb46fb994135

See more details on using hashes here.

Release history Release notifications | RSS feed

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

This release

0.6.0 This release

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page