CreateQueue (Query)

The CreateQueue action creates a new queue. You must provide a queue name that is unique within the scope of the queues you own. The queue is assigned a queue URL; you must use this URL when performing actions on the queue.

When you create a queue, if a queue with the same name already exists, CreateQueue returns the queue URL with an error indicating that the queue already exists.

When you create a queue, FullControl access rights are granted to you for the queue. Only you (as owner of the queue), or a grantee assigned FullControl rights to the queue, can grant or deny access rights to the queue and its messages.

Note:

You must be signed up for Amazon SQS for the request to succeed, as SQS is not a free service.

The default value for VisibilityTimeout is also set when a queue is created. See SetVisibilityTimeout (Query) for information about how visibility timeout works.

CreateQueue requests are validated on the following:

Returns Success and a queue URL if successful or an error response if unsuccessful.

NameDescriptionTypeValue
QueueNameThe name to use for the queue created. The queue name must be unique within the scope of all your queues.RequiredAn alphanumeric string specifying the name of the queue to create. Maximum 80 characters.
DefaultVisibilityTimeoutSets the default visibility timeout for this queue. If this parameter is not included, the default value is set to 30 seconds. For more information, see SetVisibilityTimeout.OptionalInteger

The following example of a CreateQueue action creates a new queue named queue2.

ErrorDescription
InvalidParameterValueQueueName did not pass validation.
InvalidParameterValueDefaultVisibilityTimeout is specified and is not between 0 and 86400

Specifying a QueueName that is too long or not alphanumeric results in the following error:

<Response>
    <Errors>
        <Error>
            <Code>
                InvalidParameterValue
            </Code>
            <Message>
              Value (quename_nonalpha) for parameter QueueName is invalid. 
              Must be an alphanumeric String of 1 to 80 in length
            </Message>
        </Error>
    </Errors>
    <RequestID>
        42d59b56-7407-4c4a-be0f-4c88daeea257
    </RequestID>
</Response>