Skip to content

Commit 60f3eed

Browse files
authored
feat: allow reuse of existing lambda_role (#85)
1 parent c69c7d1 commit 60f3eed

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ module "lambda" {
9292
LOG_EVENTS = var.log_events ? "True" : "False"
9393
}
9494

95-
create_role = true
95+
create_role = var.lambda_role == ""
96+
lambda_role = var.lambda_role
9697
role_name = "${var.iam_role_name_prefix}-${var.lambda_function_name}"
9798
role_permissions_boundary = var.iam_role_boundary_policy_arn
9899
role_tags = var.iam_role_tags

variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ variable "create_sns_topic" {
1010
default = true
1111
}
1212

13+
variable "lambda_role" {
14+
description = "IAM role attached to the Lambda Function. If this is set then a role will not be created for you."
15+
type = string
16+
default = ""
17+
}
18+
1319
variable "lambda_function_name" {
1420
description = "The name of the Lambda function to create"
1521
type = string

0 commit comments

Comments
 (0)