- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateStreamCommand
Creates a new Kinesis video stream.
When you create a new stream, Kinesis Video Streams assigns it a version number. When you change the stream's metadata, Kinesis Video Streams updates the version.
CreateStream
is an asynchronous operation.
For information about how the service works, see How it Works .
You must have permissions for the KinesisVideo:CreateStream
action.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { KinesisVideoClient, CreateStreamCommand } from "@aws-sdk/client-kinesis-video"; // ES Modules import
// const { KinesisVideoClient, CreateStreamCommand } = require("@aws-sdk/client-kinesis-video"); // CommonJS import
const client = new KinesisVideoClient(config);
const input = { // CreateStreamInput
DeviceName: "STRING_VALUE",
StreamName: "STRING_VALUE", // required
MediaType: "STRING_VALUE",
KmsKeyId: "STRING_VALUE",
DataRetentionInHours: Number("int"),
Tags: { // ResourceTags
"<keys>": "STRING_VALUE",
},
};
const command = new CreateStreamCommand(input);
const response = await client.send(command);
// { // CreateStreamOutput
// StreamARN: "STRING_VALUE",
// };
CreateStreamCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
StreamName Required | string | undefined | A name for the stream that you are creating. The stream name is an identifier for the stream, and must be unique for each account and region. |
DataRetentionInHours | number | undefined | The number of hours that you want to retain the data in the stream. Kinesis Video Streams retains the data in a data store that is associated with the stream. The default value is 0, indicating that the stream does not persist data. When the |
DeviceName | string | undefined | The name of the device that is writing to the stream. In the current implementation, Kinesis Video Streams does not use this name. |
KmsKeyId | string | undefined | The ID of the Key Management Service (KMS) key that you want Kinesis Video Streams to use to encrypt stream data. If no key ID is specified, the default, Kinesis Video-managed key ( For more information, see DescribeKey . |
MediaType | string | undefined | The media type of the stream. Consumers of the stream can use this information when processing the stream. For more information about media types, see Media Types . If you choose to specify the Example valid values include "video/h264" and "video/h264,audio/aac". This parameter is optional; the default value is |
Tags | Record<string, string> | undefined | A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional). |
CreateStreamCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
StreamARN | string | undefined | The Amazon Resource Name (ARN) of the stream. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccountStreamLimitExceededException | client | The number of streams created for the account is too high. |
ClientLimitExceededException | client | Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later. |
DeviceStreamLimitExceededException | client | Not implemented. |
InvalidArgumentException | client | The value for this input parameter is invalid. |
InvalidDeviceException | client | Not implemented. |
ResourceInUseException | client | When the input
|
TagsPerResourceExceededLimitException | client | You have exceeded the limit of tags that you can associate with the resource. A Kinesis video stream can support up to 50 tags. |
KinesisVideoServiceException | Base exception class for all service exceptions from KinesisVideo service. |