<a id="cli-aws-kinesis-create-queue"></a>

# create-queue

## Description

Creates a queue on the specified data stream. A queue delivers records from the stream to a queue consumer, tracks the delivery state of each record, and redelivers any record that is not acknowledged before its visibility timeout expires.

A queue does not extend how long the stream keeps a record. When a record reaches the end of the data stream’s retention period, the queue stops delivering it.

Your queue consumer calls  ReceiveQueueRecords to receive up to 10 records at a time. After it processes records, it calls  AcknowledgeQueueRecords so the queue does not deliver them again.

Queues are supported only on data streams in on-demand capacity mode.

Creating a queue does not change how producers write to the stream, and it does not change how existing stream consumers read from it. A queue counts as a registered consumer on the stream and shares the stream’s registered consumer limit with enhanced fan-out consumers: 20 on On-demand Standard and 50 on On-demand Advantage.

Use `StartingPosition` to set the position in the stream where delivery begins. The default is `LATEST` .

> `CreateQueue` is an asynchronous operation. Upon receiving a `CreateQueue` request, Amazon Kinesis Data Streams immediately returns a queue description with a `QueueStatus` of `CREATING` . After the queue is created, Kinesis Data Streams sets the `QueueStatus` to `ACTIVE` . You can begin receiving records after the queue is `ACTIVE` . Use  DescribeQueue to check the status of the queue.

Each queue has built-in dead-letter handling. When a record has been received `MaxReceiveCount` times without being acknowledged, it becomes a dead-letter record, and  ReceiveQueueRecords no longer returns it. You work with dead-letter records through a separate set of operations that use the same queue ARN:  ReceiveDeadLetterQueueRecords ,  AcknowledgeDeadLetterQueueRecords ,  UpdateDeadLetterQueueRecordsVisibility , and  RestoreDeadLetterQueueRecords .

Dead-letter handling is enabled by default, with a `MaxReceiveCount` of 6. To use a different value, or to turn dead-letter handling off, specify `DeadLetterConfiguration` in `QueueAttributes` .

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/kinesis-2013-12-02/CreateQueue)

## Synopsis

```
  create-queue
--queue-name <value>
--stream-configuration-list <value>
[--queue-attributes <value>]
[--tags <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--queue-name` (string) [required]

> A name for the queue. The name is scoped to the Amazon Web Services account and Region used by the request, so two queues in different accounts, or in the same account and different Regions, can have the same name.

> Constraints:

> * min: `1`
> * max: `128`
> * pattern: `[a-zA-Z0-9_.-]+`

`--stream-configuration-list` (list) [required]

> The data stream the queue delivers records from, and the position in that stream where delivery begins. The list must contain exactly one entry, because a queue delivers records from a single data stream.

> Constraints:

> * min: `1`
> * max: `10000`

> (structure)

> > The data stream a queue delivers records from, and the position in that stream where delivery begins.

> > StreamARN -> (string) [required]

> > > The ARN of the data stream.

> > > Constraints:

> > > * min: `1`
> > > * max: `2048`
> > > * pattern: `arn:aws.*:kinesis:.*:\d{12}:stream/\S+`

> > StartingPosition -> (structure)

> > > The position in the stream from which the queue begins delivering records. The default is `LATEST` .

> > > Type -> (string) [required]

> > > > You can set the starting position to one of the following values:

> > > > > `LATEST` : Delivers records that arrive after you create the queue. This is the default.

> > > > > `TRIM_HORIZON` : Start delivering at the last untrimmed record in the stream, which is the oldest record the stream still retains.

> > > > > `AT_TIMESTAMP` : Delivers records that arrive at or after a time stamp that you provide.

> > > > Possible values:

> > > > * `TRIM_HORIZON`
> > > > * `LATEST`
> > > > * `AT_TIMESTAMP`

> > > Timestamp -> (timestamp)

> > > > The approximate time from which the queue begins delivering records. Records that arrive at approximately this time or later are delivered.

