Ken Harris
Ken Harris

Reputation: 113

Update existing Eventbridge Rule to include a new target using CloudFormation script

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

Upvotes: 1

Views: 1413

Answers (1)

Marcin
Marcin

Reputation: 238199

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.

Upvotes: 1

Related Questions