1
1
locals {
2
- indexstar_origin_id = " ${ local . environment_name } _${ local . region } _indexstar"
3
- indexstar_berg_origin_id = " ${ local . environment_name } _${ local . region } _indexstar_berg"
4
- indexstar_sf_origin_id = " ${ local . environment_name } _${ local . region } _indexstar_sf"
5
- indexstar_primary = local. indexstar_berg_origin_id
6
- http_announce_origin_id = " ${ local . environment_name } _${ local . region } _assigner"
7
- cdn_subdomain = " cdn"
8
- cf_log_bucket = " ${ local . environment_name } -${ local . region } -cf-log"
2
+ indexstar_origin_id = " ${ local . environment_name } _${ local . region } _indexstar"
3
+ indexstar_berg_origin_id = " ${ local . environment_name } _${ local . region } _indexstar_berg"
4
+ indexstar_sf_origin_id = " ${ local . environment_name } _${ local . region } _indexstar_sf"
5
+ indexstar_primary = local. indexstar_sf_origin_id
6
+ http_announce_origin_id = " ${ local . environment_name } _${ local . region } _assigner"
7
+ cdn_subdomain = " cdn"
8
+ cf_log_bucket = " ${ local . environment_name } -${ local . region } -cf-log"
9
9
}
10
10
11
11
resource "aws_s3_bucket" "cf_logs" {
@@ -47,7 +47,7 @@ resource "aws_cloudfront_distribution" "cdn" {
47
47
http_port = 80
48
48
https_port = 443
49
49
origin_protocol_policy = " https-only"
50
- origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
50
+ origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
51
51
}
52
52
origin_shield {
53
53
enabled = true
@@ -68,7 +68,7 @@ resource "aws_cloudfront_distribution" "cdn" {
68
68
http_port = 80
69
69
https_port = 443
70
70
origin_protocol_policy = " https-only"
71
- origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
71
+ origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
72
72
}
73
73
origin_shield {
74
74
enabled = true
@@ -84,7 +84,7 @@ resource "aws_cloudfront_distribution" "cdn" {
84
84
http_port = 80
85
85
https_port = 443
86
86
origin_protocol_policy = " https-only"
87
- origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
87
+ origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
88
88
}
89
89
origin_shield {
90
90
enabled = true
@@ -100,7 +100,7 @@ resource "aws_cloudfront_distribution" "cdn" {
100
100
http_port = 80
101
101
https_port = 443
102
102
origin_protocol_policy = " https-only"
103
- origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
103
+ origin_ssl_protocols = [" SSLv3" , " TLSv1" , " TLSv1.1" , " TLSv1.2" ]
104
104
}
105
105
origin_shield {
106
106
enabled = true
@@ -116,8 +116,8 @@ resource "aws_cloudfront_distribution" "cdn" {
116
116
default_cache_behavior {
117
117
# We need to allow GET and PUT. CloudFront does not support configuring allowed methods selectively.
118
118
# Hence the complete method list.
119
- allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
120
- cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
119
+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
120
+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
121
121
target_origin_id = local. indexstar_primary
122
122
123
123
forwarded_values {
@@ -138,8 +138,8 @@ resource "aws_cloudfront_distribution" "cdn" {
138
138
path_pattern = " multihash/*"
139
139
# CloudFront does not support configuring allowed methods selectively.
140
140
# Hence the complete method list.
141
- allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
142
- cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
141
+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
142
+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
143
143
target_origin_id = local. indexstar_primary
144
144
cache_policy_id = aws_cloudfront_cache_policy. lookup . id
145
145
@@ -149,8 +149,8 @@ resource "aws_cloudfront_distribution" "cdn" {
149
149
150
150
ordered_cache_behavior {
151
151
path_pattern = " cid/*"
152
- allowed_methods = [" GET" , " HEAD" , " OPTIONS" ]
153
- cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
152
+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" ]
153
+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
154
154
target_origin_id = local. indexstar_primary
155
155
cache_policy_id = aws_cloudfront_cache_policy. lookup . id
156
156
@@ -160,8 +160,8 @@ resource "aws_cloudfront_distribution" "cdn" {
160
160
161
161
ordered_cache_behavior {
162
162
path_pattern = " providers"
163
- allowed_methods = [" GET" , " HEAD" , " OPTIONS" ]
164
- cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
163
+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" ]
164
+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
165
165
target_origin_id = local. indexstar_primary
166
166
forwarded_values {
167
167
query_string = false
@@ -180,8 +180,8 @@ resource "aws_cloudfront_distribution" "cdn" {
180
180
path_pattern = " ingest/*"
181
181
# CloudFront does not support configuring allowed methods selectively.
182
182
# Hence the complete method list.
183
- allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
184
- cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
183
+ allowed_methods = [" GET" , " HEAD" , " OPTIONS" , " PUT" , " DELETE" , " PATCH" , " POST" ]
184
+ cached_methods = [" GET" , " HEAD" , " OPTIONS" ]
185
185
target_origin_id = local. indexstar_primary
186
186
forwarded_values {
187
187
query_string = false
@@ -244,16 +244,16 @@ provider "aws" {
244
244
}
245
245
246
246
module "cdn_cert" {
247
- source = " registry.terraform.io/terraform-aws-modules/acm/aws"
247
+ source = " registry.terraform.io/terraform-aws-modules/acm/aws"
248
248
version = " 4.3.2"
249
249
250
250
# Certificate must be in us-east-1 as dictated by CloudFront
251
251
providers = {
252
252
aws = aws.use1
253
253
}
254
254
255
- domain_name = aws_route53_zone. prod_external . name
256
- zone_id = aws_route53_zone. prod_external . zone_id
255
+ domain_name = aws_route53_zone. prod_external . name
256
+ zone_id = aws_route53_zone. prod_external . zone_id
257
257
subject_alternative_names = [" *.${ aws_route53_zone . prod_external . name } " ]
258
258
259
259
tags = local. tags
@@ -267,8 +267,8 @@ module "records" {
267
267
268
268
records = [
269
269
{
270
- name = local.cdn_subdomain
271
- type = " A"
270
+ name = local.cdn_subdomain
271
+ type = " A"
272
272
alias = {
273
273
name = aws_cloudfront_distribution.cdn.domain_name
274
274
zone_id = aws_cloudfront_distribution.cdn.hosted_zone_id
@@ -278,7 +278,7 @@ module "records" {
278
278
}
279
279
280
280
module "cid_contact_cert" {
281
- source = " registry.terraform.io/terraform-aws-modules/acm/aws"
281
+ source = " registry.terraform.io/terraform-aws-modules/acm/aws"
282
282
version = " 4.3.2"
283
283
284
284
# Certificate must be in us-east-1 as dictated by CloudFront
0 commit comments