Home > Net >  A question about Terraform AWS Module EventBridge
A question about Terraform AWS Module EventBridge

Time:09-06

This is an example of an official document, https://registry.terraform.io/modules/terraform-aws-modules/eventbridge/aws/1.14.2

One of the use cases looks like this EventBridge with schedule rule and Lambda target

module "eventbridge" {
  source = "terraform-aws-modules/eventbridge/aws"

  create_bus = false

  rules = {
    crons = {
      description         = "Trigger for a Lambda"
      schedule_expression = "rate(5 minutes)"
    }
  }

  targets = {
    crons = [
      {
        name  = "lambda-loves-cron"
        arn   = "arn:aws:lambda:ap-southeast-1:135367859851:function:resolved-penguin-lambda"
        input = jsonencode({"job": "cron-by-rate"})
      }
    ]
  }
}

What does "input" above mean and what needs to be input?

CodePudding user response:

The input value is passed to the Lambda function when it's invoked.

Its value is up to you (and could be empty); it depends what your Lambda function does.

  • Related