Skip to content

Commit

Permalink
fixing certification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
adekunle ibitayo committed Nov 1, 2019
1 parent 305820d commit 95e1264
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -337,7 +336,7 @@ resource "aws_iam_policy" "msk_iam_policy" {
EOF
}

resource aws_iam_policy_attachment "msk_iam_policy_attachment" {
resource "aws_iam_policy_attachment" "msk_iam_policy_attachment" {
name = "${var.name}-policy-attachment"
users = [aws_iam_user.msk_iam_user.name]
policy_arn = aws_iam_policy.msk_iam_policy.arn
Expand Down

0 comments on commit 95e1264

Please sign in to comment.