Flatten a map recursively

Hi,
I would like to create multiple azurerm_app_configuration_key resources from a yaml file.

For example give the yaml:

a:
  b:
    c: 2
aa: 2
bb:
  cc:
    - 11
    - 22

I would like to have a list of key-value pairs like:

a.b.c = 2
aa = 2
bb.cc.0 = 11
bb.cc.1 = 22

Any suggestions?

Thanks

You should preprocess your YAML file with another programming language to create a format more aligned to what you want in Terraform.

Whilst Terraform has an expression language, it’s not a full programming language - in particular it can’t express something like “recursively descend through a data structure until it is fully flattened”.