AWS::Kinesis::Stream - AWS CloudFormation


Creates a Kinesis stream that captures and transports data records that are emitted from data sources. For information about creating streams, see CreateStream in the Amazon Kinesis API Reference.


To declare this entity in your AWS CloudFormation template, use the following syntax:


{ "Type" : "AWS::Kinesis::Stream", "Properties" : { "Name" : String, "RetentionPeriodHours" : Integer, "ShardCount" : Integer, "StreamEncryption" : StreamEncryption, "Tags" : [ Tag, ... ] } }


Type: AWS::Kinesis::Stream Properties: Name: String RetentionPeriodHours: Integer ShardCount: Integer StreamEncryption: StreamEncryption Tags: - Tag



The name of the Kinesis stream. If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the stream name. For more information, see Name Type.

If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.

Required: No

Type: String

Minimum: 1

Maximum: 128

Pattern: [a-zA-Z0-9_.-]+

Update requires: Replacement


The number of hours for the data records that are stored in shards to remain accessible. The default value is 24. For more information about the stream retention period, see Changing the Data Retention Period in the Amazon Kinesis Developer Guide.

Required: No

Type: Integer

Update requires: No interruption


The number of shards that the stream uses. For greater provisioned throughput, increase the number of shards.

Required: Yes

Type: Integer

Minimum: 1

Update requires: No interruption


When specified, enables or updates server-side encryption using an AWS KMS key for a specified stream. Removing this property from your stack template and updating your stack disables encryption.

Required: No

Type: StreamEncryption

Update requires: No interruption


An arbitrary set of tags (key–value pairs) to associate with the Kinesis stream. For information about constraints for this property, see Tag Restrictions in the Amazon Kinesis Developer Guide.

Required: No

Type: List of Tag

Update requires: No interruption

Return values


When you specify an AWS::Kinesis::Stream resource as an argument to the Ref function, AWS CloudFormation returns the stream name (physical ID).

For more information about using the Ref function, see Ref.


Fn::GetAtt returns a value for the Arn attribute.

For more information about using Fn::GetAtt, see Fn::GetAtt.


The Amazon resource name (ARN) of the Kinesis stream, such as arn:aws:kinesis:us-east-2:123456789012:stream/mystream.


Create a Stream

The following example creates a Stream resource that uses three shards, sets a seven-day retention period, and specifies the KMS key for server-side encryption.


"MyStream": { "Type": "AWS::Kinesis::Stream", "Properties": { "Name": "MyKinesisStream", "RetentionPeriodHours" : 168, "ShardCount": 3, "StreamEncryption": { "EncryptionType": "KMS", "KeyId": "!Ref myKey" }, "Tags": [ { "Key": "Environment", "Value": "Production" } ] } }


MyStream: Type: AWS::Kinesis::Stream Properties: Name: MyKinesisStream RetentionPeriodHours: 168 ShardCount: 3 StreamEncryption: EncryptionType: KMS KeyId: !Ref myKey Tags: - Key: Environment Value: Production