Skip to content

Commit

Permalink
enable appadmin to read svc acct secret
Browse files Browse the repository at this point in the history
  • Loading branch information
tylerthome committed Oct 16, 2024
1 parent 9833e4b commit 723fa6f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions terraform-incubator/home-unite-us/dev/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -198,3 +198,23 @@ resource "aws_secretsmanager_secret_version" "homeuniteus_app" {
secret_id = aws_secretsmanager_secret.homeuniteus_app.id
secret_string = aws_iam_access_key.homeuniteus_app.secret
}


data "aws_iam_policy_document" "homeuniteus_app" {
statement {
sid = "EnableAdminToReadHomeUniteUsAppSecret"
effect = "Allow"

principals {
type = "AWS"
identifiers = [data.aws_iam_user.appadmin.arn]
}

actions = ["secretsmanager:GetSecretValue"]
resources = [aws_secretsmanager_secret.homeuniteus_app.arn]
}
}
resource "aws_secretsmanager_secret_policy" "homeuniteus_app" {
secret_arn = aws_secretsmanager_secret.homeuniteus_app.arn
policy = data.aws_iam_policy_document.cognito_client.json
}

0 comments on commit 723fa6f

Please sign in to comment.