Home > Software design >  Update existing Eventbridge Rule to include a new target using CloudFormation script
Update existing Eventbridge Rule to include a new target using CloudFormation script

Time:03-02

I have two separate applications that need to update the target of an EventBridge rule. What is the best way to handle this? Should I create a separate EventBridge rule that has the same source or is there a way to update the actual EventBridge rule in both serverless applications without error?

I have tried to add the EventBridge rule in both applications but it throws an error saying that the resource already exists.

To visualize I have the following:

diagram showing the current setup

CodePudding user response:

You have to first import your existing EB rule into CloudFormation stack before you can modify it. Alternatively, you can develop a custom resource which can modify the rule without importing.

  • Related