File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,4 +64,34 @@ module "cloudfront" {
6464 }
6565 ]
6666}
67+ ```
68+
69+ ## Cloudfront distribution with s3 Origin with TTL value
70+ ```
71+ module "cloudfront" {
72+ source = "./cloudfront"
73+ origin = {
74+ domain_name = "s3_bucket_regional_domain_name"
75+ origin_id = "s3_bucket_name"
76+
77+ ## We can only use Any one of Origin Access Control or Origin Access Identity
78+ # For Origin Access Control
79+ origin_access_control_id = "s3_cloudfront_origin_access_control_id"
80+ # For Origin Access Identity
81+ s3_origin_config = {
82+ s3_origin_access_identity = "s3_cloudfront_origin_access_identity_path"
83+ }
84+
85+ }
86+ domain_aliases = ["example.com", "www.example.com"]
87+ acm_arn = "acm_arn"
88+
89+ ## TTL(Time to Live) is the time in seconds that an object is in Cloudfront Cache.
90+ # If we pass these below values then it will be overwritten by default values.
91+ ttl_values = {
92+ min_ttl = 1 # min amount of time that you want objects to stay in cloudfront cache before it sends another request to origin
93+ max_ttl = 86900 # max amount of time that you want objects to stay in cloudfront cache before it sends another request to origin
94+ default_ttl = 3500 # default amount of time that you want objects to stay in cloudfront cache before it sends another request to origin
95+ }
96+ }
6797```
You can’t perform that action at this time.
0 commit comments