amazonka-cloudwatch-events-1.4.2: 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:

data PutTargets Source #

Container for the parameters to the PutTargets operation.

See: putTargets smart constructor.

Instances

Eq PutTargets Source # 
Data PutTargets Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutTargets -> c PutTargets #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutTargets #

toConstr :: PutTargets -> Constr #

dataTypeOf :: PutTargets -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutTargets) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutTargets) #

gmapT :: (forall b. Data b => b -> b) -> PutTargets -> PutTargets #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutTargets -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutTargets -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutTargets -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutTargets -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutTargets -> m PutTargets #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutTargets -> m PutTargets #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutTargets -> m PutTargets #

Read PutTargets Source # 
Show PutTargets Source # 
Generic PutTargets Source # 

Associated Types

type Rep PutTargets :: * -> * #

ToJSON PutTargets Source # 
Hashable PutTargets Source # 
NFData PutTargets Source # 

Methods

rnf :: PutTargets -> () #

AWSRequest PutTargets Source # 
ToPath PutTargets Source # 
ToHeaders PutTargets Source # 

Methods

toHeaders :: PutTargets -> [Header] #

ToQuery PutTargets Source # 
type Rep PutTargets Source # 
type Rep PutTargets = D1 (MetaData "PutTargets" "Network.AWS.CloudWatchEvents.PutTargets" "amazonka-cloudwatch-events-1.4.2-KmLaaEmFLtVEb3hPLY8Pk4" False) (C1 (MetaCons "PutTargets'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ptRule") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Text)) (S1 (MetaSel (Just Symbol "_ptTargets") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Target]))))
type Rs PutTargets Source # 

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:

data PutTargetsResponse Source #

The result of the PutTargets operation.

See: putTargetsResponse smart constructor.

Instances

Eq PutTargetsResponse Source # 
Data PutTargetsResponse Source # 

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PutTargetsResponse -> c PutTargetsResponse #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PutTargetsResponse #

toConstr :: PutTargetsResponse -> Constr #

dataTypeOf :: PutTargetsResponse -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c PutTargetsResponse) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PutTargetsResponse) #

gmapT :: (forall b. Data b => b -> b) -> PutTargetsResponse -> PutTargetsResponse #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PutTargetsResponse -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PutTargetsResponse -> r #

gmapQ :: (forall d. Data d => d -> u) -> PutTargetsResponse -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> PutTargetsResponse -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> PutTargetsResponse -> m PutTargetsResponse #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PutTargetsResponse -> m PutTargetsResponse #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PutTargetsResponse -> m PutTargetsResponse #

Read PutTargetsResponse Source # 
Show PutTargetsResponse Source # 
Generic PutTargetsResponse Source # 
NFData PutTargetsResponse Source # 

Methods

rnf :: PutTargetsResponse -> () #

type Rep PutTargetsResponse Source # 
type Rep PutTargetsResponse = D1 (MetaData "PutTargetsResponse" "Network.AWS.CloudWatchEvents.PutTargets" "amazonka-cloudwatch-events-1.4.2-KmLaaEmFLtVEb3hPLY8Pk4" False) (C1 (MetaCons "PutTargetsResponse'" PrefixI True) ((:*:) (S1 (MetaSel (Just Symbol "_ptrsFailedEntryCount") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe Int))) ((:*:) (S1 (MetaSel (Just Symbol "_ptrsFailedEntries") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 (Maybe [PutTargetsResultEntry]))) (S1 (MetaSel (Just Symbol "_ptrsResponseStatus") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int)))))

Response Lenses

ptrsFailedEntryCount :: Lens' PutTargetsResponse (Maybe Int) Source #

The number of failed entries.