remove_targets
¶
remove_targets(
rule: RuleName,
ids: TargetIdList,
*,
config_overrides: Optional[CloudWatchEventsClientConfig] = None,
event_bus_name: Optional[EventBusNameOrArn] = None,
force: Optional[Boolean] = None,
) -> RemoveTargetsResponse
Removes the specified targets from the specified rule. When the rule is triggered, those targets are no longer be invoked.
When you remove a target, when the associated rule triggers, removed targets might continue to be invoked. Allow a short period of time for changes to take effect.
This action can partially fail if too many requests are made at the same time. If that happens, FailedEntryCount is non-zero in the response and each entry in FailedEntries provides the ID of the failed target and the error code.
Parameters:
-
rule(RuleName) –The name of the rule.
-
event_bus_name(Optional[EventBusNameOrArn], default:None) –The name or ARN of the event bus associated with the rule. If you omit this, the default event bus is used.
-
ids(TargetIdList) –The IDs of the targets to remove from the rule.
-
force(Optional[Boolean], default:None) –If this is a managed rule, created by an Amazon Web Services service on your behalf, you must specify
ForceasTrueto remove targets. This parameter is ignored for rules that are not managed rules. You can check whether a rule is a managed rule by usingDescribeRuleorListRulesand checking theManagedByfield of the response.
Raises:
-
ConcurrentModificationException–There is concurrent modification on a rule, target, archive, or replay.
-
InternalException–This exception occurs due to unexpected causes.
-
ManagedRuleException–This rule was created by an Amazon Web Services service on behalf of your account. It is managed by that service. If you see this error in response to
DeleteRuleorRemoveTargets, you can use theForceparameter in those calls to delete the rule or remove targets from the rule. You cannot modify these managed rules by usingDisableRule,EnableRule,PutTargets,PutRule,TagResource, orUntagResource. -
ResourceNotFoundException–An entity that you specified does not exist.
-
UnknownServiceError–The service returned an error code this client does not model.