Skip to content

Commit

Permalink
Pass kms_key_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronaldo Macapobre committed Dec 10, 2024
1 parent 36387ea commit 75f0394
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions infrastructure/cloud/environments/test/webapp.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module "iam" {
iam_user_table_name = var.iam_user_table_name
secrets_arn_list = module.secrets_manager.secrets_arn_list
account_id = data.aws_caller_identity.current.account_id
kms_key_id = data.aws_kms_key.kms_key.id
}

# Parse Subnets
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/cloud/modules/IAM/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# KMS Key Policy
#
resource "aws_kms_key_policy" "kms_key_policy" {
key_id = aws_kms_key.kms_key.id
key_id = var.kms_key_id

policy = jsonencode({
Version = "2012-10-17"
Expand Down
5 changes: 5 additions & 0 deletions infrastructure/cloud/modules/IAM/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ variable "account_id" {
description = "The current AWS Account Id"
type = string
}

variable "kms_key_id" {
description = "The custom KMS Key Id"
type = string
}

0 comments on commit 75f0394

Please sign in to comment.