AWS CloudFormation
User Guide (Version )

The AWS Documentation website is getting a new look!
Try it now and let us know what you think. Switch to the new look >>

You can return to the original look by selecting English in the language selector above.

AWS::Kinesis::Stream

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.

Syntax

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

JSON

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

YAML

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

Properties

Name

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

RetentionPeriodHours

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

ShardCount

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

StreamEncryption

Enables or updates server-side encryption using an AWS KMS key for a specified stream.

Required: No

Type: StreamEncryption

Update requires: No interruption

Tags

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

Ref

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

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

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

Arn

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

Examples

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.

JSON

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

YAML

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