> > > > In a request, specify this value only when `Type` is `AT_TIMESTAMP` . It is required in that case, and specifying it for any other type returns a `ValidationException` .

> > > > In a response, this value is approximate and reflects the queue’s effective starting position. While the queue is `CREATING` , the response echoes what you configured: for `AT_TIMESTAMP` , the timestamp you provided, and for `TRIM_HORIZON` and `LATEST` , this member is absent because the effective position is not yet determined. Once the queue is `ACTIVE` , the response always includes this member. For `AT_TIMESTAMP` , it is the timestamp you provided or the earliest time the stream can be read from, whichever is later.

Shorthand Syntax:

```
StreamARN=string,StartingPosition={Type=string,Timestamp=timestamp} ...
```

JSON Syntax:

```json
[
  {
    "StreamARN": "string",
    "StartingPosition": {
      "Type": "TRIM_HORIZON"|"LATEST"|"AT_TIMESTAMP",
      "Timestamp": timestamp
    }
  }
  ...
]
```

`--queue-attributes` (structure)

> The configuration attributes for the queue, including its visibility timeout and its dead-letter handling configuration.

> VisibilityTimeoutSeconds -> (integer)

> > The duration, in seconds, that a record is in flight and not visible to any consumer instance after it is received. A record that is not acknowledged before this duration elapses becomes visible in the queue again and can be received by any consumer instance. If you omit this attribute when you create a queue, the queue uses 30 seconds.

> > Constraints:

> > * min: `0`
> > * max: `43200`

> DeadLetterConfiguration -> (structure)

> > The dead-letter handling configuration for the queue. If you omit this attribute, dead-letter handling is enabled with a `MaxReceiveCount` of 6. If you specify it with a `TargetType` of `BUILT_IN` , you must also specify `MaxReceiveCount` .

> > TargetType -> (string) [required]

> > > Whether dead-letter handling is enabled for the queue. `BUILT_IN` enables it: when a record has been received `MaxReceiveCount` times without being acknowledged, it becomes a dead-letter record and  ReceiveQueueRecords no longer returns it. `NONE` disables it, and an unacknowledged record continues to be redelivered until it is acknowledged or its retention period ends.

> > > Possible values:

> > > * `BUILT_IN`
> > > * `NONE`

> > MaxReceiveCount -> (integer)

> > > The number of times a record can be received without being acknowledged before it becomes a dead-letter record. Required when `TargetType` is `BUILT_IN` . A queue that you create without `DeadLetterConfiguration` gets a `MaxReceiveCount` of 6.

> > > Constraints:

> > > * min: `1`
> > > * max: `1000`

Shorthand Syntax:

```
VisibilityTimeoutSeconds=integer,DeadLetterConfiguration={TargetType=string,MaxReceiveCount=integer}
```

JSON Syntax:

```json
{
  "VisibilityTimeoutSeconds": integer,
  "DeadLetterConfiguration": {
    "TargetType": "BUILT_IN"|"NONE",
    "MaxReceiveCount": integer
  }
}
```

`--tags` (map)

> A set of up to 50 key-value pairs to apply to the queue. You can also add, change, and remove tags after the queue is created with  TagResource and  UntagResource .

> Constraints:

> * min: `1`
> * max: `200`

> key -> (string)

> > Constraints:

> > * min: `1`
> > * max: `128`

> value -> (string)

> > Constraints:

> > * min: `0`
> > * max: `256`

Shorthand Syntax:

```
KeyName1=string,KeyName2=string
```

JSON Syntax:

```json
{"string": "string"
  ...}
```

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Output

QueueDescription -> (structure)

> A description of the queue that was created.

> QueueName -> (string) [required]

> > The name of the queue.

> > Constraints:

> > * min: `1`
> > * max: `128`
> > * pattern: `[a-zA-Z0-9_.-]+`

> QueueARN -> (string) [required]

> > The ARN of the queue. The resource identifier in the ARN is generated when the queue is created and is not derived from `QueueName` . Use the returned `QueueARN` to identify the queue in subsequent requests.

