Skip to content

Commit

Permalink
Merge pull request #34 from cambridge-collection/feature/cloudfront-a…
Browse files Browse the repository at this point in the history
…liases

Add further aliases to the CloudFront Distribution
  • Loading branch information
rorymchugh authored Dec 9, 2024
2 parents d5a3c39 + b1d75f6 commit 9b9ef08
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/cudl-data-processing/cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ resource "aws_cloudfront_distribution" "this" {
web_acl_id = aws_wafv2_web_acl.this.0.arn
default_root_object = var.cloudfront_default_root_object

aliases = [
aliases = concat([
local.cloudfront_distribution_domain_name
]
], var.cloudfront_alternative_domain_names)

origin {
domain_name = aws_s3_bucket.dest-bucket.bucket_regional_domain_name
Expand Down
2 changes: 1 addition & 1 deletion modules/cudl-data-processing/locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
locals {
destination_bucket_name = trimsuffix(substr(lower("${var.environment}-${var.destination-bucket-name}"), 0, 63), "-")
enhacements_bucket_name = trimsuffix(substr(lower("${var.environment}-${var.enhancements-bucket-name}"), 0, 63), "-")
source_bucket_name = trimsuffix(substr(lower("${var.environment}-${var.source-bucket-name}"), 0, 63), "-")
source_bucket_name = trimsuffix(substr(lower("${var.environment}-${var.source-bucket-name}"), 0, 63), "-")
transform-lambda-bucket-names = toset([for bucket in [
local.destination_bucket_name,
local.enhacements_bucket_name,
Expand Down
6 changes: 6 additions & 0 deletions modules/cudl-data-processing/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ variable "cloudfront_default_root_object" {
default = null
}

variable "cloudfront_alternative_domain_names" {
type = list(string)
description = "List of additional domain names to add to the CloudFront distribution"
default = []
}

variable "efs_nfs_mount_port" {
type = number
description = "NFS protocol port for EFS mounts"
Expand Down

0 comments on commit 9b9ef08

Please sign in to comment.