Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Commit

Permalink
added elasticache permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerpen80 committed Aug 15, 2024
1 parent 57e33d7 commit 4fc635c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lambda_cw_alarm_creator_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module "iam_role_lambda_cw_alarm_creator" {
"lambda_rds_read_access" : jsondecode(data.aws_iam_policy_document.lambda_rds_read_access.json)
"lambda_ecs_read_access" : jsondecode(data.aws_iam_policy_document.lambda_ecs_read_access.json)
"lambda_s3_read_access" : jsondecode(data.aws_iam_policy_document.lambda_s3_read_access.json)
"lambda_elasticache_read_access" : jsondecode(data.aws_iam_policy_document.lambda_elasticache_read_access.json)
}

trust_relationship = {
Expand Down Expand Up @@ -104,6 +105,16 @@ data "aws_iam_policy_document" "lambda_s3_read_access" {
}
}

data "aws_iam_policy_document" "lambda_elasticache_read_access" {
statement {
sid = "AllowLambdaElasticacheAccess"

actions = ["elasticache:Describe*"]

resources = ["*"]
}
}

# The Lambda role needs to access KMS key in order to access SNS topic.
resource "aws_kms_grant" "give_lambda_role_access" {
name = "lambda-role-kms-grant-access"
Expand Down

0 comments on commit 4fc635c

Please sign in to comment.