diff --git a/modules/cache/main.tf b/modules/cache/main.tf index 79962a0..6273db6 100644 --- a/modules/cache/main.tf +++ b/modules/cache/main.tf @@ -44,4 +44,8 @@ resource "aws_cloudfront_cache_policy" "this" { } } } + + lifecycle { + create_before_destroy = true + } } diff --git a/modules/origin-request/main.tf b/modules/origin-request/main.tf index 809df9d..ff72ee0 100644 --- a/modules/origin-request/main.tf +++ b/modules/origin-request/main.tf @@ -35,4 +35,8 @@ resource "aws_cloudfront_origin_request_policy" "this" { } } } + + lifecycle { + create_before_destroy = true + } } diff --git a/modules/response-headers/main.tf b/modules/response-headers/main.tf index 8a03eea..d2ecdd4 100644 --- a/modules/response-headers/main.tf +++ b/modules/response-headers/main.tf @@ -136,4 +136,8 @@ resource "aws_cloudfront_response_headers_policy" "this" { enabled = var.server_timing_header.enabled sampling_rate = var.server_timing_header.sampling_rate } + + lifecycle { + create_before_destroy = true + } }