AWS::Kinesis::StreamConsumer
Use the Amazon 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
For more information, see Using Consumers with Enhanced Fan-Out.
Syntax
To declare this entity in your Amazon CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Kinesis::StreamConsumer", "Properties" : { "ConsumerName" :
String
, "StreamARN" :String
} }
YAML
Type: AWS::Kinesis::StreamConsumer Properties: ConsumerName:
String
StreamARN:String
Properties
ConsumerName
-
The name of the consumer is something you choose when you register the consumer.
Required: Yes
Type: String
Pattern:
[a-zA-Z0-9_.-]+
Minimum:
1
Maximum:
128
Update requires: Replacement
StreamARN
-
The ARN of the stream with which you registered the consumer.
Required: Yes
Type: String
Pattern:
arn:aws.*:kinesis:.*:\d{12}:stream/\S+
Minimum:
1
Maximum:
2048
Update requires: Replacement
Return values
Ref
When you pass the logical ID of an AWS::Kinesis::StreamConsumer
resource to the intrinsic Ref function, the function returns the consumer ARN. For
example ARN formats, see Example
ARNs.
For more information about using the Ref function, see Ref.
Fn::GetAtt
Fn::GetAtt
returns a value for a specified attribute of this type. The
following are the available attributes and sample return values.
For more information about using Fn::GetAtt, see Fn::GetAtt.
ConsumerARN
-
When you register a consumer, Kinesis Data Streams generates an ARN for it. You need this ARN to be able to call SubscribeToShard.
If you delete a consumer and then create a new one with the same name, it won't have the same ARN. That's because consumer ARNs contain the creation timestamp. This is important to keep in mind if you have IAM policies that reference consumer ARNs.
ConsumerCreationTimestamp
-
The time at which the consumer was created.
ConsumerName
-
The name you gave the consumer when you registered it.
ConsumerStatus
-
A consumer can't read data while in the
CREATING
orDELETING
states. StreamARN
-
The ARN of the data stream with which the consumer is registered.
Examples
Register a Consumer with a Kinesis Data Stream
JSON
{ "Parameters": { "TestStreamARN": { "Type": "String" }, "TestConsumerName": { "Type": "String" } }, "Resources": { "StreamConsumer": { "Type": "AWS::Kinesis::StreamConsumer", "Properties": { "StreamARN": { "Ref" : TestStreamARN }, "ConsumerName": { "Ref" : TestConsumerName } } } } }
YAML
Parameters: TestStreamARN: Type: String TestConsumerName: Type: String Resources: StreamConsumer: Type: "AWS::Kinesis::StreamConsumer" Properties: StreamARN: !Ref TestStreamARN ConsumerName: !Ref TestConsumerName