amazonka-cloudwatch-events-1.4.0: Amazon CloudWatch Events SDK.

Copyright(c) 2013-2016 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Network.AWS.CloudWatchEvents.PutRule

Contents

Description

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

Note: When you create or update a rule, incoming events might not immediately start matching to new or updated rules. Please 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 will trigger on matching events as well as on a schedule.

Note: 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.

Synopsis

Creating a Request

putRule Source

Arguments

:: Text

prName

-> PutRule 

Creates a value of PutRule with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

Request Lenses

prEventPattern :: Lens' PutRule (Maybe Text) Source

The event pattern.

prState :: Lens' PutRule (Maybe RuleState) Source

Indicates whether the rule is enabled or disabled.

prScheduleExpression :: Lens' PutRule (Maybe Text) Source

The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".

prDescription :: Lens' PutRule (Maybe Text) Source

A description of the rule.

prRoleARN :: Lens' PutRule (Maybe Text) Source

The Amazon Resource Name (ARN) of the IAM role associated with the rule.

prName :: Lens' PutRule Text Source

The name of the rule that you are creating or updating.

Destructuring the Response

putRuleResponse Source

Creates a value of PutRuleResponse with the minimum fields required to make a request.

Use one of the following lenses to modify other fields as desired:

Response Lenses

prrsRuleARN :: Lens' PutRuleResponse (Maybe Text) Source

The Amazon Resource Name (ARN) that identifies the rule.

prrsResponseStatus :: Lens' PutRuleResponse Int Source

The response status code.