#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/*")),
Gabriela Campana (Cloud Posse) avatar
Gabriela Campana (Cloud Posse)

@Erik Osterman (Cloud Posse) @Jeremy G (Cloud Posse)

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