> > Constraints:

> > * min: `1`
> > * max: `2048`
> > * pattern: `arn:aws.*:kinesis:.*:\d{12}:queue/\S+`

> QueueStatus -> (string) [required]

> > The current status of the queue.

> > Possible values:

> > * `CREATING`
> > * `ACTIVE`
> > * `UPDATING`
> > * `DELETING`

> QueueCreationTimestamp -> (timestamp) [required]

> > The time the queue was created.

> StreamConfigurationList -> (list) [required]

> > The data stream the queue delivers records from, and the position in that stream where delivery begins. The list contains exactly one entry, because a queue delivers records from a single data stream.

> > Constraints:

> > * min: `1`
> > * max: `10000`

> > (structure)

> > > The data stream a queue delivers records from, and the position in that stream where delivery begins.

> > > StreamARN -> (string) [required]

> > > > The ARN of the data stream.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `2048`
> > > > * pattern: `arn:aws.*:kinesis:.*:\d{12}:stream/\S+`

> > > StartingPosition -> (structure)

> > > > The position in the stream from which the queue begins delivering records. The default is `LATEST` .

> > > > Type -> (string) [required]

> > > > > You can set the starting position to one of the following values:

> > > > > > `LATEST` : Delivers records that arrive after you create the queue. This is the default.

> > > > > > `TRIM_HORIZON` : Start delivering at the last untrimmed record in the stream, which is the oldest record the stream still retains.

> > > > > > `AT_TIMESTAMP` : Delivers records that arrive at or after a time stamp that you provide.

> > > > > Possible values:

> > > > > * `TRIM_HORIZON`
> > > > > * `LATEST`
> > > > > * `AT_TIMESTAMP`

> > > > Timestamp -> (timestamp)

> > > > > The approximate time from which the queue begins delivering records. Records that arrive at approximately this time or later are delivered.

> > > > > In a request, specify this value only when `Type` is `AT_TIMESTAMP` . It is required in that case, and specifying it for any other type returns a `ValidationException` .

> > > > > In a response, this value is approximate and reflects the queue’s effective starting position. While the queue is `CREATING` , the response echoes what you configured: for `AT_TIMESTAMP` , the timestamp you provided, and for `TRIM_HORIZON` and `LATEST` , this member is absent because the effective position is not yet determined. Once the queue is `ACTIVE` , the response always includes this member. For `AT_TIMESTAMP` , it is the timestamp you provided or the earliest time the stream can be read from, whichever is later.

> QueueAttributes -> (structure)

> > The configuration attributes of the queue.

> > VisibilityTimeoutSeconds -> (integer)

> > > The duration, in seconds, that a record is in flight and not visible to any consumer instance after it is received. A record that is not acknowledged before this duration elapses becomes visible in the queue again and can be received by any consumer instance. If you omit this attribute when you create a queue, the queue uses 30 seconds.

> > > Constraints:

> > > * min: `0`
> > > * max: `43200`

> > DeadLetterConfiguration -> (structure)

> > > The dead-letter handling configuration for the queue. If you omit this attribute, dead-letter handling is enabled with a `MaxReceiveCount` of 6. If you specify it with a `TargetType` of `BUILT_IN` , you must also specify `MaxReceiveCount` .

> > > TargetType -> (string) [required]

> > > > Whether dead-letter handling is enabled for the queue. `BUILT_IN` enables it: when a record has been received `MaxReceiveCount` times without being acknowledged, it becomes a dead-letter record and  ReceiveQueueRecords no longer returns it. `NONE` disables it, and an unacknowledged record continues to be redelivered until it is acknowledged or its retention period ends.

> > > > Possible values:

> > > > * `BUILT_IN`
> > > > * `NONE`

> > > MaxReceiveCount -> (integer)

> > > > The number of times a record can be received without being acknowledged before it becomes a dead-letter record. Required when `TargetType` is `BUILT_IN` . A queue that you create without `DeadLetterConfiguration` gets a `MaxReceiveCount` of 6.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `1000`
