Skip to content

Commit

Permalink
Merge pull request #33 from ministryofjustice/cross-account
Browse files Browse the repository at this point in the history
This is to fix the error when no prinicpal
  • Loading branch information
vijay-veeranki authored Jun 28, 2022
2 parents 92b2e51 + c191ae3 commit 39a3f35
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ resource "aws_kms_key" "kms" {
Sid = "Allow cross-account use of the key"
Effect = "Allow"
Principal = {
AWS = var.kms_external_access
AWS = length(var.kms_external_access) >=1 ? var.kms_external_access : ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"]
},
Action = [
"kms:GenerateDataKey*",
Expand Down

0 comments on commit 39a3f35

Please sign in to comment.