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

Commit

Permalink
allow lambda read ECS
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerpen80 committed Feb 14, 2024
1 parent 31df4de commit 3029bee
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 @@ -13,6 +13,7 @@ module "iam_role_lambda_cw_alarm_creator" {
"eventbus" : jsondecode(data.aws_iam_policy_document.eventbus.json)
"lambda_ec2_read_access" : jsondecode(data.aws_iam_policy_document.lambda_ec2_read_access.json)
"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)
}

trust_relationship = {
Expand Down Expand Up @@ -82,6 +83,16 @@ data "aws_iam_policy_document" "lambda_rds_read_access" {
}
}

data "aws_iam_policy_document" "lambda_ecs_read_access" {
statement {
sid = "AllowLambdaECSAccess"

actions = ["ecs:List*"]

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 3029bee

Please sign in to comment.