Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jan 26, 2022
1 parent 506b7ac commit 79ddc36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cloudwatch.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ resource "aws_cloudwatch_event_rule" "ec2_rule" {
}

resource "aws_cloudwatch_event_target" "ec2_target" {
count = var.create ? 1 : 0
target_id = local.name
count = var.create ? 1 : 0
# target_id = local.name
target_id = var.create ? aws_lambda_function.lambda[0].function_name : null
arn = var.create ? aws_lambda_function.lambda[0].arn : null
rule = var.create ? aws_cloudwatch_event_rule.ec2_rule[0].name : null
# propagate_tags = true
Expand All @@ -52,12 +53,11 @@ resource "aws_cloudwatch_event_target" "ec2_target" {
}

resource "aws_lambda_permission" "allow_cloudwatch" {
count = var.create ? 1 : 0
statement_id = local.name
# statement_id = 45
count = var.create ? 1 : 0
statement_id = "AllowExecutionFromCloudWatch"
action = "lambda:InvokeFunction"
function_name = var.create ? aws_lambda_function.lambda[0].function_name : null
principal = "events.amazonaws.com"
source_arn = var.create ? aws_cloudwatch_event_rule.ec2_rule[0].arn : null
qualifier = var.create ? aws_lambda_alias.lambda[0].name : null
# qualifier = var.create ? aws_lambda_alias.lambda[0].name : null
}
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
locals {
_module_version = "0.0.12"
_module_version = "0.0.13"
}

0 comments on commit 79ddc36

Please sign in to comment.