AWS Kinesis Stream Consumer

This page shows how to write Terraform and CloudFormation for Kinesis Stream Consumer and write them securely.

aws_kinesis_stream_consumer (Terraform)

The Stream Consumer in Kinesis can be configured in Terraform with the resource name aws_kinesis_stream_consumer. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

An example could not be found in GitHub.

Review your Terraform file for AWS best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Provides a resource to manage a Kinesis Stream Consumer. -> Note: You can register up to 20 consumers per stream. A given consumer can only be registered with one stream at a time. For more details, see the [Amazon Kinesis Stream Consumer Documentation][1].

AWS::Kinesis::StreamConsumer (CloudFormation)

The StreamConsumer in Kinesis can be configured in CloudFormation with the resource name AWS::Kinesis::StreamConsumer. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

serverless.yml#L79
      Type: AWS::Kinesis::StreamConsumer
      Properties:
        ConsumerName: ${self:service}-${self:provider.stage}-event-stream-consumer
        StreamARN: !GetAtt EventStream.Arn

    EventSourceMapping:
serverless.yml#L73
      Type: AWS::Kinesis::StreamConsumer
      Properties:
        ConsumerName: stream-consumer1
        StreamARN: !Ref KinesisStream

    # DynamoDB configuration
template.yml#L68
    Type: AWS::Kinesis::StreamConsumer
    Properties:
      StreamARN: !GetAtt KinesisStream.Arn
      ConsumerName: RegistrationNumberEventStreamConsumer

  EventBucket:
stage.simple.yml#L30
    Type: AWS::Kinesis::StreamConsumer
    Properties:
      ConsumerName: ${self:provider.stackName}-AroundTheWorldStreamConsumer
      StreamARN: ${self:custom.source.streamArn}

Outputs:
stage.hello.yml#L14
    Type: AWS::Kinesis::StreamConsumer
    Properties:
      ConsumerName: ${self:provider.stackName}-AroundTheWorldStreamConsumer
      StreamARN: ${self:custom.source.streamArn}

Outputs:
mini-cft.json#L5
        "Type": "AWS::Kinesis::StreamConsumer",
        "Properties": {
          "ConsumerName": "simplestack-service-demo-DLF-local-StreamDemoConsumer",
          "StreamARN": "\"arn:aws:kinesis:us-east-1:000000000000:stream/demo-source-stream\""
        }
    }
data_stream.json#L36
            "Type" : "AWS::Kinesis::StreamConsumer",
            "Properties" : {
                "ConsumerName" : "StreamConsumer1",
                "StreamARN" : { "Fn::GetAtt" : [ "DataStream", "Arn" ] }
            }
        },
data_stream.json#L36
            "Type" : "AWS::Kinesis::StreamConsumer",
            "Properties" : {
                "ConsumerName" : "StreamConsumer1",
                "StreamARN" : { "Fn::GetAtt" : [ "DataStream", "Arn" ] }
            }
        },
KinesisStreamConsumerSpecification.json#L3
    "AWS::Kinesis::StreamConsumer": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html",
      "Attributes": {
        "ConsumerCreationTimestamp": {
          "PrimitiveType": "String"
        },
KinesisStreamConsumerSpecification.json#L3
    "AWS::Kinesis::StreamConsumer": {
      "Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html",
      "Attributes": {
        "ConsumerCreationTimestamp": {
          "PrimitiveType": "String"
        },

Parameters

Explanation in CloudFormation Registry

Use the AWS CloudFormation AWS::Kinesis::StreamConsumer resource to register a consumer with a Kinesis data stream. The consumer you register can then call SubscribeToShard to receive data from the stream using enhanced fan-out, at a rate of up to 2 MiB per second for every shard you subscribe to. This rate is unaffected by the total number of consumers that read from the same stream. You can register up to five consumers per stream. However, you can request a limit increase using the Kinesis Data Streams limits form. A given consumer can only be registered with one stream at a time. For more information, see Using Consumers with Enhanced Fan-Out.

Frequently asked questions

What is AWS Kinesis Stream Consumer?

AWS Kinesis Stream Consumer is a resource for Kinesis of Amazon Web Service. Settings can be wrote in Terraform and CloudFormation.

Where can I find the example code for the AWS Kinesis Stream Consumer?

For CloudFormation, the broswen/StatsStream, pburkindine/localstack-debug and simon-cutts/mark-event-stream source code examples are useful. See the CloudFormation Example section for further details.