Copyright | (c) 2013-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Amazon CloudWatch Events helps you to respond to state changes in your AWS resources. When your resources change state they automatically send events into an event stream. You can create rules that match selected events in the stream and route them to targets to take action. You can also use rules to take action on a pre-determined schedule. For example, you can configure rules to:
- Automatically invoke an AWS Lambda function to update DNS entries when an event notifies you that Amazon EC2 instance enters the running state.
- Direct specific API records from CloudTrail to an Amazon Kinesis stream for detailed analysis of potential security or availability risks.
- Periodically invoke a built-in target to create a snapshot of an Amazon EBS volume.
For more information about Amazon CloudWatch Events features, see the Amazon CloudWatch Developer Guide.
- cloudWatchEvents :: Service
- _ConcurrentModificationException :: AsError a => Getting (First ServiceError) a ServiceError
- _InvalidEventPatternException :: AsError a => Getting (First ServiceError) a ServiceError
- _InternalException :: AsError a => Getting (First ServiceError) a ServiceError
- _ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError
- _LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError
- module Network.AWS.CloudWatchEvents.RemoveTargets
- module Network.AWS.CloudWatchEvents.DeleteRule
- module Network.AWS.CloudWatchEvents.ListRules
- module Network.AWS.CloudWatchEvents.PutRule
- module Network.AWS.CloudWatchEvents.DisableRule
- module Network.AWS.CloudWatchEvents.ListTargetsByRule
- module Network.AWS.CloudWatchEvents.DescribeRule
- module Network.AWS.CloudWatchEvents.EnableRule
- module Network.AWS.CloudWatchEvents.ListRuleNamesByTarget
- module Network.AWS.CloudWatchEvents.TestEventPattern
- module Network.AWS.CloudWatchEvents.PutTargets
- module Network.AWS.CloudWatchEvents.PutEvents
- data RuleState
- data PutEventsRequestEntry
- putEventsRequestEntry :: PutEventsRequestEntry
- pereTime :: Lens' PutEventsRequestEntry (Maybe UTCTime)
- pereDetailType :: Lens' PutEventsRequestEntry (Maybe Text)
- pereResources :: Lens' PutEventsRequestEntry [Text]
- pereSource :: Lens' PutEventsRequestEntry (Maybe Text)
- pereDetail :: Lens' PutEventsRequestEntry (Maybe Text)
- data PutEventsResultEntry
- putEventsResultEntry :: PutEventsResultEntry
- pereErrorCode :: Lens' PutEventsResultEntry (Maybe Text)
- pereErrorMessage :: Lens' PutEventsResultEntry (Maybe Text)
- pereEventId :: Lens' PutEventsResultEntry (Maybe Text)
- data PutTargetsResultEntry
- putTargetsResultEntry :: PutTargetsResultEntry
- ptreTargetId :: Lens' PutTargetsResultEntry (Maybe Text)
- ptreErrorCode :: Lens' PutTargetsResultEntry (Maybe Text)
- ptreErrorMessage :: Lens' PutTargetsResultEntry (Maybe Text)
- data RemoveTargetsResultEntry
- removeTargetsResultEntry :: RemoveTargetsResultEntry
- rtreTargetId :: Lens' RemoveTargetsResultEntry (Maybe Text)
- rtreErrorCode :: Lens' RemoveTargetsResultEntry (Maybe Text)
- rtreErrorMessage :: Lens' RemoveTargetsResultEntry (Maybe Text)
- data Rule
- rule :: Rule
- rEventPattern :: Lens' Rule (Maybe Text)
- rState :: Lens' Rule (Maybe RuleState)
- rARN :: Lens' Rule (Maybe Text)
- rScheduleExpression :: Lens' Rule (Maybe Text)
- rName :: Lens' Rule (Maybe Text)
- rDescription :: Lens' Rule (Maybe Text)
- rRoleARN :: Lens' Rule (Maybe Text)
- data Target
- target :: Text -> Text -> Target
- tInput :: Lens' Target (Maybe Text)
- tInputPath :: Lens' Target (Maybe Text)
- tId :: Lens' Target Text
- tARN :: Lens' Target Text
Service Configuration
cloudWatchEvents :: Service Source
API version '2015-10-07' of the Amazon CloudWatch Events SDK configuration.
Errors
Error matchers are designed for use with the functions provided by
Control.Exception.Lens.
This allows catching (and rethrowing) service specific errors returned
by CloudWatchEvents
.
ConcurrentModificationException
_ConcurrentModificationException :: AsError a => Getting (First ServiceError) a ServiceError Source
This exception occurs if there is concurrent modification on rule or target.
InvalidEventPatternException
_InvalidEventPatternException :: AsError a => Getting (First ServiceError) a ServiceError Source
The event pattern is invalid.
InternalException
_InternalException :: AsError a => Getting (First ServiceError) a ServiceError Source
This exception occurs due to unexpected causes.
ResourceNotFoundException
_ResourceNotFoundException :: AsError a => Getting (First ServiceError) a ServiceError Source
The rule does not exist.
LimitExceededException
_LimitExceededException :: AsError a => Getting (First ServiceError) a ServiceError Source
This exception occurs if you try to create more rules or add more targets to a rule than allowed by default.
Waiters
Waiters poll by repeatedly sending a request until some remote success condition
configured by the Wait
specification is fulfilled. The Wait
specification
determines how many attempts should be made, in addition to delay and retry strategies.
Operations
Some AWS operations return results that are incomplete and require subsequent
requests in order to obtain the entire result set. The process of sending
subsequent requests to continue where a previous request left off is called
pagination. For example, the ListObjects
operation of Amazon S3 returns up to
1000 objects at a time, and you must send subsequent requests with the
appropriate Marker in order to retrieve the next page of results.
Operations that have an AWSPager
instance can transparently perform subsequent
requests, correctly setting Markers and other request facets to iterate through
the entire result set of a truncated API operation. Operations which support
this have an additional note in the documentation.
Many operations have the ability to filter results on the server side. See the individual operation parameters for details.
RemoveTargets
DeleteRule
ListRules
PutRule
DisableRule
ListTargetsByRule
DescribeRule
EnableRule
ListRuleNamesByTarget
TestEventPattern
PutTargets
PutEvents
Types
RuleState
PutEventsRequestEntry
data PutEventsRequestEntry Source
Contains information about the event to be used in PutEvents.
See: putEventsRequestEntry
smart constructor.
putEventsRequestEntry :: PutEventsRequestEntry Source
Creates a value of PutEventsRequestEntry
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
pereDetailType :: Lens' PutEventsRequestEntry (Maybe Text) Source
Free-form string used to decide what fields to expect in the event detail.
pereResources :: Lens' PutEventsRequestEntry [Text] Source
AWS resources, identified by Amazon Resource Name (ARN), which the event primarily concerns. Any number, including zero, may be present.
pereSource :: Lens' PutEventsRequestEntry (Maybe Text) Source
The source of the event.
pereDetail :: Lens' PutEventsRequestEntry (Maybe Text) Source
In the JSON sense, an object containing fields, which may also contain nested sub-objects. No constraints are imposed on its contents.
PutEventsResultEntry
data PutEventsResultEntry Source
A PutEventsResult contains a list of PutEventsResultEntry.
See: putEventsResultEntry
smart constructor.
putEventsResultEntry :: PutEventsResultEntry Source
Creates a value of PutEventsResultEntry
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
pereErrorCode :: Lens' PutEventsResultEntry (Maybe Text) Source
The error code representing why the event submission failed on this entry.
pereErrorMessage :: Lens' PutEventsResultEntry (Maybe Text) Source
The error message explaining why the event submission failed on this entry.
pereEventId :: Lens' PutEventsResultEntry (Maybe Text) Source
The ID of the event submitted to Amazon CloudWatch Events.
PutTargetsResultEntry
data PutTargetsResultEntry Source
A PutTargetsResult contains a list of PutTargetsResultEntry.
See: putTargetsResultEntry
smart constructor.
putTargetsResultEntry :: PutTargetsResultEntry Source
Creates a value of PutTargetsResultEntry
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
ptreTargetId :: Lens' PutTargetsResultEntry (Maybe Text) Source
The ID of the target submitted to Amazon CloudWatch Events.
ptreErrorCode :: Lens' PutTargetsResultEntry (Maybe Text) Source
The error code representing why the target submission failed on this entry.
ptreErrorMessage :: Lens' PutTargetsResultEntry (Maybe Text) Source
The error message explaining why the target submission failed on this entry.
RemoveTargetsResultEntry
data RemoveTargetsResultEntry Source
The ID of the target requested to be removed from the rule by Amazon CloudWatch Events.
See: removeTargetsResultEntry
smart constructor.
removeTargetsResultEntry :: RemoveTargetsResultEntry Source
Creates a value of RemoveTargetsResultEntry
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
rtreTargetId :: Lens' RemoveTargetsResultEntry (Maybe Text) Source
The ID of the target requested to be removed by Amazon CloudWatch Events.
rtreErrorCode :: Lens' RemoveTargetsResultEntry (Maybe Text) Source
The error code representing why the target removal failed on this entry.
rtreErrorMessage :: Lens' RemoveTargetsResultEntry (Maybe Text) Source
The error message explaining why the target removal failed on this entry.
Rule
Contains information about a rule in Amazon CloudWatch Events. A ListRulesResult contains a list of Rules.
See: rule
smart constructor.
Creates a value of Rule
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
rScheduleExpression :: Lens' Rule (Maybe Text) Source
The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)".
rRoleARN :: Lens' Rule (Maybe Text) Source
The Amazon Resource Name (ARN) associated with the role that is used for target invocation.
Target
Targets are the resources that can be invoked when a rule is triggered. For example, AWS Lambda functions, Amazon Kinesis streams, and built-in targets.
Input and InputPath are mutually-exclusive and optional parameters of a target. When a rule is triggered due to a matched event, if for a target:
- Neither Input nor InputPath is specified, then the entire event is passed to the target in JSON form.
- InputPath is specified in the form of JSONPath (e.g. $.detail), then only the part of the event specified in the path is passed to the target (e.g. only the detail part of the event is passed).
- Input is specified in the form of a valid JSON, then the matched event is overridden with this constant.
See: target
smart constructor.
Creates a value of Target
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
tInput :: Lens' Target (Maybe Text) Source
Valid JSON text passed to the target. For more information about JSON text, see The JavaScript Object Notation (JSON) Data Interchange Format.