Tony
Tony

Reputation: 88

Create an EventBridge rule that targets a lambda function defined in a separate stack using AWS CDK

I have 3 separate stacks (all in the same account and region)

  1. The he AuthStack authenticates and sends a new user event object to the EventsBusStack via a lambda postConfirmation trigger lambda function.
  2. The EventBusStack receives the newUser object via the postConfirmation lambda.
  3. However, using the CDK I can't seem to figure out a way to target the lambda function located in the third stack, the RewardsStack. The CDK seems to not provide a way to target the lambda function via its arn.

How to create a rule that targets a lambda function located in a different stack using the CDK?

Upvotes: 1

Views: 707

Answers (1)

Jason Wadsworth
Jason Wadsworth

Reputation: 8887

You just need to use Function.fromFunctionArn to use the ARN.

Upvotes: 3

Related Questions