Skip to content

Commit 9770729

Browse files
committed
Fixing certificates conditional
1 parent 4e4c4f4 commit 9770729

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

operations/deployment/terraform/aws/bitovi_main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ module "efs_to_ec2_sg" {
6262

6363
module "aws_certificates" {
6464
source = "../modules/aws/certificates"
65-
count = (var.aws_ec2_instance_create || var.aws_ecs_enable ) && var.aws_r53_enable_cert && var.aws_r53_cert_arn == "" ? 1 : 0
65+
count = (var.aws_ec2_instance_create || var.aws_ecs_enable) && var.aws_r53_enable_cert && var.aws_r53_cert_arn == "" && var.aws_r53_domain_name != "" ? 1 : 0
6666
# Cert
6767
aws_r53_cert_arn = var.aws_r53_cert_arn
6868
aws_r53_create_root_cert = var.aws_r53_create_root_cert
@@ -812,7 +812,7 @@ locals {
812812
) :
813813
false
814814
)
815-
protocol = var.aws_r53_enable_cert ? try(module.aws_certificates[0].selected_arn, var.aws_r53_cert_arn, "") != "" ? "https://" : "http://" : "http://"
815+
protocol = var.aws_r53_enable_cert ? try(module.aws_certificates[0].selected_arn, var.aws_r53_cert_arn, "") != "" ? "https://" : "http://" : "http://"
816816
create_efs = var.aws_efs_create == true ? true : (var.aws_efs_create_ha == true ? true : false)
817817
ec2_public_endpoint = var.aws_ec2_instance_create ? (module.ec2[0].instance_public_dns != null ? module.ec2[0].instance_public_dns : module.ec2[0].instance_public_ip) : null
818818
ec2_private_endpoint = var.aws_ec2_instance_create ? (module.ec2[0].instance_private_dns != null ? module.ec2[0].instance_private_dns : module.ec2[0].instance_private_ip) : null

0 commit comments

Comments
 (0)