Skip to content

Commit

Permalink
fixing tf cycle and index issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandeivert committed Apr 3, 2020
1 parent f15c692 commit d8b66bc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "aws_cloudwatch_event_rule" "invocation_schedule" {

resource "aws_cloudwatch_event_target" "invoke_lambda" {
count = local.schedule_enabled ? 1 : 0
rule = aws_cloudwatch_event_rule.invocation_schedule.name
rule = aws_cloudwatch_event_rule.invocation_schedule[0].name
arn = aws_lambda_alias.alias.arn
input = jsonencode(var.lambda_input_event)
}
Expand Down
2 changes: 1 addition & 1 deletion streamalert_cli/_infrastructure/modules/tf_lambda/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ data "aws_iam_policy_document" "lambda_execution_policy" {

// Create the execution role for the Lambda function.
resource "aws_iam_role" "role" {
name = "${aws_lambda_function.function.function_name}_role"
name = "${var.function_name}_role"
path = "/streamalert/"
assume_role_policy = data.aws_iam_policy_document.lambda_execution_policy.json

Expand Down
2 changes: 1 addition & 1 deletion streamalert_cli/_infrastructure/modules/tf_lambda/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ resource "aws_lambda_permission" "allow_cloudwatch_invocation" {
action = "lambda:InvokeFunction"
function_name = aws_lambda_function.function.function_name
principal = "events.amazonaws.com"
source_arn = aws_cloudwatch_event_rule.invocation_schedule.arn
source_arn = aws_cloudwatch_event_rule.invocation_schedule[0].arn
qualifier = aws_lambda_alias.alias.name
}

Expand Down

0 comments on commit d8b66bc

Please sign in to comment.