question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-events-targets): Event Rule Targets do not apply to multiple Lambda Functions

See original GitHub issue

When applying Event Rules to multiple Lambda targets it only applies to one function. When you edit the rule in the console and update (without change), the rules apply the desired targets correctly.

Reproduction Steps

  • Target > 1 function in rule definition
  • Deploy via CDK Pipeline
  • Verify in Console that lambda_target_2 is missing an event source
  • Edit Rule in EventBridge console
  • Press Update
  • Verify lambda_target_2 function now has an event source
events.Rule(self, "Every1Mins",
	schedule=events.Schedule.rate(core.Duration.minutes(1)),
	targets=[lambda_target_1, lambda_target_2]
)

What did you expect to happen?

Event source to be deployed to all defined targets

What actually happened?

As above, one 1 function receives the event source

Environment

  • CDK CLI Version : 1.83
  • Framework Version: 1.83
  • Node.js Version: As per aws/codebuild/standard:4.0
  • OS : As per aws/codebuild/standard:4.0
  • Language (Version): Python 3.8

Other


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
AndyEfaacommented, Mar 16, 2021

I can confirm, we do have the same issue. As a temp workaround, we created a new rule for each lambda.

0reactions
github-actions[bot]commented, Aug 15, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/aws-events-targets module - AWS Documentation
The code snippet below creates an event rule with a Lambda function as a target triggered for every events from aws.ec2 source. You...
Read more >
Triggers lambda {eventName} - awslabs/aws-cdk - Gitter
I have the rules all setup and I can setup an EventSource when it's from SQS but ... eventstargets = require('@aws-cdk/aws-events-targets'); new events....
Read more >
How to use AWS CDK to set EventBridge Rule Target for ...
I found it: the event rule takes type IFunction , and since IAlias and IVersion both extend IFunction , so we can take...
Read more >
aws-cdk.aws-events-targets - Python package - Snyk
The code snippet below creates an event rule with a Lambda function as a target triggered for every events from aws.ec2 source. You...
Read more >
@aws-cdk/aws-events - npm
Targets can include Amazon EC2 instances, AWS Lambda functions, ... A single rule can route to multiple targets, all of which are processed ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found