简体   繁体   English

带有 Kinesis 事件使用者的 AWS CloudFormation 模板

[英]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.我正在尝试创建一个 Lambda,当 Kinesis Stream 中有记录时调用它。 For this, in the template.yaml for the lambda, I have added a Kinesis Consumer in the following way -为此,在 lambda 的 template.yaml 中,我通过以下方式添加了 Kinesis Consumer -

  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 -当我使用 SAM CLI 部署此模板时,我看到错误提示 -

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.批处理窗口、错误处理和并发设置不适用于 HTTP/2 流使用者。

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. 将 AWS Lambda 与 Amazon Kinesis结合使用 HTTP/1 而非 HTTP/2 将支持您尝试执行的操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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