Skip to content

Commit

Permalink
Add variable for existing acm cert arn
Browse files Browse the repository at this point in the history
  • Loading branch information
franklinpashok committed Apr 29, 2024
1 parent 4db3b79 commit 6b6c460
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cloudfront.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ module "cdn" {

viewer_certificate = length(local.acm_domains) > 0 ? merge(
{
acm_certificate_arn = module.acm.acm_certificate_arn
acm_certificate_arn = coalesce(
module.acm.acm_certificate_arn,
var.existing_acm_certificate_arn
)
},
var.certificate_settings,
) : {}
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@ variable "create_certificate" {
default = true
}

variable "existing_acm_certificate_arn" {
description = "Existing ACM certificate"
type = string
default = ""
}

variable "domains" {
description = "Domains or FQDNs to update DNS records and create ACM certificates"
type = map(object({ # Key is arbitrary and not used
Expand Down

0 comments on commit 6b6c460

Please sign in to comment.