File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
infrastructure/applications/cluster Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ data "aws_cloudfront_cache_policy" "caching_disabled" {
1212 name = " Managed-CachingDisabled"
1313}
1414
15+ data "aws_cloudfront_cache_policy" "origin_cache_control_headers" {
16+ name = " UseOriginCacheControlHeaders"
17+ }
18+
1519data "aws_acm_certificate" "cert" {
1620 domain = " pycon.it"
1721 statuses = [" ISSUED" ]
@@ -60,6 +64,22 @@ resource "aws_cloudfront_distribution" "application" {
6064 compress = true
6165 }
6266
67+ ordered_cache_behavior {
68+ path_pattern = " /_next/static/*"
69+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" ]
70+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
71+ target_origin_id = " default"
72+
73+ cache_policy_id = data. aws_cloudfront_cache_policy . origin_cache_control_headers . id
74+ origin_request_policy_id = data. aws_cloudfront_origin_request_policy . all_viewer . id
75+
76+ min_ttl = 0
77+ default_ttl = 86400
78+ max_ttl = 31536000
79+ compress = true
80+ viewer_protocol_policy = " redirect-to-https"
81+ }
82+
6383 restrictions {
6484 geo_restriction {
6585 restriction_type = " none"
You can’t perform that action at this time.
0 commit comments