Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nickpenaranda committed Jul 18, 2024
1 parent 04bbf33 commit fc1f35e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions modules/kms/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -138,15 +138,15 @@ resource "aws_kms_alias" "clickhouse_key" {
count = var.create_clickhouse_key ? 1 : 0

name = "alias/${var.clickhouse_key_alias}"
target_key_id = aws_kms_key.clickhouse_key.key_id
target_key_id = aws_kms_key.clickhouse_key[0].key_id
}


resource "aws_kms_grant" "clickhouse" {
count = var.create_clickhouse_key && (var.iam_principal_arn == "") ? 0 : 1

grantee_principal = var.iam_principal_arn
key_id = aws_kms_key.clickhouse_key.key_id
key_id = aws_kms_key.clickhouse_key[0].key_id
operations = [
"Decrypt",
"DescribeKey",
Expand Down
2 changes: 1 addition & 1 deletion modules/kms/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ output "key" {


output "clickhouse_key" {
value = aws_kms_key.clickhouse_key
value = var.create_clickhouse_key ? aws_kms_key.clickhouse_key[0] : null
description = "The KMS key used to encrypt Weave data in Clickhouse."
}

0 comments on commit fc1f35e

Please sign in to comment.