Copyright | (c) 2013-2018 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Identifies a stream as an event source for a Lambda function. It can be either an Amazon Kinesis stream or an Amazon DynamoDB stream. AWS Lambda invokes the specified function when records are posted to the stream.
This association between a stream source and a Lambda function is called the event source mapping.
You provide mapping information (for example, which stream to read from and which Lambda function to invoke) in the request body.
Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be associated with multiple AWS Lambda functions. A given Lambda function can be associated with multiple AWS event sources.
If you are using versioning, you can specify a specific function version or an alias via the function name parameter. For more information about versioning, see AWS Lambda Function Versioning and Aliases .
This operation requires permission for the lambda:CreateEventSourceMapping
action.
- createEventSourceMapping :: Text -> Text -> EventSourcePosition -> CreateEventSourceMapping
- data CreateEventSourceMapping
- cesmStartingPositionTimestamp :: Lens' CreateEventSourceMapping (Maybe UTCTime)
- cesmEnabled :: Lens' CreateEventSourceMapping (Maybe Bool)
- cesmBatchSize :: Lens' CreateEventSourceMapping (Maybe Natural)
- cesmEventSourceARN :: Lens' CreateEventSourceMapping Text
- cesmFunctionName :: Lens' CreateEventSourceMapping Text
- cesmStartingPosition :: Lens' CreateEventSourceMapping EventSourcePosition
- eventSourceMappingConfiguration :: EventSourceMappingConfiguration
- data EventSourceMappingConfiguration
- esmcEventSourceARN :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcState :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcFunctionARN :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcUUId :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcLastProcessingResult :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcBatchSize :: Lens' EventSourceMappingConfiguration (Maybe Natural)
- esmcStateTransitionReason :: Lens' EventSourceMappingConfiguration (Maybe Text)
- esmcLastModified :: Lens' EventSourceMappingConfiguration (Maybe UTCTime)
Creating a Request
createEventSourceMapping Source #
Creates a value of CreateEventSourceMapping
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
cesmStartingPositionTimestamp
- The timestamp of the data record from which to start reading. Used with shard iterator type AT_TIMESTAMP. If a record with this exact timestamp does not exist, the iterator returned is for the next (later) record. If the timestamp is older than the current trim horizon, the iterator returned is for the oldest untrimmed data record (TRIM_HORIZON). Valid only for Kinesis streams .cesmEnabled
- Indicates whether AWS Lambda should begin polling the event source. By default,Enabled
is true.cesmBatchSize
- The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. Your function receives an event with all the retrieved records. The default is 100 records.cesmEventSourceARN
- The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB stream that is the event source. Any record added to this stream could cause AWS Lambda to invoke your Lambda function, it depends on theBatchSize
. AWS Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda function as JSON.cesmFunctionName
- The Lambda function to invoke when AWS Lambda detects an event on the stream. You can specify the function name (for example,Thumbnail
) or you can specify Amazon Resource Name (ARN) of the function (for example,arn:aws:lambda:us-west-2:account-id:function:ThumbNail
). If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases AWS Lambda also allows you to specify only the function name with the account ID qualifier (for example,account-id:Thumbnail
). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 characters in length.cesmStartingPosition
- The position in the DynamoDB or Kinesis stream where AWS Lambda should start reading. For more information, see GetShardIterator in the Amazon Kinesis API Reference Guide or GetShardIterator in the Amazon DynamoDB API Reference Guide . TheAT_TIMESTAMP
value is supported only for Kinesis streams .
data CreateEventSourceMapping Source #
See: createEventSourceMapping
smart constructor.
Request Lenses
cesmStartingPositionTimestamp :: Lens' CreateEventSourceMapping (Maybe UTCTime) Source #
The timestamp of the data record from which to start reading. Used with shard iterator type AT_TIMESTAMP. If a record with this exact timestamp does not exist, the iterator returned is for the next (later) record. If the timestamp is older than the current trim horizon, the iterator returned is for the oldest untrimmed data record (TRIM_HORIZON). Valid only for Kinesis streams .
cesmEnabled :: Lens' CreateEventSourceMapping (Maybe Bool) Source #
Indicates whether AWS Lambda should begin polling the event source. By default, Enabled
is true.
cesmBatchSize :: Lens' CreateEventSourceMapping (Maybe Natural) Source #
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. Your function receives an event with all the retrieved records. The default is 100 records.
cesmEventSourceARN :: Lens' CreateEventSourceMapping Text Source #
The Amazon Resource Name (ARN) of the Amazon Kinesis or the Amazon DynamoDB stream that is the event source. Any record added to this stream could cause AWS Lambda to invoke your Lambda function, it depends on the BatchSize
. AWS Lambda POSTs the Amazon Kinesis event, containing records, to your Lambda function as JSON.
cesmFunctionName :: Lens' CreateEventSourceMapping Text Source #
The Lambda function to invoke when AWS Lambda detects an event on the stream. You can specify the function name (for example, Thumbnail
) or you can specify Amazon Resource Name (ARN) of the function (for example, arn:aws:lambda:us-west-2:account-id:function:ThumbNail
). If you are using versioning, you can also provide a qualified function ARN (ARN that is qualified with function version or alias name as suffix). For more information about versioning, see AWS Lambda Function Versioning and Aliases AWS Lambda also allows you to specify only the function name with the account ID qualifier (for example, account-id:Thumbnail
). Note that the length constraint applies only to the ARN. If you specify only the function name, it is limited to 64 characters in length.
cesmStartingPosition :: Lens' CreateEventSourceMapping EventSourcePosition Source #
The position in the DynamoDB or Kinesis stream where AWS Lambda should start reading. For more information, see GetShardIterator in the Amazon Kinesis API Reference Guide or GetShardIterator in the Amazon DynamoDB API Reference Guide . The AT_TIMESTAMP
value is supported only for Kinesis streams .
Destructuring the Response
eventSourceMappingConfiguration :: EventSourceMappingConfiguration Source #
Creates a value of EventSourceMappingConfiguration
with the minimum fields required to make a request.
Use one of the following lenses to modify other fields as desired:
esmcEventSourceARN
- The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source of events.esmcState
- The state of the event source mapping. It can beCreating
,Enabled
,Disabled
,Enabling
,Disabling
,Updating
, orDeleting
.esmcFunctionARN
- The Lambda function to invoke when AWS Lambda detects an event on the stream.esmcUUId
- The AWS Lambda assigned opaque identifier for the mapping.esmcLastProcessingResult
- The result of the last AWS Lambda invocation of your Lambda function.esmcBatchSize
- The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. Your function receives an event with all the retrieved records.esmcStateTransitionReason
- The reason the event source mapping is in its current state. It is either user-requested or an AWS Lambda-initiated state transition.esmcLastModified
- The UTC time string indicating the last time the event mapping was updated.
data EventSourceMappingConfiguration Source #
Describes mapping between an Amazon Kinesis stream and a Lambda function.
See: eventSourceMappingConfiguration
smart constructor.
Response Lenses
esmcEventSourceARN :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source of events.
esmcState :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The state of the event source mapping. It can be Creating
, Enabled
, Disabled
, Enabling
, Disabling
, Updating
, or Deleting
.
esmcFunctionARN :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The Lambda function to invoke when AWS Lambda detects an event on the stream.
esmcUUId :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The AWS Lambda assigned opaque identifier for the mapping.
esmcLastProcessingResult :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The result of the last AWS Lambda invocation of your Lambda function.
esmcBatchSize :: Lens' EventSourceMappingConfiguration (Maybe Natural) Source #
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. Your function receives an event with all the retrieved records.
esmcStateTransitionReason :: Lens' EventSourceMappingConfiguration (Maybe Text) Source #
The reason the event source mapping is in its current state. It is either user-requested or an AWS Lambda-initiated state transition.
esmcLastModified :: Lens' EventSourceMappingConfiguration (Maybe UTCTime) Source #
The UTC time string indicating the last time the event mapping was updated.