Canonical: https://weaveos.com/reference/amazon-sqs/read-queue-attributes

1. [Software capabilities](https://weaveos.com/reference)
2. /[Amazon SQS](https://weaveos.com/reference/amazon-sqs)
3. /Read Amazon SQS queue attributes

[![](https://weaveos.com/reference/logos/amazon-sqs.svg)Amazon SQS](https://weaveos.com/reference/amazon-sqs)

# Read Amazon SQS queue attributes

Use the AWS CLI to inspect a queue’s settings or approximate message counts. Use the Go SDK when an application needs the same named attributes.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1CLI: aws sqs get-queue-attributes](https://weaveos.com/reference/amazon-sqs/read-queue-attributes#method-1)
2. [2SDK: sqs.Client.GetQueueAttributes](https://weaveos.com/reference/amazon-sqs/read-queue-attributes#method-2)

CLI

### aws sqs get-queue-attributes

Pass a queue URL and list the attributes you want, such as VisibilityTimeout and ApproximateNumberOfMessages.

[Read source: AWS CLI get-queue-attributes](https://docs.aws.amazon.com/cli/latest/reference/sqs/get-queue-attributes.html)

- Requirements

  AWS CLI credentials with sqs:GetQueueAttributes, the queue URL, and its Region.

- Limitations

  The message count is approximate and can take at least a minute to settle after producers stop sending.

Example shell

Copy

```
aws sqs get-queue-attributes --queue-url "$QUEUE_URL" --attribute-names VisibilityTimeout ApproximateNumberOfMessages
```

SDK

### sqs.Client.GetQueueAttributes

Set QueueUrl and the requested AttributeNames on GetQueueAttributesInput. Read the response’s string-valued Attributes map.

[Read source: AWS SDK for Go v2 GetQueueAttributes](https://github.com/aws/aws-sdk-go-v2/blob/fab6ce7049daa93f9ace2bb14039f41c8a00504a/service/sqs/api_op_GetQueueAttributes.go)

- Requirements

  An AWS SDK for Go v2 SQS client configured with credentials, the queue’s Region, and sqs:GetQueueAttributes permission.

- Limitations

  The SDK returns an empty attribute result when you omit AttributeNames. Request specific names or use All.

## More from Amazon SQS

[View all 1 Amazon SQS tasks](https://weaveos.com/reference/amazon-sqs)
