# IAM policy example: send messages to one SQS queue, with a least privilege rewrite

Facts read 16 Nov 2026. Page reviewed 16 Nov 2026.

Allows a producer to send messages to one queue, orders-queue, and read its URL and attributes. The original allows sqs:* on every queue. The rewrite names the queue ARN and three actions. The names and the account ID 111122223333 are AWS documentation placeholders.

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SendAny",
      "Effect": "Allow",
      "Action": "sqs:*",
      "Resource": "*"
    }
  ]
}
```

## What it allows

- Allows every SQS action on all queues.

- Allows 20 actions (sqs:*) on every resource.

Checks:
- high: Allows 11 write or permissions-management actions (3 permissions management) on every resource ("Resource": "*"). (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html)

The action sqs:* covers 20 actions and every queue, including purge, delete and policy changes.

## Least privilege rewrite

```json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "SendToOne",
      "Effect": "Allow",
      "Action": [
        "sqs:SendMessage",
        "sqs:GetQueueUrl",
        "sqs:GetQueueAttributes"
      ],
      "Resource": "arn:aws:sqs:us-east-1:111122223333:orders-queue"
    }
  ]
}
```

The rewrite lists three actions on one queue. Receiving, purging and deleting messages or the queue are removed.

- Allows 3 actions (sqs:SendMessage, sqs:GetQueueUrl, sqs:GetQueueAttributes) on arn:aws:sqs:us-east-1:111122223333:orders-queue.

Checks:
- No flags.

- [Paste it into the workbench](/)
- [Every SQS action and its access level](/actions/sqs/)

## Related pages

- [IAM policy example: consume messages from one SQS queue](/examples/sqs-consume-one-queue/)
- [IAM policy example: publish to one SNS topic](/examples/sns-publish-to-one-topic/)
- [IAM policy example: put events on one EventBridge bus](/examples/eventbridge-put-events-to-one-bus/)
- [All of them](/examples/)

## Sources

- Amazon SQS Developer Guide: basic policy examples: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-basic-examples-of-sqs-policies.html (read 16 Nov 2026)
- AWS Service Authorization Reference, programmatic access (fetched 16 Nov 2026): https://docs.aws.amazon.com/service-authorization/latest/reference/service-reference.html (read 16 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://iampolicygenerator.com/examples/sqs-send-to-one-queue/

This site is not affiliated with Amazon Web Services. AWS service and product names are used only to describe AWS services.
