mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
Compare commits
8 commits
828e16e3f6
...
36516166d2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
36516166d2 | ||
|
|
ac548b8c6d | ||
|
|
98ad7d1d7c | ||
|
|
23aaa46a5e | ||
|
|
40d1cfe838 | ||
|
|
19f603d78f | ||
|
|
ce68470f25 | ||
|
|
adabbd0a2a |
1 changed files with 42 additions and 14 deletions
|
|
@ -1,3 +1,41 @@
|
|||
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
|
||||
############################################
|
||||
|
|
@ -81,21 +119,11 @@ resource "aws_cloudfront_distribution" "this" {
|
|||
|
||||
viewer_protocol_policy = "redirect-to-https"
|
||||
|
||||
allowed_methods = [
|
||||
"GET","HEAD","OPTIONS",
|
||||
"PUT","POST","PATCH","DELETE"
|
||||
]
|
||||
allowed_methods = ["GET","HEAD","OPTIONS","PUT","POST","PATCH","DELETE"]
|
||||
cached_methods = ["GET","HEAD"]
|
||||
|
||||
cached_methods = ["GET","HEAD"]
|
||||
|
||||
forwarded_values {
|
||||
query_string = true
|
||||
headers = ["*"]
|
||||
|
||||
cookies {
|
||||
forward = "all"
|
||||
}
|
||||
}
|
||||
cache_policy_id = aws_cloudfront_cache_policy.api.id
|
||||
origin_request_policy_id = aws_cloudfront_origin_request_policy.api.id
|
||||
|
||||
min_ttl = 0
|
||||
default_ttl = 0
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue