PutRule

Creates or updates the specified rule. Rules are enabled by default, or based on value
of the state.
You can disable a rule using DisableRule.

If you are updating an existing rule, the rule is replaced with what you specify in
this PutRule command. If you omit arguments in PutRule, the
old values for those arguments are not kept. Instead, they are replaced with null
values.

When you create or update a rule, incoming events might not immediately start
matching to new or updated rules. Allow a short period of time for changes to take
effect.

A rule must contain at least an EventPattern or ScheduleExpression. Rules with EventPatterns
are triggered when a matching event is observed. Rules with ScheduleExpressions self-trigger
based on the given schedule. A rule can have both an EventPattern and a ScheduleExpression,
in which case the rule triggers on matching events as well as on a schedule.

Most services in AWS treat : or / as the same character in Amazon Resource Names (ARNs).
However, CloudWatch Events uses an exact match in event patterns and rules. Be sure
to use the
correct ARN characters when creating event patterns so that they match the ARN
syntax in the event you want to match.

In CloudWatch Events, it is possible to create rules that lead to infinite loops,
where a rule
is fired repeatedly. For example, a rule might detect that ACLs have changed on an
S3 bucket, and
trigger software to change them to the desired state. If the rule is not written carefully,
the subsequent
change to the ACLs fires the rule again, creating an infinite loop.

To prevent this, write the rules so that the triggered actions do not re-fire the
same rule.
For example, your rule could fire only if ACLs are found to be in a bad state, instead
of after any change.

An infinite loop can quickly cause higher than expected charges. We recommend that
you use budgeting,
which alerts you when charges exceed your specified limit. For more information, see
Managing Your Costs with Budgets.