#terraform-aws-modules - November 2024

November 2024
Pablo Costa
Pablo Costaalmost 2 years ago(edited)
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/*"})),