Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Nov 17, 2021
1 parent 1530216 commit 262ac95
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions common/kms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ data "aws_iam_policy_document" "key_policy_combined" {
}

data "aws_iam_policy_document" "empty" {}

data "aws_kms_key" "incoming_key" {
count = var.kms_key_arn == null ? 0 : 1
key_id = var.kms_key_arn
}
6 changes: 3 additions & 3 deletions common/outputs.kms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
#---
output "kms_key_id" {
description = "Created KMS Key ID"
value = aws_kms_key.key.id
value = var.kms_key_arn == null ? aws_kms_key.key[0].id : data.aws_kms_key.incoming_key[0].id
}

output "kms_key_arn" {
description = "Created KMS Key ARN"
value = aws_kms_key.key.arn
value = var.kms_key_arn == null ? aws_kms_key.key[0].arn : data.aws_kms_key.incoming_key[0].arn
}

output "kms_key_alias" {
description = "Created KMS Key Alias name"
value = aws_kms_alias.key.name
value = var.kms_key_arn == null ? aws_kms_key.key[0].name : data.aws_kms_key.incoming_key[0].name
}

0 comments on commit 262ac95

Please sign in to comment.