Skip to content

Commit

Permalink
increase img ttl
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloChecked committed Oct 5, 2024
1 parent b452c5a commit 15811cf
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 27 deletions.
2 changes: 1 addition & 1 deletion terraform/static-site/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ resource "aws_cloudfront_distribution" "s3_distribution" {
}
}

min_ttl = 0
min_ttl = 2592000
default_ttl = 2592000
max_ttl = 31536000
compress = true
Expand Down
14 changes: 7 additions & 7 deletions terraform/terraform.tfstate
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.6",
"serial": 196,
"serial": 198,
"lineage": "d903686c-b104-5be0-bf33-d6e6715f3db6",
"outputs": {},
"resources": [
Expand Down Expand Up @@ -217,13 +217,13 @@
"default_root_object": "index.html",
"domain_name": "dssqkj1981x2t.cloudfront.net",
"enabled": true,
"etag": "E2TRFVM48H7U6U",
"etag": "E3DZKDKZT6A9HW",
"hosted_zone_id": "Z2FDTNDATAQYW2",
"http_version": "http2",
"id": "E134JZE6VZJIZM",
"in_progress_validation_batches": 0,
"is_ipv6_enabled": true,
"last_modified_time": "2024-08-25 19:20:46.067 +0000 UTC",
"last_modified_time": "2024-10-05 18:53:16.995 +0000 UTC",
"logging_config": [],
"ordered_cache_behavior": [
{
Expand Down Expand Up @@ -300,7 +300,7 @@
"function_association": [],
"lambda_function_association": [],
"max_ttl": 31536000,
"min_ttl": 0,
"min_ttl": 2592000,
"origin_request_policy_id": "",
"path_pattern": "/img/*",
"realtime_log_config_arn": "",
Expand Down Expand Up @@ -330,7 +330,7 @@
"cookies": [
{
"forward": "none",
"whitelisted_names": null
"whitelisted_names": []
}
],
"headers": [],
Expand All @@ -348,8 +348,8 @@
"response_headers_policy_id": "",
"smooth_streaming": false,
"target_origin_id": "angeloceccato-website-content",
"trusted_key_groups": null,
"trusted_signers": null,
"trusted_key_groups": [],
"trusted_signers": [],
"viewer_protocol_policy": "redirect-to-https"
}
],
Expand Down
74 changes: 55 additions & 19 deletions terraform/terraform.tfstate.backup
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"version": 4,
"terraform_version": "1.6.6",
"serial": 194,
"serial": 196,
"lineage": "d903686c-b104-5be0-bf33-d6e6715f3db6",
"outputs": {},
"resources": [
Expand Down Expand Up @@ -211,19 +211,19 @@
"target_origin_id": "angeloceccato-website-content",
"trusted_key_groups": [],
"trusted_signers": [],
"viewer_protocol_policy": "allow-all"
"viewer_protocol_policy": "redirect-to-https"
}
],
"default_root_object": "index.html",
"domain_name": "dssqkj1981x2t.cloudfront.net",
"enabled": true,
"etag": "E3042U8TK8QWZQ",
"etag": "E2TRFVM48H7U6U",
"hosted_zone_id": "Z2FDTNDATAQYW2",
"http_version": "http2",
"id": "E134JZE6VZJIZM",
"in_progress_validation_batches": 0,
"is_ipv6_enabled": true,
"last_modified_time": "2022-06-16 20:52:52.933 +0000 UTC",
"last_modified_time": "2024-08-25 19:20:46.067 +0000 UTC",
"logging_config": [],
"ordered_cache_behavior": [
{
Expand Down Expand Up @@ -282,7 +282,7 @@
"HEAD"
],
"compress": true,
"default_ttl": 3600,
"default_ttl": 2592000,
"field_level_encryption_id": "",
"forwarded_values": [
{
Expand All @@ -299,17 +299,58 @@
],
"function_association": [],
"lambda_function_association": [],
"max_ttl": 86400,
"max_ttl": 31536000,
"min_ttl": 0,
"origin_request_policy_id": "",
"path_pattern": "/docs/*",
"path_pattern": "/img/*",
"realtime_log_config_arn": "",
"response_headers_policy_id": "",
"smooth_streaming": false,
"target_origin_id": "angeloceccato-website-content",
"trusted_key_groups": [],
"trusted_signers": [],
"viewer_protocol_policy": "redirect-to-https"
},
{
"allowed_methods": [
"GET",
"HEAD",
"OPTIONS"
],
"cache_policy_id": "",
"cached_methods": [
"GET",
"HEAD"
],
"compress": true,
"default_ttl": 2592000,
"field_level_encryption_id": "",
"forwarded_values": [
{
"cookies": [
{
"forward": "none",
"whitelisted_names": null
}
],
"headers": [],
"query_string": false,
"query_string_cache_keys": []
}
],
"function_association": [],
"lambda_function_association": [],
"max_ttl": 31536000,
"min_ttl": 0,
"origin_request_policy_id": "",
"path_pattern": "/styles.css",
"realtime_log_config_arn": "",
"response_headers_policy_id": "",
"smooth_streaming": false,
"target_origin_id": "angeloceccato-website-content",
"trusted_key_groups": null,
"trusted_signers": null,
"viewer_protocol_policy": "redirect-to-https"
}
],
"origin": [
Expand Down Expand Up @@ -382,7 +423,8 @@
"private": "eyJzY2hlbWFfdmVyc2lvbiI6IjEifQ==",
"dependencies": [
"module.website.aws_acm_certificate.default",
"module.website.aws_s3_bucket.website_bucket"
"module.website.aws_s3_bucket.website_bucket",
"module.website.aws_s3_bucket_website_configuration.bucket_configuration"
]
}
]
Expand Down Expand Up @@ -582,7 +624,8 @@
"module.website.aws_acm_certificate.default",
"module.website.aws_cloudfront_distribution.s3_distribution",
"module.website.aws_route53_zone.primary",
"module.website.aws_s3_bucket.website_bucket"
"module.website.aws_s3_bucket.website_bucket",
"module.website.aws_s3_bucket_website_configuration.bucket_configuration"
]
}
]
Expand Down Expand Up @@ -626,7 +669,8 @@
"module.website.aws_acm_certificate.default",
"module.website.aws_cloudfront_distribution.s3_distribution",
"module.website.aws_route53_zone.secondary",
"module.website.aws_s3_bucket.website_bucket"
"module.website.aws_s3_bucket.website_bucket",
"module.website.aws_s3_bucket_website_configuration.bucket_configuration"
]
}
]
Expand Down Expand Up @@ -715,14 +759,6 @@
"cors_rule": [],
"force_destroy": true,
"grant": [
{
"id": "c4c1ede66af53448b93c283ce9448c4ba468c9432aa01d700d3878632f77d2d0",
"permissions": [
"FULL_CONTROL"
],
"type": "CanonicalUser",
"uri": ""
},
{
"id": "e17ee8fe9e83a04c358b26883da34dde008fd334d382adcd883056564b8077ab",
"permissions": [
Expand Down Expand Up @@ -840,7 +876,7 @@
"attributes": {
"bucket": "angeloceccato-website-content",
"id": "angeloceccato-website-content",
"policy": "{\n \"Version\": \"2012-10-17\",\n \"Statement\": [\n {\n \"Sid\": \"\",\n \"Effect\": \"Allow\",\n \"Action\": \"s3:GetObject\",\n \"Resource\": \"arn:aws:s3:::angeloceccato-website-content/*\",\n \"Principal\": {\n \"AWS\": \"*\"\n }\n }\n ]\n}"
"policy": "{\"Statement\":[{\"Action\":\"s3:GetObject\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"*\"},\"Resource\":\"arn:aws:s3:::angeloceccato-website-content/*\",\"Sid\":\"\"}],\"Version\":\"2012-10-17\"}"
},
"sensitive_attributes": [],
"private": "bnVsbA==",
Expand Down

0 comments on commit 15811cf

Please sign in to comment.