# AWS SQS

> Amazon Simple Queue Service (SQS) is a managed message queue that decouples the components of an application, with standard and FIFO queues.

- Source: https://www.itwonderlab.com/aws-sqs/
- Published: 2026-10-05
- Updated: 2026-10-05
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**Amazon Simple Queue Service (SQS)** is a fully managed message queue. A producer sends messages to the queue and a consumer reads and processes them when it can, so the two parts of an application do not depend on each other being available or running at the same speed.

### Key concepts

- **Standard queues**: nearly unlimited throughput, *at-least-once* delivery and best-effort ordering. Consumers must be idempotent.
- **FIFO queues**: strict order (per message group) and exactly-once processing, with lower throughput.
- **Visibility timeout**: after a consumer receives a message, it is hidden from the others for some time. If it is not deleted before the timeout ends, it becomes visible again and is retried.
- **Dead-letter queue (DLQ)**: receives the messages that failed too many times, so they can be analyzed without blocking the queue.
- **Long polling** reduces empty responses and cost; **delay queues** and message timers postpone delivery.
- Messages up to 256 KB, retained from 1 minute to 14 days. Encrypted at rest with SQS-managed keys or [KMS](https://www.itwonderlab.com/aws-kms/); access with [IAM](https://www.itwonderlab.com/aws-iam/) and queue policies.
- Consumers: [Lambda](https://www.itwonderlab.com/aws-lambda/) (with an event source mapping that scales automatically), [EC2](https://www.itwonderlab.com/aws-ec2/) or containers, often scaled with [Auto Scaling](https://www.itwonderlab.com/aws-auto-scaling/) on the queue length.
- Typically fed by [SNS](https://www.itwonderlab.com/aws-sns/) (fan-out) or [S3](https://www.itwonderlab.com/aws-s3/) events.

### Pricing

Per million requests (with a monthly free tier) plus data transfer. See the [SQS pricing](https://aws.amazon.com/sqs/pricing/).

### With Terraform

The resources are `aws_sqs_queue`, `aws_sqs_queue_policy` and `aws_sqs_queue_redrive_policy`.
