简体   繁体   中英

AWS CloudFormation template with Kinesis Event Consumer

I am trying to create a Lambda which is invoked when there are records in a Kinesis Stream. For this, in the template.yaml for the lambda, I have added a Kinesis Consumer in the following way -

  EventStreamConsumer:
    Type: AWS::Kinesis::StreamConsumer
    Properties:
      StreamARN: !Sub arn:aws:kinesis:${AWS::Region}:${AWS::AccountId}:stream/${EventsKinesisStream}
      ConsumerName: !Ref KinesisConsumerName

  EventSourceMapping:
    Type: 'AWS::Lambda::EventSourceMapping'
    Properties:
      BatchSize: 100
      MaximumBatchingWindowInSeconds: 15
      Enabled: true
      EventSourceArn: !Ref EventStreamConsumer
      FunctionName: !GetAtt Function.Arn
      StartingPosition: LATEST

When I deploy this template using the SAM CLI, I see errors saying -

Unsupported MaximumBatchingWindowInSecond parameter for given event source mapping type. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: xxxxxxxxxx)

Observe the Error message for the parameter name.

Can someone explain why this is occurring and how this can be mitigated?

Batch window, error handling, and concurrency settings are not available for HTTP/2 stream consumers.

To understand completely you can refer the link below. Using AWS Lambda with Amazon Kinesis What you are trying to do will be supported with HTTP/1 not with HTTP/2.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM