-
Notifications
You must be signed in to change notification settings - Fork 71
/
variables.tf
70 lines (58 loc) · 2.14 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
variable "domain_name" {
description = "domain name (or application name if no domain name available)"
}
variable "tags" {
type = map(string)
default = {}
description = "tags for all the resources, if any"
}
variable "hosted_zone" {
default = null
description = "Route53 hosted zone"
}
variable "acm_certificate_domain" {
default = null
description = "Domain of the ACM certificate"
}
variable "price_class" {
default = "PriceClass_100" // Only US,Canada,Europe
description = "CloudFront distribution price class"
}
variable "use_default_domain" {
default = false
description = "Use CloudFront website address without Route53 and ACM certificate"
}
variable "upload_sample_file" {
default = false
description = "Upload sample html file to s3 bucket"
}
# All values for the TTL are important when uploading static content that changes
# https://stackoverflow.com/questions/67845341/cloudfront-s3-etag-possible-for-cloudfront-to-send-updated-s3-object-before-t
variable "cloudfront_min_ttl" {
default = 0
description = "The minimum TTL for the cloudfront cache"
}
variable "cloudfront_default_ttl" {
default = 86400
description = "The default TTL for the cloudfront cache"
}
variable "cloudfront_max_ttl" {
default = 31536000
description = "The maximum TTL for the cloudfront cache"
}
variable "cloudfront_geo_restriction_restriction_type" {
default = "none"
description = "The method that you want to use to restrict distribution of your content by country: none, whitelist, or blacklist."
validation {
error_message = "Can only specify either none, whitelist, blacklist"
condition = can(regex("^(none|whitelist|blacklist)$", var.cloudfront_geo_restriction_restriction_type))
}
}
variable "cloudfront_geo_restriction_locations" {
default = []
description = "The ISO 3166-1-alpha-2 codes for which you want CloudFront either to distribute your content (whitelist) or not distribute your content (blacklist)."
validation {
error_message = "must be a valid ISO 3166-1-alpha-2 code"
condition = length(var.cloudfront_geo_restriction_locations) == 2
}
}