/ modules / aws-cloud-front / variables.tf
variables.tf
 1  variable "env" {
 2    description = "Name of the environment"
 3    type        = string
 4    default     = ""
 5  }
 6  
 7  variable "stage" {
 8    description = "Stage (e.g. `prod`, `dev`, `staging`)"
 9    type        = string
10    default     = ""
11  }
12  
13  variable "comment" {
14    type        = string
15    default     = "Managed by Terraform"
16    description = "Comment for the origin access identity"
17  }
18  
19  variable "aliases" {
20    type        = list(string)
21    description = "List of FQDN's - Used to set the Alternate Domain Names (CNAMEs) setting on Cloudfront"
22    default     = []
23  }
24  
25  variable "cert_arn" {
26    type        = string
27    description = "Existing ACM Certificate ARN"
28  }
29  
30  variable "minimum_protocol_version" {
31    type        = string
32    description = "Cloudfront TLS minimum protocol version"
33    default     = "TLSv1"
34  }
35  
36  variable "origin_force_destroy" {
37    type        = bool
38    default     = false
39    description = "Delete all objects from the bucket  so that the bucket can be destroyed without error (e.g. `true` or `false`)"
40  }
41  
42  variable "price_class" {
43    type        = string
44    default     = "PriceClass_200"
45    description = "Price class for this distribution: `PriceClass_All`, `PriceClass_200`, `PriceClass_100`"
46    # https://aws.amazon.com/fr/cloudfront/pricing/
47  }
48  
49  /* Origin */
50  
51  variable "origin_fqdns" {
52    type        = list(string)
53    description = "FQDN to the origin for CF distribution."
54  }
55  
56  /* Cache Behavior */
57  
58  variable "compress" {
59    type        = bool
60    default     = true
61    description = "Compress content for web requests that include Accept-Encoding: gzip in the request header"
62  }
63  
64  variable "default_ttl" {
65    default     = 86400
66    description = "Default amount of time (in seconds) that an object is in a CloudFront cache"
67  }
68  
69  variable "min_ttl" {
70    default     = 0
71    description = "Minimum amount of time that you want objects to stay in CloudFront caches"
72  }
73  
74  variable "max_ttl" {
75    default     = 31536000
76    description = "Maximum amount of time (in seconds) that an object is in a CloudFront cache"
77  }
78  
79  variable "allowed_methods" {
80    type        = list(string)
81    default     = ["DELETE", "GET", "HEAD", "OPTIONS", "PATCH", "POST", "PUT"]
82    description = "List of allowed methods (e.g. GET, PUT, POST, DELETE, HEAD) for AWS CloudFront"
83  }
84  
85  variable "cached_methods" {
86    type        = list(string)
87    default     = ["GET", "HEAD", "OPTIONS"]
88    description = "List of cached methods (e.g. GET, PUT, POST, DELETE, HEAD)"
89  }