Skip to content

Commit 9223d51

Browse files
committed
Switch to SF as primary
Switch to SF as primary until Berg hardware is repaired and memory expanded.
1 parent 87c5d86 commit 9223d51

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

deploy/infrastructure/prod/us-east-2/cloudfront.tf

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
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"
99
}
1010

1111
resource "aws_s3_bucket" "cf_logs" {
@@ -47,7 +47,7 @@ resource "aws_cloudfront_distribution" "cdn" {
4747
http_port = 80
4848
https_port = 443
4949
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"]
5151
}
5252
origin_shield {
5353
enabled = true
@@ -68,7 +68,7 @@ resource "aws_cloudfront_distribution" "cdn" {
6868
http_port = 80
6969
https_port = 443
7070
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"]
7272
}
7373
origin_shield {
7474
enabled = true
@@ -84,7 +84,7 @@ resource "aws_cloudfront_distribution" "cdn" {
8484
http_port = 80
8585
https_port = 443
8686
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"]
8888
}
8989
origin_shield {
9090
enabled = true
@@ -100,7 +100,7 @@ resource "aws_cloudfront_distribution" "cdn" {
100100
http_port = 80
101101
https_port = 443
102102
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"]
104104
}
105105
origin_shield {
106106
enabled = true
@@ -116,8 +116,8 @@ resource "aws_cloudfront_distribution" "cdn" {
116116
default_cache_behavior {
117117
# We need to allow GET and PUT. CloudFront does not support configuring allowed methods selectively.
118118
# 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"]
121121
target_origin_id = local.indexstar_primary
122122

123123
forwarded_values {
@@ -138,8 +138,8 @@ resource "aws_cloudfront_distribution" "cdn" {
138138
path_pattern = "multihash/*"
139139
# CloudFront does not support configuring allowed methods selectively.
140140
# 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"]
143143
target_origin_id = local.indexstar_primary
144144
cache_policy_id = aws_cloudfront_cache_policy.lookup.id
145145

@@ -149,8 +149,8 @@ resource "aws_cloudfront_distribution" "cdn" {
149149

150150
ordered_cache_behavior {
151151
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"]
154154
target_origin_id = local.indexstar_primary
155155
cache_policy_id = aws_cloudfront_cache_policy.lookup.id
156156

@@ -160,8 +160,8 @@ resource "aws_cloudfront_distribution" "cdn" {
160160

161161
ordered_cache_behavior {
162162
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"]
165165
target_origin_id = local.indexstar_primary
166166
forwarded_values {
167167
query_string = false
@@ -180,8 +180,8 @@ resource "aws_cloudfront_distribution" "cdn" {
180180
path_pattern = "ingest/*"
181181
# CloudFront does not support configuring allowed methods selectively.
182182
# 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"]
185185
target_origin_id = local.indexstar_primary
186186
forwarded_values {
187187
query_string = false
@@ -244,16 +244,16 @@ provider "aws" {
244244
}
245245

246246
module "cdn_cert" {
247-
source = "registry.terraform.io/terraform-aws-modules/acm/aws"
247+
source = "registry.terraform.io/terraform-aws-modules/acm/aws"
248248
version = "4.3.2"
249249

250250
# Certificate must be in us-east-1 as dictated by CloudFront
251251
providers = {
252252
aws = aws.use1
253253
}
254254

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
257257
subject_alternative_names = ["*.${aws_route53_zone.prod_external.name}"]
258258

259259
tags = local.tags
@@ -267,8 +267,8 @@ module "records" {
267267

268268
records = [
269269
{
270-
name = local.cdn_subdomain
271-
type = "A"
270+
name = local.cdn_subdomain
271+
type = "A"
272272
alias = {
273273
name = aws_cloudfront_distribution.cdn.domain_name
274274
zone_id = aws_cloudfront_distribution.cdn.hosted_zone_id
@@ -278,7 +278,7 @@ module "records" {
278278
}
279279

280280
module "cid_contact_cert" {
281-
source = "registry.terraform.io/terraform-aws-modules/acm/aws"
281+
source = "registry.terraform.io/terraform-aws-modules/acm/aws"
282282
version = "4.3.2"
283283

284284
# Certificate must be in us-east-1 as dictated by CloudFront

0 commit comments

Comments
 (0)