get-queue-attributes — AWS CLI 1.40.37 Command Reference (original) (raw)

Note:

You are viewing the documentation for an older major version of the AWS CLI (version 1).

AWS CLI version 2, the latest major version of AWS CLI, is now stable and recommended for general use. To view this page for the AWS CLI version 2, clickhere. For more information see the AWS CLI version 2installation instructions andmigration guide.

[ aws . sqs ]

Description

Gets attributes for the specified queue.

Note

To determine whether a queue is FIFO , you can check whether QueueName ends with the .fifo suffix.

See also: AWS API Documentation

Synopsis

get-queue-attributes --queue-url [--attribute-names ] [--cli-input-json ] [--generate-cli-skeleton ] [--debug] [--endpoint-url ] [--no-verify-ssl] [--no-paginate] [--output ] [--query ] [--profile ] [--region ] [--version ] [--color ] [--no-sign-request] [--ca-bundle ] [--cli-read-timeout ] [--cli-connect-timeout ]

Options

--queue-url (string)

The URL of the Amazon SQS queue whose attribute information is retrieved.

Queue URLs and names are case-sensitive.

--attribute-names (list)

A list of attributes for which to retrieve information.

The AttributeNames parameter is optional, but if you don’t specify values for this parameter, the request returns empty results.

Note

In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.

The following attributes are supported:

Warning

The ApproximateNumberOfMessagesDelayed , ApproximateNumberOfMessagesNotVisible , and ApproximateNumberOfMessages metrics may not achieve consistency until at least 1 minute after the producers stop sending messages. This period is required for the queue metadata to reach eventual consistency.

The following attributes apply only to dead-letter queues:

Note

The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.

The following attributes apply only to server-side-encryption :

The following attributes apply only to FIFO (first-in-first-out) queues :

Note

To determine whether a queue is FIFO , you can check whether QueueName ends with the .fifo suffix.

The following attributes apply only to high throughput for FIFO queues :

To enable high throughput for FIFO queues, do the following:

If you set these attributes to anything other than the values shown for enabling high throughput, normal throughput is in effect and deduplication occurs as specified.

For information on throughput quotas, see Quotas related to messages in the Amazon SQS Developer Guide .

(string)

Syntax:

"string" "string" ...

Where valid values are: All Policy VisibilityTimeout MaximumMessageSize MessageRetentionPeriod ApproximateNumberOfMessages ApproximateNumberOfMessagesNotVisible CreatedTimestamp LastModifiedTimestamp QueueArn ApproximateNumberOfMessagesDelayed DelaySeconds ReceiveMessageWaitTimeSeconds RedrivePolicy FifoQueue ContentBasedDeduplication KmsMasterKeyId KmsDataKeyReusePeriodSeconds DeduplicationScope FifoThroughputLimit RedriveAllowPolicy SqsManagedSseEnabled

--cli-input-json (string) Performs service operation based on the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, the CLI 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.

--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. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command.

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.

--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.

--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.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To get a queue’s attributes

This example gets all of the specified queue’s attributes.

Command:

aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyQueue --attribute-names All

Output:

{ "Attributes": { "ApproximateNumberOfMessagesNotVisible": "0", "RedrivePolicy": "{"deadLetterTargetArn":"arn:aws:sqs:us-east-1:80398EXAMPLE:MyDeadLetterQueue","maxReceiveCount":1000}", "MessageRetentionPeriod": "345600", "ApproximateNumberOfMessagesDelayed": "0", "MaximumMessageSize": "262144", "CreatedTimestamp": "1442426968", "ApproximateNumberOfMessages": "0", "ReceiveMessageWaitTimeSeconds": "0", "DelaySeconds": "0", "VisibilityTimeout": "30", "LastModifiedTimestamp": "1442426968", "QueueArn": "arn:aws:sqs:us-east-1:80398EXAMPLE:MyNewQueue" } }

This example gets only the specified queue’s maximum message size and visibility timeout attributes.

Command:

aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/80398EXAMPLE/MyNewQueue --attribute-names MaximumMessageSize VisibilityTimeout

Output:

{ "Attributes": { "VisibilityTimeout": "30", "MaximumMessageSize": "262144" } }

Output

Attributes -> (map)

A map of attributes to their respective values.

key -> (string)

value -> (string)