-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcloudfront_unitizer_com.tf
90 lines (87 loc) · 2.67 KB
/
cloudfront_unitizer_com.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# ------------------------------------------------------------------------------------------
# unitizer.com
resource "aws_cloudfront_distribution" "unitizer_com" {
aliases = [
"unitizer.com",
"www.unitizer.com",
]
default_root_object = "index.html"
default_cache_behavior {
allowed_methods = [
"GET",
"HEAD",
]
cached_methods = [
"GET",
"HEAD",
]
cache_policy_id = local.managed_cloudfront_caching_optimized_policy_id
compress = true
response_headers_policy_id = aws_cloudfront_response_headers_policy.custom_response_headers_policy_default.id
target_origin_id = "S3-unitizer.com"
viewer_protocol_policy = "redirect-to-https"
}
enabled = true
is_ipv6_enabled = true
origin {
domain_name = "unitizer.com.s3.amazonaws.com"
origin_id = "S3-unitizer.com"
s3_origin_config {
origin_access_identity = aws_cloudfront_origin_access_identity.identities["unitizer.com"].cloudfront_access_identity_path
}
}
restrictions {
geo_restriction {
restriction_type = "none"
locations = []
}
}
viewer_certificate {
acm_certificate_arn = aws_acm_certificate.unitizer_com.arn
minimum_protocol_version = "TLSv1.2_2021"
ssl_support_method = "sni-only"
}
}
# ------------------------------------------------------------------------------------------
# mta-sts.unitizer.com
resource "aws_cloudfront_distribution" "mta_sts_unitizer_com" {
aliases = [
"mta-sts.unitizer.com",
]
default_root_object = "index.html"
default_cache_behavior {
allowed_methods = [
"GET",
"HEAD",
]
cached_methods = [
"GET",
"HEAD",
]
cache_policy_id = local.managed_cloudfront_caching_optimized_policy_id
compress = true
response_headers_policy_id = aws_cloudfront_response_headers_policy.custom_response_headers_policy_cdn.id
target_origin_id = "S3-mta-sts.unitizer.com"
viewer_protocol_policy = "redirect-to-https"
}
enabled = true
is_ipv6_enabled = true
origin {
domain_name = "mta-sts.unitizer.com.s3.amazonaws.com"
origin_id = "S3-mta-sts.unitizer.com"
s3_origin_config {
origin_access_identity = aws_cloudfront_origin_access_identity.identities["mta-sts.unitizer.com"].cloudfront_access_identity_path
}
}
restrictions {
geo_restriction {
restriction_type = "none"
locations = []
}
}
viewer_certificate {
acm_certificate_arn = aws_acm_certificate.unitizer_com.arn
minimum_protocol_version = "TLSv1.2_2021"
ssl_support_method = "sni-only"
}
}