From 18dfad419775376728cdeaf08ba144ff3a9cbc14 Mon Sep 17 00:00:00 2001 From: Nick Penaranda Date: Thu, 18 Jul 2024 13:20:59 -0400 Subject: [PATCH] fix: Condition to create kms.aws_kms_grant.clickhouse was incorrect --- modules/kms/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/kms/main.tf b/modules/kms/main.tf index df115510..4b0f6edd 100644 --- a/modules/kms/main.tf +++ b/modules/kms/main.tf @@ -143,7 +143,7 @@ resource "aws_kms_alias" "clickhouse_key" { resource "aws_kms_grant" "clickhouse" { - count = !var.create_clickhouse_key && (var.iam_principal_arn == "") ? 0 : 1 + count = var.create_clickhouse_key && (var.iam_principal_arn != "") ? 1 : 0 grantee_principal = var.iam_principal_arn key_id = aws_kms_key.clickhouse_key[0].key_id