Menu
AWS CloudFormation
User Guide (API Version 2010-05-15)

AWS::Kinesis::Stream

Creates an 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

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

YAML

Copy
Type: "AWS::Kinesis::Stream" Properties: Name: String RetentionPeriodHours: Integer ShardCount: Integer Tags: - Resource Tag

Properties

Note

For more information about constraints and values for each property, see CreateStream in the Amazon Kinesis API Reference and Amazon Kinesis Streams Limits in the Amazon Kinesis Developer Guide.

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.

Important

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

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

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: AWS CloudFormation Resource Tags

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.

Arn

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

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

Example

The following example creates a Stream resource that uses three shards and sets a seven-day retention period.

JSON

Copy
"MyStream": { "Type": "AWS::Kinesis::Stream", "Properties": { "Name": "MyKinesisStream", "RetentionPeriodHours" : 168, "ShardCount": 3, "Tags": [ { "Key": "Environment", "Value": "Production" } ] } }

YAML

Copy
MyStream: Type: 'AWS::Kinesis::Stream' Properties: Name: MyKinesisStream RetentionPeriodHours: 168 ShardCount: 3 Tags: - Key: Environment Value: Production