Method: Xronor::AWS::CloudWatchEvents#deregister_job

Defined in:
lib/xronor/aws/cloud_watch_events.rb

#deregister_job(job_name) ⇒ Object



8
9
10
11
12
# File 'lib/xronor/aws/cloud_watch_events.rb', line 8

def deregister_job(job_name)
  targets = @client.list_targets_by_rule(rule: job_name).targets
  @client.remove_targets(rule: job_name, ids: targets.map(&:id))
  @client.delete_rule(name: job_name)
end