Skip to content

Commit

Permalink
fix: Expand Permissions for external-secrets IRSA Policy towards AWS …
Browse files Browse the repository at this point in the history
…Secrets Manager (#416)

Co-authored-by: Bryant Biggs <bryantbiggs@gmail.com>
  • Loading branch information
aschaber1 and bryantbiggs authored Aug 30, 2023
1 parent 75d0659 commit fa74a18
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions modules/iam-role-for-service-accounts-eks/policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -501,21 +501,34 @@ data "aws_iam_policy_document" "external_secrets" {
}

statement {
actions = [
"kms:Decrypt"
]
actions = ["kms:Decrypt"]
resources = var.external_secrets_kms_key_arns
}

dynamic "statement" {
for_each = var.external_secrets_secrets_manager_create_permission ? [1] : []
content {
actions = [
"secretsmanager:CreateSecret"
"secretsmanager:CreateSecret",
"secretsmanager:PutSecretValue",
"secretsmanager:TagResource",
]
resources = var.external_secrets_secrets_manager_arns
}
}

dynamic "statement" {
for_each = var.external_secrets_secrets_manager_create_permission ? [1] : []
content {
actions = ["secretsmanager:DeleteSecret"]
resources = var.external_secrets_secrets_manager_arns
condition {
test = "StringEquals"
variable = "secretsmanager:ResourceTag/managed-by"
values = ["external-secrets"]
}
}
}
}

resource "aws_iam_policy" "external_secrets" {
Expand Down

0 comments on commit fa74a18

Please sign in to comment.