Skip to content

Commit

Permalink
Add support for input to lambda function
Browse files Browse the repository at this point in the history
  • Loading branch information
hakzor committed Sep 6, 2023
1 parent b66f714 commit b390412
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module "event-cloudwatch" {
name = lookup(var.event, "name", null)
name_prefix = lookup(var.event, "name_prefix", null)
schedule_expression = lookup(var.event, "schedule_expression", "")
input = lookup(var.event, "input", {})
}

module "event-dynamodb" {
Expand Down
1 change: 1 addition & 0 deletions modules/event/cloudwatch-event/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ resource "aws_cloudwatch_event_rule" "lambda" {
name = var.name
name_prefix = var.name_prefix
schedule_expression = var.schedule_expression
input = var.input
}

resource "aws_cloudwatch_event_target" "lambda" {
Expand Down
5 changes: 5 additions & 0 deletions modules/event/cloudwatch-event/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ variable "schedule_expression" {
description = "(Required, if event_pattern isn't specified) Scheduling expression for triggering the Lambda Function using CloudWatch events. For example, cron(0 20 * * ? *) or rate(5 minutes)."
}

variable "input" {
description = "A key-value map to assign as input to the Lambda function."
type = map(string)
default = {}
}

0 comments on commit b390412

Please sign in to comment.