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.PutTargets

Contents

Description

Adds target(s) to a rule. 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. Updates the target(s) if they are already associated with the role. In other words, if there is already a target with the given target ID, then the target associated with that ID is updated.

In order to be able to make API calls against the resources you own, Amazon CloudWatch Events needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, CloudWatch Events relies on resource-based policies. For Amazon Kinesis streams, CloudWatch Events relies on IAM roles. For more information, see Permissions for Sending Events to Targets in the Amazon CloudWatch Developer Guide.

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.

Note: When you add targets to a rule, when the associated rule triggers, new or updated targets might not be immediately invoked. Please allow a short period of time for changes to take effect.

Synopsis

Creating a Request

putTargets Source

Arguments

:: Text

ptRule

-> PutTargets 

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

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

Request Lenses

ptRule :: Lens' PutTargets Text Source

The name of the rule you want to add targets to.

ptTargets :: Lens' PutTargets [Target] Source

List of targets you want to update or add to the rule.

Destructuring the Response

putTargetsResponse Source

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

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

Response Lenses

ptrsFailedEntryCount :: Lens' PutTargetsResponse (Maybe Int) Source

The number of failed entries.