AWS::Kinesis::Stream - AWS CloudFormation

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, "StreamModeDetails" : StreamModeDetails, "Tags" : [ Tag, ... ] } }

YAML

Type: AWS::Kinesis::Stream Properties: Name: String RetentionPeriodHours: Integer ShardCount: Integer StreamEncryption: StreamEncryption StreamModeDetails: StreamModeDetails 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

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

Minimum: 1

Maximum: 128

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

Minimum: 24

Update requires: No interruption

ShardCount

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

Required: No

Type: Integer

Minimum: 1

Update requires: No interruption

StreamEncryption

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

StreamModeDetails

Specifies the capacity mode to which you want to set your data stream. Currently, in Kinesis Data Streams, you can choose between an on-demand capacity mode and a provisioned capacity mode for your data streams.

Required: No

Type: StreamModeDetails

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: Array of Tag

Maximum: 50

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