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.
Parameters
-
arn
optional computed - string -
creation_timestamp
optional computed - string -
id
optional computed - string -
name
required - string -
stream_arn
required - string
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
Type: AWS::Kinesis::StreamConsumer
Properties:
ConsumerName: ${self:service}-${self:provider.stage}-event-stream-consumer
StreamARN: !GetAtt EventStream.Arn
EventSourceMapping:
Type: AWS::Kinesis::StreamConsumer
Properties:
ConsumerName: stream-consumer1
StreamARN: !Ref KinesisStream
# DynamoDB configuration
Type: AWS::Kinesis::StreamConsumer
Properties:
StreamARN: !GetAtt KinesisStream.Arn
ConsumerName: RegistrationNumberEventStreamConsumer
EventBucket:
Type: AWS::Kinesis::StreamConsumer
Properties:
ConsumerName: ${self:provider.stackName}-AroundTheWorldStreamConsumer
StreamARN: ${self:custom.source.streamArn}
Outputs:
Type: AWS::Kinesis::StreamConsumer
Properties:
ConsumerName: ${self:provider.stackName}-AroundTheWorldStreamConsumer
StreamARN: ${self:custom.source.streamArn}
Outputs:
"Type": "AWS::Kinesis::StreamConsumer",
"Properties": {
"ConsumerName": "simplestack-service-demo-DLF-local-StreamDemoConsumer",
"StreamARN": "\"arn:aws:kinesis:us-east-1:000000000000:stream/demo-source-stream\""
}
}
"Type" : "AWS::Kinesis::StreamConsumer",
"Properties" : {
"ConsumerName" : "StreamConsumer1",
"StreamARN" : { "Fn::GetAtt" : [ "DataStream", "Arn" ] }
}
},
"Type" : "AWS::Kinesis::StreamConsumer",
"Properties" : {
"ConsumerName" : "StreamConsumer1",
"StreamARN" : { "Fn::GetAtt" : [ "DataStream", "Arn" ] }
}
},
"AWS::Kinesis::StreamConsumer": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html",
"Attributes": {
"ConsumerCreationTimestamp": {
"PrimitiveType": "String"
},
"AWS::Kinesis::StreamConsumer": {
"Documentation": "http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-kinesis-streamconsumer.html",
"Attributes": {
"ConsumerCreationTimestamp": {
"PrimitiveType": "String"
},
Parameters
-
ConsumerName
required - String -
StreamARN
required - String
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.