Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
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 completely 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. 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 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.
- putRule :: Text -> PutRule
- data PutRule
- prEventPattern :: Lens' PutRule (Maybe Text)
- prState :: Lens' PutRule (Maybe RuleState)
- prScheduleExpression :: Lens' PutRule (Maybe Text)
- prDescription :: Lens' PutRule (Maybe Text)
- prRoleARN :: Lens' PutRule (Maybe Text)
- prName :: Lens' PutRule Text
- putRuleResponse :: Int -> PutRuleResponse
- data PutRuleResponse
- prrsRuleARN :: Lens' PutRuleResponse (Maybe Text)
- prrsResponseStatus :: Lens' PutRuleResponse Int
Creating a Request
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:
prEventPattern
- The event pattern. For more information, see Events and Event Patterns in the Amazon CloudWatch Events User Guide .prState
- Indicates whether the rule is enabled or disabled.prScheduleExpression
- The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)".prDescription
- A description of the rule.prRoleARN
- The Amazon Resource Name (ARN) of the IAM role associated with the rule.prName
- The name of the rule that you are creating or updating.
See: putRule
smart constructor.
Request Lenses
prEventPattern :: Lens' PutRule (Maybe Text) Source #
The event pattern. For more information, see Events and Event Patterns in the Amazon CloudWatch Events User Guide .
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 * * ? *)" or "rate(5 minutes)".
prRoleARN :: Lens' PutRule (Maybe Text) Source #
The Amazon Resource Name (ARN) of the IAM role associated with the rule.
Destructuring the Response
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:
prrsRuleARN
- The Amazon Resource Name (ARN) of the rule.prrsResponseStatus
- -- | The response status code.
data PutRuleResponse Source #
See: putRuleResponse
smart constructor.
Response Lenses
prrsRuleARN :: Lens' PutRuleResponse (Maybe Text) Source #
The Amazon Resource Name (ARN) of the rule.
prrsResponseStatus :: Lens' PutRuleResponse Int Source #
- - | The response status code.