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

Contents

Description

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.

Synopsis

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

InternalException

_InternalException :: AsError a => Getting (First ServiceError) a ServiceError Source

This exception occurs due to unexpected causes.

ResourceNotFoundException

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

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:

pereTime :: Lens' PutEventsRequestEntry (Maybe UTCTime) Source

Timestamp of event, per RFC3339. If no timestamp is provided, the timestamp of the PutEvents call will be used.

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

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

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

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

data Rule Source

Contains information about a rule in Amazon CloudWatch Events. A ListRulesResult contains a list of Rules.

See: rule smart constructor.

rule :: Rule Source

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:

rEventPattern :: Lens' Rule (Maybe Text) Source

The event pattern of the rule.

rState :: Lens' Rule (Maybe RuleState) Source

The rule's state.

rARN :: Lens' Rule (Maybe Text) Source

The Amazon Resource Name (ARN) of the rule.

rScheduleExpression :: Lens' Rule (Maybe Text) Source

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

rName :: Lens' Rule (Maybe Text) Source

The rule's name.

rDescription :: Lens' Rule (Maybe Text) Source

The description of the rule.

rRoleARN :: Lens' Rule (Maybe Text) Source

The Amazon Resource Name (ARN) associated with the role that is used for target invocation.

Target

data Target Source

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.

target Source

Arguments

:: Text

tId

-> Text

tARN

-> Target 

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.

tInputPath :: Lens' Target (Maybe Text) Source

The value of the JSONPath that is used for extracting part of the matched event when passing it to the target. For more information about JSON paths, see JSONPath.

tId :: Lens' Target Text Source

The unique target assignment ID.

tARN :: Lens' Target Text Source

The Amazon Resource Name (ARN) associated of the target.