Compare commits

..

No commits in common. "36516166d29e20a4e85b2e249d9ca9c7dd19a3bf" and "828e16e3f6ea161e92afabaacb7ed90c3e3d6334" have entirely different histories.

View file

@ -1,41 +1,3 @@
resource "aws_cloudfront_cache_policy" "api" {
name = "api-no-cache"
default_ttl = 0
max_ttl = 0
min_ttl = 0
parameters_in_cache_key_and_forwarded_to_origin {
cookies_config {
cookie_behavior = "none"
}
headers_config {
header_behavior = "none"
}
query_strings_config {
query_string_behavior = "none"
}
}
}
resource "aws_cloudfront_origin_request_policy" "api" {
name = "api-forward-all"
headers_config {
header_behavior = "allViewer"
}
query_strings_config {
query_string_behavior = "all"
}
cookies_config {
cookie_behavior = "all"
}
}
############################################
# CloudFront Distribution
############################################
@ -119,11 +81,21 @@ resource "aws_cloudfront_distribution" "this" {
viewer_protocol_policy = "redirect-to-https"
allowed_methods = ["GET","HEAD","OPTIONS","PUT","POST","PATCH","DELETE"]
cached_methods = ["GET","HEAD"]
allowed_methods = [
"GET","HEAD","OPTIONS",
"PUT","POST","PATCH","DELETE"
]
cache_policy_id = aws_cloudfront_cache_policy.api.id
origin_request_policy_id = aws_cloudfront_origin_request_policy.api.id
cached_methods = ["GET","HEAD"]
forwarded_values {
query_string = true
headers = ["*"]
cookies {
forward = "all"
}
}
min_ttl = 0
default_ttl = 0