Menu
AWS IoT
Developer Guide

CreateStream

Creates a stream for delivering one or more large files in chunks over MQTT. A stream transports data bytes in chunks or blocks packaged as MQTT messages from a source like S3. You can have one or more files associated with a stream. The total size of a file associated with the stream cannot exceed more than 2 MB. The stream will be created with version 0. If a stream is created with the same streamID as a stream that existed and was deleted within last 90 days, we will resurrect that old stream by incrementing the version by 1.

Request syntax:

POST /streams/streamId Content-type: application/json { "description": "string", "files": [ { "fileId": "integer", "s3Location": { "bucket": "string", "key": "string", "version": "string" } } ], "roleArn": "string" }

URI Request Parameters:

Name

Type

Req?

Description

streamId

StreamId

yes

The stream ID.

Request Body Parameters:

Name

Type

Req?

Description

description

StreamDescription

no

A description of the stream.

files

StreamFiles

yes

The files to stream.

roleArn

RoleArn

yes

An IAM role that allows the IoT service principal assumes to access your S3 files.

Response syntax:

Content-type: application/json { "streamId": "string", "streamArn": "string", "description": "string", "streamVersion": "integer" }

Response Body Parameters:

Name

Type

Req?

Description

streamId

StreamId

no

The stream ID.

streamArn

StreamArn

no

The stream ARN.

description

StreamDescription

no

A description of the stream.

streamVersion

StreamVersion

no

The version of the stream.

Errors:

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

ResourceAlreadyExistsException

The resource already exists.

HTTP response code: 409

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

CLI

Synopsis:

aws iot create-stream \ --stream-id <value> \ [--description <value>] \ --files <value> \ --role-arn <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "streamId": "string", "description": "string", "files": [ { "fileId": "integer", "s3Location": { "bucket": "string", "key": "string", "version": "string" } } ], "roleArn": "string" }

cli-input-json fields:

Name

Type

Description

streamId

string

length max:128 min:1

pattern: [a-zA-Z0-9_-]+

The stream ID.

description

string

length max:2028

pattern: [^\\p{C}]+

A description of the stream.

files

list

member: StreamFile

The files to stream.

StreamFile

StreamFile

fileId

integer

java class: java.lang.Integer

range- max:255 min:0

The file ID.

s3Location

S3Location

The location of the file in S3.

bucket

string

length min:1

The S3 bucket that contains the file to stream.

key

string

length min:1

The name of the file within the S3 bucket to stream.

version

string

The file version.

roleArn

string

length max:2048 min:20

An IAM role that allows the IoT service principal assumes to access your S3 files.

Output:

{ "streamId": "string", "streamArn": "string", "description": "string", "streamVersion": "integer" }

cli output fields:

Name

Type

Description

streamId

string

length max:128 min:1

pattern: [a-zA-Z0-9_-]+

The stream ID.

streamArn

string

The stream ARN.

description

string

length max:2028

pattern: [^\\p{C}]+

A description of the stream.

streamVersion

integer

java class: java.lang.Integer

range- max:65535 min:0

The version of the stream.

On this page: