Skip to content

Commit

Permalink
allow the task kms permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Plork committed Oct 2, 2024
1 parent a3cb664 commit 2c11b3b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,22 @@ data "aws_iam_policy_document" "ecs_task" {
actions = ["s3:PutObject*"]
resources = ["arn:aws:s3:::${local.bucket_name_with_prefix}*"]
}

dynamic "statement" {
for_each = var.kms_key_arn != null ? { create = true } : {}

content {
sid = "AllowUseKMS"
resources = [var.kms_key_arn]

actions = [
"kms:Decrypt",
"kms:Encrypt",
"kms:GenerateDataKey*",
"kms:ReEncrypt*",
]
}
}
}

module "iam_role" {
Expand Down

0 comments on commit 2c11b3b

Please sign in to comment.