Skip to content

Commit a4a3159

Browse files
authored
data source for domain certificate should not be called if no domain is provided (#78)
* Fixed validation * Further local.fqdn_provided fixes
1 parent ec54b25 commit a4a3159

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

operations/deployment/terraform/certificates.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Lookup for main domain.
22

33
data "aws_acm_certificate" "issued" {
4-
count = var.no_cert == "true" ? 0 : ( var.create_root_cert != "true" ? ( var.create_sub_cert != "true" ? ( local.fqdn_provided != "" ? 1 : 0 ) : 0 ) : 0 )
4+
count = var.no_cert == "true" ? 0 : ( var.create_root_cert != "true" ? ( var.create_sub_cert != "true" ? ( local.fqdn_provided ? 1 : 0 ) : 0 ) : 0 )
55
domain = var.domain_name
66
}
77

@@ -59,7 +59,7 @@ locals {
5959
( var.cert_arn != "" ? var.cert_arn :
6060
( var.create_root_cert != "true" ?
6161
( var.create_sub_cert != "true" ?
62-
( local.fqdn_provided != "" ? data.aws_acm_certificate.issued[0].arn : "" )
62+
( local.fqdn_provided ? data.aws_acm_certificate.issued[0].arn : "" )
6363
: aws_acm_certificate.sub_domain[0].arn
6464
) : aws_acm_certificate.root_domain[0].arn
6565
)
@@ -70,7 +70,7 @@ locals {
7070
( var.cert_arn != "" ? true :
7171
( var.create_root_cert != "true" ?
7272
( var.create_sub_cert != "true" ?
73-
( local.fqdn_provided != "" ? true : false )
73+
( local.fqdn_provided ? true : false )
7474
: true
7575
) : true
7676
)

0 commit comments

Comments
 (0)