Compare commits

...

8 commits

Author SHA1 Message Date
Jun-te Kim
36516166d2
Merge pull request #891 from Hestia-Homes/main
Some checks are pending
Fast Api Backend Deploy / deploy (push) Waiting to run
Deploy infrastructure / determine_stage (push) Waiting to run
Deploy infrastructure / shared_terraform (push) Blocked by required conditions
Deploy infrastructure / ara_engine_image (push) Blocked by required conditions
Deploy infrastructure / ara_engine_lambda (push) Blocked by required conditions
Deploy infrastructure / address2uprn_image (push) Blocked by required conditions
Deploy infrastructure / address2uprn_lambda (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_image (push) Blocked by required conditions
Deploy infrastructure / postcodeSplitter_lambda (push) Blocked by required conditions
Deploy infrastructure / condition_etl_image (push) Blocked by required conditions
Deploy infrastructure / condition_etl_lambda (push) Blocked by required conditions
Deploy infrastructure / categorisation_image (push) Blocked by required conditions
Deploy infrastructure / categorisation_lambda (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_image (push) Blocked by required conditions
Deploy infrastructure / ordnanceSurvey_lambda (push) Blocked by required conditions
Deploy infrastructure / fast_api_lambda (push) Blocked by required conditions
Deploy infrastructure / cloudfront_cdn (push) Blocked by required conditions
Deploy fastapi with terraform: Disable query string behaviour caching as caching time is set to 0
2026-03-16 16:09:44 +00:00
Jun-te Kim
ac548b8c6d
Merge pull request #890 from Hestia-Homes/deploy-fastapi-with-terraform
Deploy fastapi with terraform:  Disable query string behaviour caching as caching time is set to 0
2026-03-16 16:08:34 +00:00
Daniel Roth
98ad7d1d7c disable query string behaviour caching as caching time is set to 0 2026-03-16 16:06:20 +00:00
Daniel Roth
23aaa46a5e Merge branch 'main' into deploy-fastapi-with-terraform 2026-03-16 16:04:06 +00:00
Jun-te Kim
40d1cfe838
Merge pull request #889 from Hestia-Homes/main
Deploy fastapi with terraform: Replace forwarded_values with cache_policy and origin_request_policy for API origin
2026-03-16 15:55:11 +00:00
Jun-te Kim
19f603d78f
Merge pull request #888 from Hestia-Homes/deploy-fastapi-with-terraform
Deploy fastapi with terraform: Replace forwarded_values with cache_policy and origin_request_policy for API origin
2026-03-16 15:54:00 +00:00
Daniel Roth
ce68470f25 Replace forwarded_values with cache_policy and origin_request_policy for API origin 2026-03-16 15:11:59 +00:00
Daniel Roth
adabbd0a2a Merge branch 'main' into deploy-fastapi-with-terraform 2026-03-16 14:50:53 +00:00

View file

@ -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