Skip to content

Commit

Permalink
Work around Cloud Posse CDN module bugs
Browse files Browse the repository at this point in the history
In #1264, I used Cloud Posse's cloudfront-s3-cdn module to create a CloudFront distribution in front of our data snapshots bucket. It turned out to have some bugs that weren't obvious until trying to actually deploy and create resources. This *should* address those. (We'll see if more show up!)
  • Loading branch information
Mr0grog committed Feb 1, 2023
1 parent a09fd4d commit aab0c30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions terraform/api-domains.tf
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ module "univaf_data_snaphsots_cdn" {
parent_zone_id = data.aws_route53_zone.domain_zone[0].zone_id
acm_certificate_arn = var.ssl_certificate_arn
cloudfront_access_logging_enabled = false
override_origin_bucket_policy = false

default_ttl = 60 * 60 * 24 * 7 # 1 Week
http_version = "http2and3"
Expand All @@ -259,4 +260,13 @@ module "univaf_data_snaphsots_cdn" {
# By default, CORS headers are forwarded, but we don't really care about them
# since the bucket is not operating in "website" mode.
forward_header_values = []

# HACK: this module creates bad values if you don't explicitly set one or
# more of namespace, environment, stage, name, or attributes.
# Basically, Cloud Posse modules generate an internal ID from the above,
# and that ID is used for lots of things. Bad stuff happens if it is empty.
# This issue is marked as closed, but is not actually solved:
# https://github.com/cloudposse/terraform-aws-cloudfront-s3-cdn/issues/151
namespace = "cp"
name = "univaf_data_snaphsots_cdn"
}

0 comments on commit aab0c30

Please sign in to comment.