Terragrunt: Using dependencies and locals with yamldecoded input

Created on 15 Jul 2020  路  2Comments  路  Source: gruntwork-io/terragrunt

Is there any way i can use dependencies and locals in my yaml var files?
Like this one:

dns_zones:
  - name: "test-com"
    dns_name: "test.com."
    visibility: "puclic"
    private_visibility_config:
      [
        'dependency.networks.outputs.network_selflink["default"]'
      ]

In this condition private_visibility_config passed as is, without replacing dependency expression.

question

All 2 comments

Does it work if you use templatefile? E.g.,

yaml file

dns_zones:
  - name: "test-com"
    dns_name: "test.com."
    visibility: "puclic"
    private_visibility_config:
      [
        '${private_visibility_config}'
      ]

terragrunt.hcl

inputs = yamldecode(templatefile("path/to/yaml", { private_visibility_config = dependency.networks.outputs.network_selflink["default"] }))

Yes it does. So simple and elegant.
Thanks alot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shaharmor picture shaharmor  路  3Comments

lsc picture lsc  路  4Comments

dzirg44 picture dzirg44  路  3Comments

brikis98 picture brikis98  路  4Comments

goseeped picture goseeped  路  3Comments