An error occurred (ValidationException) when calling the DeleteRule operation: Rule can't be deleted since it has targets

Viewed 4916

I got this issue when deleting event on aws cloudwatch

An error occurred (ValidationException) when calling the DeleteRule operation: Rule can't be deleted since it has targets.

My command line is :

aws events delete-rule --name event-schedule --force
1 Answers

I got the solution, we should remove target first:

aws events remove-targets --rule event-schedule --ids dev-transaction

then delete-rule:

aws events delete-rule --name event-schedule 
Related