terragrunt
terragrunt copied to clipboard
IDEA: How about introducing a plugin architecture/extending terragrunt with custom functions
I often find myself writing "boilerplate" code to perform a function. Like looking up an account ID or some static configurations. Terragrunt could go deeper and promote DRY by allowing us to define custom functions to wrap up functionality. Preventing boilerplate TG code polluting all configs
Consider this example.
grant_aws_account_ids = [
lookup(incude.root.locals.yaml_config.account_id_map, " example")
]
--- what if it could be expressed as
grant_aws_account_ids = [
get_customer_account_id("example")
]
An alternative approach could be using a TF module as a dependency and including some logic there instead.
If you have any thoughts, comment below. Or if you have ideas on how you can already achieve this.