Skip to content

Commit

Permalink
fix(iam): add back some of the kinesis iam
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Jan 2, 2025
1 parent e199c8a commit bee6559
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 29 deletions.
41 changes: 41 additions & 0 deletions infrastructure/user-list-search/lambda_codedeploy.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
resource "aws_iam_role" "lambda_codedeploy_role" {
name = "${local.prefix}-LambdaCodeDeployRole"
assume_role_policy = data.aws_iam_policy_document.codedeploy_assume_role.json
}


resource "aws_iam_role_policy_attachment" "lambda_codedeploy_role" {
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSCodeDeployRoleForLambda"
#Depending on the service there are different types.
role = aws_iam_role.lambda_codedeploy_role.name
}

resource "aws_iam_role" "lambda_role" {
name = "${local.prefix}-LambdaExecutionRole"
tags = local.tags
assume_role_policy = data.aws_iam_policy_document.lambda_assume.json
}

resource "aws_iam_role_policy_attachment" "lambda_role_xray_write" {
role = aws_iam_role.lambda_role.name
policy_arn = data.aws_iam_policy.aws_xray_write_only_access.arn
}

data "aws_iam_policy_document" "lambda_assume" {
version = "2012-10-17"

statement {
effect = "Allow"
actions = [
"sts:AssumeRole"
]

principals {
identifiers = [
"lambda.amazonaws.com"
]

type = "Service"
}
}
}
29 changes: 0 additions & 29 deletions infrastructure/user-list-search/metrics_metric_definitions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -70,35 +70,6 @@ locals {
expression = "IF(user_list_import_queue_messages_deleted, user_list_import_queue_messages_deleted, 1)/IF(user_list_import_queue_messages_sent, user_list_import_queue_messages_sent, 1)*100",
}
}
event_consumer_lambda = {
duration = {
id = "event_consumer_lambda_duration"
namespace = "AWS/Lambda"
metric = "Duration"
statistic = "Sum"
dimensions = {
FunctionName = aws_lambda_function.unified_events_consumer.function_name
}
},
errors = {
id = "event_consumer_lambda_errors"
namespace = "AWS/Lambda"
metric = "Errors"
statistic = "Sum"
dimensions = {
FunctionName = aws_lambda_function.unified_events_consumer.function_name
}
},
iterator_age = {
id = "event_consumer_lambda_iterator_age"
namespace = "AWS/Lambda"
metric = "IteratorAge"
statistic = "Sum"
dimensions = {
FunctionName = aws_lambda_function.unified_events_consumer.function_name
}
}
}

list_item_import_lambda = {
invocations = {
Expand Down

0 comments on commit bee6559

Please sign in to comment.