-
Notifications
You must be signed in to change notification settings - Fork 2
/
cloudfront.tf
62 lines (50 loc) · 1.33 KB
/
cloudfront.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
resource "aws_cloudfront_distribution" "cloudfront" {
origin {
domain_name = aws_s3_bucket.bucket.website_endpoint
origin_id = "s3_website"
custom_origin_config {
http_port = 80
https_port = 443
origin_keepalive_timeout = 15
origin_protocol_policy = "http-only"
origin_read_timeout = 30
origin_ssl_protocols = ["TLSv1.1", "TLSv1.2"]
}
}
enabled = true
is_ipv6_enabled = true
http_version = "http2"
default_root_object = "index.html"
aliases = [
var.domain_name
]
default_cache_behavior {
allowed_methods = ["GET", "HEAD", "OPTIONS"]
cached_methods = ["GET", "HEAD"]
target_origin_id = "s3_website"
forwarded_values {
query_string = false
headers = [
"Origin"
]
cookies {
forward = "none"
}
}
viewer_protocol_policy = "redirect-to-https"
default_ttl = var.default_ttl
compress = true
smooth_streaming = false
}
restrictions {
geo_restriction {
restriction_type = "none"
}
}
price_class = "PriceClass_All"
viewer_certificate {
acm_certificate_arn = var.https_certificate_arn
minimum_protocol_version = "TLSv1.1_2016"
ssl_support_method = "sni-only"
}
}