Amazon Simple Queue Service (SQS) (SQS)
Buffers asynchronous spikes between distributed services, prevents downstream component overload, absorbs high-throughput bursts, and provides dead-letter redrive (DLQ) for poison-pill message debugging.
AWS Container Placement
Regional / Global Managed Scope (Outside VPC Subnets)
Summary
Fully managed distributed message queuing service enabling decoupling and asynchronous scaling of microservices and serverless architectures.
When to Use (SAA-C03)
Use to decouple microservices and smooth bursty load; pair with a Dead-Letter Queue (DLQ) for failed message inspection.
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| EC2 | HTTPS | 443 | EC2 instance producers publishing messages via sqs:SendMessage |
| LAMBDA | HTTPS | 443 | Lambda functions publishing events or polling via Event Source Mapping |
| SNS | HTTPS | 443 | SNS pub/sub fan-out subscriptions pushing notifications into the queue |
| EVENTBRIDGE | HTTPS | 443 | EventBridge rules routing matched JSON event payloads to queue targets |
| INTERFACE-ENDPOINT | HTTPS | 443 | PrivateLink access to SQS from inside private VPC subnets |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| KMS | HTTPS | 443 | Decrypt and GenerateDataKey operations for server-side encryption (SSE-KMS) |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| Queue Name (sqsQueueName / name) (Required) | orders-processing.fifo | The unique name of the Amazon SQS queue within your AWS account and region. Why: AWS requires an explicit name to construct the Queue URL and Queue ARN. |
| Queue Type (sqsQueueType) (Required) | standard | Determines whether the queue offers unlimited throughput (standard) or strict FIFO ordering with deduplication (fifo). Why: Queue type cannot be changed after creation; fundamental to architectural messaging semantics. |
| Visibility Timeout (queueVisibilityTimeout) (Required) | 30 | The duration during which a message is hidden from other consumers after being received by a worker. Why: Must be set longer than the maximum expected processing time to prevent duplicate simultaneous executions. |
| Message Retention Period (message_retention_seconds) | 345600 | The duration that SQS retains a message if it is not deleted by a consumer. Why: Allows buffering messages during prolonged consumer outages without data loss. |
| Enable Dead-Letter Queue (sqsEnableDlq) | false | Configures a redrive policy that automatically shifts poison-pill messages to a designated DLQ after repeated failures. Why: Critical for production resilience to prevent malformed payloads from crashing workers indefinitely. |
| Max Receive Count (queueMaxReceiveCount) | 5 | The number of times a message can be delivered to consumers before being routed to the dead-letter queue. Why: Defines retry budget for transient worker exceptions (typically 3 to 5). |
| Content-Based Deduplication (sqsContentBasedDeduplication) | false | Automatically generates a deduplication ID from the SHA-256 hash of the message body. Why: Eliminates duplicate message deliveries without requiring producer code to generate unique tokens. |
Practice Labs Using Amazon Simple Queue Service (SQS)
Tight Coupling in Transaction Processing
Decouple the architecture by placing an Amazon SQS queue between the producer and consumer.…
SAA-14E-Commerce Flash Sale: EventBridge Dead-Letter Queue (DLQ) Delivery Blackhole
Configure the EventBridge rule to route failed execution events to sqs-order-dlq.…
SAA-21Decouple Synchronous Order Spike with SQS + DLQ
Buffer incoming orders asynchronously using an Amazon SQS queue with a Dead-Letter Queue (DLQ) before the work…
BUILD-04Build: Decoupled Asynchronous Flash Sale Order Queue
Build an architecture with an EC2 producer, Amazon SQS queue, Lambda consumer, and DynamoDB storage, wired seq…
BUILD-11Build: Event-Driven Serverless Order Pipeline
Build an event-driven architecture with API Gateway, Ingestion Lambda, EventBridge Bus, SQS Queue, SQS DLQ, Wo…
Frequently Asked Questions
Where does Amazon Simple Queue Service (SQS) live inside an AWS VPC architecture?
Valid container placement: Regional / Global Managed Scope (Outside VPC Subnets). Buffers asynchronous spikes between distributed services, prevents downstream component overload, absorbs high-throughput bursts, and provides dead-letter redrive (DLQ) for poison-pill message debugging.
When should I use Amazon Simple Queue Service (SQS) on the AWS SAA-C03 exam?
Use to decouple microservices and smooth bursty load; pair with a Dead-Letter Queue (DLQ) for failed message inspection.
Can I simulate Amazon Simple Queue Service (SQS) packet routing without an AWS account?
Yes. CloudTracer simulates Amazon Simple Queue Service (SQS) along with 53 AWS services directly in your browser and exports production Terraform HCL.