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 |
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.
- putTargets :: Text -> PutTargets
- data PutTargets
- ptRule :: Lens' PutTargets Text
- ptTargets :: Lens' PutTargets [Target]
- putTargetsResponse :: Int -> PutTargetsResponse
- data PutTargetsResponse
- ptrsFailedEntryCount :: Lens' PutTargetsResponse (Maybe Int)
- ptrsFailedEntries :: Lens' PutTargetsResponse [PutTargetsResultEntry]
- ptrsResponseStatus :: Lens' PutTargetsResponse Int
Creating a Request
:: Text | |
-> 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:
data PutTargets Source
Container for the parameters to the PutTargets operation.
See: putTargets
smart constructor.
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
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:
data PutTargetsResponse Source
The result of the PutTargets operation.
See: putTargetsResponse
smart constructor.
Response Lenses
ptrsFailedEntryCount :: Lens' PutTargetsResponse (Maybe Int) Source
The number of failed entries.
ptrsFailedEntries :: Lens' PutTargetsResponse [PutTargetsResultEntry] Source
An array of failed target entries.
ptrsResponseStatus :: Lens' PutTargetsResponse Int Source
The response status code.