From 8ad984fbed551e398af9917dcb558495abb512b9 Mon Sep 17 00:00:00 2001 From: adekunle ibitayo Date: Fri, 1 Nov 2019 11:44:25 +0000 Subject: [PATCH] fixing certification issue --- main.tf | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main.tf b/main.tf index 604d3c0..bd5e031 100644 --- a/main.tf +++ b/main.tf @@ -42,8 +42,8 @@ */ locals { - aws_acmpca_certificate_authority_arn = "${coalesce(element(concat(aws_acmpca_certificate_authority.msk_kafka_with_ca.*.arn, list("")), 0), element(concat(aws_acmpca_certificate_authority.msk_kafka_ca_with_config.*.arn, list("")), 0))}" - msk_cluster_arn = "${coalesce(element(concat(aws_msk_cluster.msk_kafka.*.arn, list("")), 0), element(concat(aws_msk_cluster.msk_kafka_with_config.*.arn, list("")), 0))}" + aws_acmpca_certificate_authority_arn = var.certificateauthority == "true" ? coalesce(element(concat(aws_acmpca_certificate_authority.msk_kafka_with_ca.*.arn, list("")), 0), element(concat(aws_acmpca_certificate_authority.msk_kafka_ca_with_config.*.arn, list("")), 0)) : "" + msk_cluster_arn = coalesce(element(concat(aws_msk_cluster.msk_kafka.*.arn, list("")), 0), element(concat(aws_msk_cluster.msk_kafka_with_config.*.arn, list("")), 0)) } data "aws_caller_identity" "current" {} @@ -173,8 +173,7 @@ resource "aws_msk_cluster" "msk_kafka_with_config" { client_authentication { tls { - certificate_authority_arns = [aws_acmpca_certificate_authority.msk_kafka_ca_with_config[count.index].arn] - } + certificate_authority_arns = aws_acmpca_certificate_authority_arn } encryption_info {