diff --git a/cloudfront.tf b/cloudfront.tf index 905ed6f..bae6b74 100644 --- a/cloudfront.tf +++ b/cloudfront.tf @@ -49,7 +49,7 @@ resource "aws_cloudfront_distribution" "cloudfront" { } resource "aws_cloudfront_cache_policy" "cloudfront_cache_policy" { - name = join("", [var.source_website, "-CachingOptimized"]) + name = join("", [replace(var.source_website, ".", "-"), "-CachingOptimized"]) min_ttl = 1 comment = "Default policy when CF compression is enabled" parameters_in_cache_key_and_forwarded_to_origin {