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 is the pull model, where AWS Lambda invokes the function. For more information, go to AWS Lambda: How it Works in the AWS Lambda Developer Guide.
This association between an Amazon Kinesis stream and a Lambda function is called the event source mapping. You provide the configuration information (for example, which stream to read from and which Lambda function to invoke) for the event source mapping in the request body.
Each event source, such as an Amazon Kinesis or a DynamoDB stream, can be associated with multiple AWS Lambda function. A given Lambda function can be associated with multiple AWS event sources.
This operation requires permission for the 'lambda:CreateEventSourceMapping' action.
http://docs.aws.amazon.com/lambda/latest/dg/API_CreateEventSourceMapping.html
- data CreateEventSourceMapping
- createEventSourceMapping :: Text -> Text -> EventSourcePosition -> CreateEventSourceMapping
- cesmBatchSize :: Lens' CreateEventSourceMapping (Maybe Natural)
- cesmEnabled :: Lens' CreateEventSourceMapping (Maybe Bool)
- cesmEventSourceArn :: Lens' CreateEventSourceMapping Text
- cesmFunctionName :: Lens' CreateEventSourceMapping Text
- cesmStartingPosition :: Lens' CreateEventSourceMapping EventSourcePosition
- data CreateEventSourceMappingResponse
- createEventSourceMappingResponse :: CreateEventSourceMappingResponse
- cesmrBatchSize :: Lens' CreateEventSourceMappingResponse (Maybe Natural)
- cesmrEventSourceArn :: Lens' CreateEventSourceMappingResponse (Maybe Text)
- cesmrFunctionArn :: Lens' CreateEventSourceMappingResponse (Maybe Text)
- cesmrLastModified :: Lens' CreateEventSourceMappingResponse (Maybe UTCTime)
- cesmrLastProcessingResult :: Lens' CreateEventSourceMappingResponse (Maybe Text)
- cesmrState :: Lens' CreateEventSourceMappingResponse (Maybe Text)
- cesmrStateTransitionReason :: Lens' CreateEventSourceMappingResponse (Maybe Text)
- cesmrUUID :: Lens' CreateEventSourceMappingResponse (Maybe Text)
Request
data CreateEventSourceMapping Source
Request constructor
createEventSourceMapping Source
CreateEventSourceMapping
constructor.
The fields accessible through corresponding lenses are:
Request lenses
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.
cesmEnabled :: Lens' CreateEventSourceMapping (Maybe Bool) Source
Indicates whether AWS Lambda should begin polling the event source.
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 an unqualified 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"). AWS Lambda also allows you to specify only 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 character in length.
cesmStartingPosition :: Lens' CreateEventSourceMapping EventSourcePosition Source
The position in the stream where AWS Lambda should start reading. For more information, go to ShardIteratorType in the Amazon Kinesis API Reference.
Response
Response constructor
createEventSourceMappingResponse :: CreateEventSourceMappingResponse Source
CreateEventSourceMappingResponse
constructor.
The fields accessible through corresponding lenses are:
Response lenses
cesmrBatchSize :: Lens' CreateEventSourceMappingResponse (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.
cesmrEventSourceArn :: Lens' CreateEventSourceMappingResponse (Maybe Text) Source
The Amazon Resource Name (ARN) of the Amazon Kinesis stream that is the source of events.
cesmrFunctionArn :: Lens' CreateEventSourceMappingResponse (Maybe Text) Source
The Lambda function to invoke when AWS Lambda detects an event on the stream.
cesmrLastModified :: Lens' CreateEventSourceMappingResponse (Maybe UTCTime) Source
The UTC time string indicating the last time the event mapping was updated.
cesmrLastProcessingResult :: Lens' CreateEventSourceMappingResponse (Maybe Text) Source
The result of the last AWS Lambda invocation of your Lambda function.
cesmrStateTransitionReason :: Lens' CreateEventSourceMappingResponse (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.