diff --git a/.gitignore b/.gitignore index a066aa2..52adb69 100755 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Local .terraform directories **/.terraform/* +*.terraform* # .tfstate files *.tfstate diff --git a/cloudfront.tf b/cloudfront.tf index 7e4948e..3bb0802 100755 --- a/cloudfront.tf +++ b/cloudfront.tf @@ -70,21 +70,8 @@ resource "aws_cloudfront_distribution" "website_distribution" { allowed_methods = ["GET", "HEAD"] cached_methods = ["GET", "HEAD"] target_origin_id = "HA-website" - min_ttl = 0 - default_ttl = 0 - max_ttl = 0 + cache_policy_id = data.aws_cloudfront_cache_policy.cache_policy.id smooth_streaming = false - forwarded_values { - headers = [] - query_string = false - query_string_cache_keys = [] - - cookies { - forward = "none" - whitelisted_names = [] - } - } - } restrictions { geo_restriction { @@ -98,4 +85,10 @@ resource "aws_cloudfront_distribution" "website_distribution" { cloudfront_default_certificate = false minimum_protocol_version = "TLSv1.2_2021" } -} \ No newline at end of file +} + + +data "aws_cloudfront_cache_policy" "cache_policy" { + name = "Managed-CachingOptimized" +} +