#terraform-aws-modules (2024-11)

terraform Terraform Modules

Discussions related to https://github.com/terraform-aws-modules

Archive: https://archive.sweetops.com/terraform-aws-modules/

2024-11-12

Pablo Costa avatar
Pablo Costa

Hi, I just wanted to suggest an update to this map code:

https://github.com/cloudposse/terraform-aws-cloudfront-cdn/blob/main/examples/wordpress/main.tf#L45

merge(local.wp_nocache_behavior, map("path_pattern", "wp-admin/*")),

Terraform gives an error:

Call to function “map” failed: the “map” function was deprecated in │ Terraform v0.12 and is no longer available; use tomap({ … }) syntax to │ write a literal map.

Instead you would have to use:

merge(local.wp_nocache_behavior, tomap({path_pattern = "wp-admin/*"})),
    merge(local.wp_nocache_behavior, map("path_pattern", "wp-admin/*")),
Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Thanks @Pablo Costa - would you mind opening an issue? Maybe someone in our community can address it

    merge(local.wp_nocache_behavior, map("path_pattern", "wp-admin/*")),
Jeremy G (Cloud Posse) avatar
Jeremy G (Cloud Posse)

Because it’s just in an example and not in the actual module code, we have to give it a low priority to fix. We have too much other code that people are using that needs maintenance.

Erik Osterman (Cloud Posse) avatar
Erik Osterman (Cloud Posse)

Ahn agree then. Yea if it’s just the example definitely not worth it

2024-11-14

    keyboard_arrow_up