Skip to content

Commit a733ea9

Browse files
committed
fix: Normalize ordered cache behavior handling in local variable
Updated the local variable to avoid adding a `null` value to the `concat()` function for cache behaviors, ensuring a cleaner and more robust configuration.
1 parent ae02af4 commit a733ea9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,8 @@ resource "aws_cloudfront_monitoring_subscription" "this" {
535535
################################################################################
536536

537537
locals {
538-
cache_behaviors = var.ordered_cache_behavior != null ? concat([var.default_cache_behavior], var.ordered_cache_behavior) : [var.default_cache_behavior]
538+
ordered_cache_behavior_normalized = var.ordered_cache_behavior == null ? [] : var.ordered_cache_behavior
539+
cache_behaviors = concat([var.default_cache_behavior], local.ordered_cache_behavior_normalized)
539540
}
540541

541542
data "aws_cloudfront_cache_policy" "this" {

0 commit comments

Comments
 (0)