Skip to content

Commit

Permalink
chore: added way to exclude prefix on lambda role name
Browse files Browse the repository at this point in the history
  • Loading branch information
david tjokroaminoto committed Nov 22, 2024
1 parent 811da65 commit 7e4df4f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ locals {
}

lambda_handler = try(split(".", basename(var.lambda_source_path))[0], "notify_slack")

lambda_role_name = var.iam_role_name_prefix != "" ? "${var.iam_role_name_prefix}-${var.lambda_function_name}" : var.lambda_function_name
}

data "aws_iam_policy_document" "lambda" {
Expand Down Expand Up @@ -120,7 +122,7 @@ module "lambda" {

create_role = var.lambda_role == ""
lambda_role = var.lambda_role
role_name = "${var.iam_role_name_prefix}-${var.lambda_function_name}"
role_name = local.lambda_role_name
role_permissions_boundary = var.iam_role_boundary_policy_arn
role_tags = var.iam_role_tags
role_path = var.iam_role_path
Expand Down

0 comments on commit 7e4df4f

Please sign in to comment.