AWS::Kinesis::StreamConsumer
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.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::Kinesis::StreamConsumer", "Properties" : { "ConsumerName" :String, "StreamARN" :String} }
YAML
Type: "AWS::Kinesis::StreamConsumer" Properties: ConsumerName:StringStreamARN:String
Properties
ConsumerName-
The name of the consumer is something you choose when you register the consumer.
Required: Yes
Type: String
Update requires: Replacement
StreamARN-
The ARN of the Kinesis data stream that you want to register the consumer with.
Required: Yes
Type: String
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.
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
CREATINGorDELETINGstates. StreamARN-
The ARN of the data stream that the consumer is registered with.
For more information about using
Fn::GetAtt, see
Fn::GetAtt.
Example
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
