Skip to content

Commit dd51c31

Browse files
authored
fix: use lambda resource to get name instead of variable (#130)
1 parent 30e15b6 commit dd51c31

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cloudwatch_event_rules.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ resource "aws_lambda_permission" "cloudwatch_events" {
22
for_each = var.cloudwatch_event_rules
33

44
action = "lambda:InvokeFunction"
5-
function_name = var.function_name
5+
function_name = var.ignore_external_function_updates ? aws_lambda_function.lambda_external_lifecycle[0].function_name : aws_lambda_function.lambda[0].function_name
66
principal = "events.amazonaws.com"
77
qualifier = contains(keys(each.value), "cloudwatch_event_target_arn") ? trimprefix(each.value["cloudwatch_event_target_arn"], "${local.function_arn}:") : null
88
source_arn = aws_cloudwatch_event_rule.lambda[each.key].arn

0 commit comments

Comments
 (0)