DEV Community

leroykayanda
leroykayanda

Posted on

Terraform AWS module for an eventbridge rule

module "end_to_end_recon_time_eventbridge" {
  source               = "terraform-aws-modules/eventbridge/aws"
  create_bus           = false
  role_name            = "${var.env}-end-to-end-recon-time"
  attach_lambda_policy = true

  rules = {
    "${var.env}-end-to-end-recon-time" = {
      description         = "Trigger lambda that computes end to end reconciliation time"
      schedule_expression = "rate(10 minutes)"
    }
  }

  targets = {
    "${var.env}-end-to-end-recon-time" = [
      {
        name  = "end-to-end-recon-time"
        arn   = module.end_to_end_recon_time_lambda.arn
        input = jsonencode({ "job" : "cron-by-rate" })
      }
    ]
  }

  lambda_target_arns = [module.end_to_end_recon_time_lambda.arn]

  tags = {
    Name = "${var.env}-end-to-end-recon-time"
  }
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay