SQS FIFO Deployer
An AWS CloudOps agent skill that provisions Amazon SQS FIFO queues with correct defaults. The skill walks the operator through FIFO queue attributes (FifoQueue=true, ContentBasedDeduplication, DeduplicationScope, ThroughputLimit mode), message group ID for ordering, deduplication strategies (content-based vs explicit MessageDeduplicationId), high-throughput FIFO mode, DLQ configuration for FIFO queues, visibility timeout tuning, SSE-KMS encryption, access policy, redrive policy, and cross-account delivery. It captures queue topology and ordering requirements, explains why each default matters, and emits a READY_TO_DEPLOY checklist with copy-pasteable verification commands.
Activation keywords
create SQS FIFO queue, FIFO queue deduplication, SQS message group ID, high throughput FIFO, SQS DLQ redrive, SQS visibility timeout, SQS SSE KMS, SQS FIFO cross account.
STRICT output contract
When this skill is invoked with an SQS FIFO provisioning request
(create a FIFO queue, configure deduplication, set up message group
ordering, enable high-throughput mode, attach a DLQ, configure cross-
account delivery, or a partial configuration), the agent MUST respond
with the READY_TO_DEPLOY checklist defined in the "Output format"
section using the literal all-caps labels SQS_FIFO:, VERDICT:,
CHECKLIST:, and VERIFICATION_COMMANDS:. Do NOT preface the
checklist with prose, headings, or disclaimers — emit the block as
the first lines of the response. This contract is what assertion-based
evals and downstream provisioning pipelines rely on; deviating from
the literal labels breaks automation silently.
If any prerequisite is missing, the verdict is PREREQUISITES_MISSING
with a specific gap citation in the checklist (marked [x]), and
READY_TO_DEPLOY MUST NOT also appear.
Quick navigation
| Section | When to read |
|---|---|
| Prerequisites | Always — verify before provisioning |
| Step 1 — FIFO queue attributes | Core FIFO model |
| Step 2 — Message group ID for ordering | Ordering guarantee |
| Step 3 — Deduplication (content-based vs explicit) | Dedup strategy |
| Step 4 — High-throughput FIFO mode | Throughput scaling |
| Step 5 — DLQ for FIFO | Dead-letter handling |
| Step 6 — Visibility timeout tuning | Consumer lifecycle |
| Step 7 — SSE-KMS encryption | Encryption at rest |
| Step 8 — Access policy | Cross-account + producer/consumer |
| Step 9 — Redrive policy | DLQ movement |
| Step 10 — Cross-account delivery | Cross-account producers |
| Step 11 — Recent features | Latest |
| NEVER do these things | Review before signing off |
| Output format | The literal checklist template |
| references/deduplication-and-ordering.md | Dedup + ordering detail |
| references/dlq-and-throughput.md | DLQ + throughput detail |
Mindset
→ Moved to references/advanced-patterns.md — the three-misconception mindset behind every FIFO provisioning decision.
Configuration dependency graph (novel heuristic)
SQS FIFO queue configurations are NOT independent. The queue type (FIFO) must be set at creation and is immutable. Deduplication scope interacts with throughput mode. The DLQ must be a FIFO queue (Standard DLQs cannot be used with FIFO queues). Visibility timeout interacts with message processing time. Use this graph to sequence provisioning.
| Configuration | Hard dependencies (API error without) | Silent failure / immutability | Enables downstream |
|---|---|---|---|
| Queue type (FifoQueue=true) | Queue name ends with .fifo |
IMMUTABLE after creation — cannot convert Standard to FIFO | ordering, deduplication |
| Content-based deduplication | FifoQueue=true | when enabled, SQS hashes message body for dedup ID; when disabled, producer must send explicit dedup ID | automatic dedup |
| DeduplicationScope | FifoQueue=true; ThroughputLimit must also be set | default is queue; changing to messageGroup enables per-group dedup |
high-throughput mode |
| ThroughputLimit | FifoQueue=true; DeduplicationScope must also be set | default is perQueue; changing to messagesPerGroupId enables per-group throughput |
high-throughput mode |
| High-throughput FIFO | DeduplicationScope=messageGroup + ThroughputLimit=messagesPerGroupId | both attributes must be set together; setting only one is rejected | 300 TPS per group |
| DLQ (redrive policy) | DLQ must be a FIFO queue; DLQ must exist before redrive policy is attached | a Standard DLQ CANNOT be used with a FIFO queue — API rejects | dead-letter handling |
| Visibility timeout | nothing — queue-level attribute | must be >= consumer processing time; too low causes duplicate processing | consumer lifecycle |
| SSE-KMS encryption | KMS key exists (if customer-managed) | encryption is queue-level; all messages encrypted with the key | encryption at rest |
| Access policy | nothing — queue-level attribute | cross-account producers/consumers need explicit Principal in policy | cross-account delivery |
| Redrive policy | DLQ ARN known | deadLetterTargetArn + maxReceiveCount; maxReceiveCount must be > 0 | DLQ movement |
| Cross-account delivery | Access policy on the queue permits sender account | sender account needs sqs:SendMessage permission | cross-account producers |
The message-group-and-deduplication row is the one a baseline model misses. Creating the FIFO queue is necessary but NOT sufficient. The message group ID determines ordering parallelism. The deduplication strategy (content-based vs explicit) determines duplicate prevention. The high-throughput mode requires BOTH DeduplicationScope and ThroughputLimit to be set together. The procedure below forces an explicit decision on each.
Cross-dependency gotchas:
- The
.fifosuffix in the queue name is MANDATORY. A queue namedmy-queuewithout.fifocannot have FifoQueue=true. - The DLQ for a FIFO queue MUST also be a FIFO queue. A Standard DLQ is rejected by the API.
- High-throughput mode requires setting BOTH DeduplicationScope and ThroughputLimit. Setting only one results in an API error.
- ContentBasedDeduplication=true generates dedup IDs from message body hashes. If the producer sends explicit dedup IDs, this attribute is ignored for those messages.
- Visibility timeout must be longer than the consumer's processing time. If it expires before the consumer deletes the message, the message becomes visible again and may be processed twice.
Expert heuristic: message group ID partitioning for parallelism
→ Moved to references/deduplication-and-ordering.md — the group-ID partitioning/parallelism model.
Expert heuristic: deduplication ID management
→ Moved to references/deduplication-and-ordering.md — content-based vs explicit vs per-group dedup strategies and the 5-minute window.
Expert heuristic: high-throughput FIFO quota caveats
→ Moved to references/dlq-and-throughput.md — dedup-scope, quota, cost, and rollback caveats.
Prerequisites (verify before provisioning)
Before emitting provisioning commands, verify these prerequisites. If any are missing, the verdict is PREREQUISITES_MISSING.
| Prerequisite | Why it matters | How to verify |
|---|---|---|
Queue name ends with .fifo |
Mandatory for FIFO queues | Verify naming convention |
| FIFO vs Standard decision | FIFO type is immutable after creation | Assess ordering requirements |
| Deduplication strategy decided | Content-based vs explicit dedup ID | Assess dedup requirements |
| DLQ is also FIFO (if using DLQ) | Standard DLQ cannot attach to FIFO queue | aws sqs get-queue-attributes --queue-url <dlq-url> --attribute-names FifoQueue |
| KMS key ARN (if using SSE-KMS) | Customer-managed key for encryption | aws kms describe-key --key-id <id> |
| Consumer processing time (for visibility timeout) | Visibility timeout must exceed processing time | Assess consumer workload |
| Cross-account IDs (if cross-account delivery) | Access policy needs principal account IDs | aws sts get-caller-identity |
| IAM permissions for SQS actions | sqs:CreateQueue, SetQueueAttributes, etc. | aws iam list-attached-role-policies |
If any prerequisite is missing, output VERDICT: PREREQUISITES_MISSING
and cite the specific gap.
Step 1 — FIFO queue attributes
FIFO queues require specific attributes at creation time. These are immutable after the queue is created.
QUEUE_URL=$(aws sqs create-queue \
--queue-name "order-processing.fifo" \
--attributes "FifoQueue=true,ContentBasedDeduplication=true,VisibilityTimeout=60,DelaySeconds=0,MessageRetentionPeriod=345600" \
--query 'QueueUrl' --output text)
echo "Queue URL: $QUEUE_URL"
Key FIFO attributes:
| Attribute | Default | Description |
|---|---|---|
| FifoQueue | false (must set true) | Enables FIFO ordering — immutable after creation |
| ContentBasedDeduplication | false | Generates dedup ID from message body hash |
| DeduplicationScope | queue | Set to messageGroup for high-throughput |
| ThroughputLimit | perQueue | Set to messagesPerGroupId for high-throughput |
| VisibilityTimeout | 30 | Seconds before message becomes visible again after receive |
| MessageRetentionPeriod | 345600 (4 days) | How long messages are retained |
| DelaySeconds | 0 | Per-queue delay for message delivery |
Verify the queue:
aws sqs get-queue-attributes \
--queue-url "$QUEUE_URL" \
--attribute-names "QueueArn,FifoQueue,ContentBasedDeduplication,DeduplicationScope,ThroughputLimit,VisibilityTimeout"
Step 2 — Message group ID for ordering
The message group ID (MessageGroupId) is the ordering partition.
Messages with the same group ID are processed in FIFO order.
Messages with different group IDs are processed in parallel.
# Send messages with different group IDs (parallel processing)
aws sqs send-message \
--queue-url "$QUEUE_URL" \
--message-body '{"orderId": "order-001", "status": "created"}' \
--message-group-id "customer-123"
aws sqs send-message \
--queue-url "$QUEUE_URL" \
--message-body '{"orderId": "order-002", "status": "created"}' \
--message-group-id "customer-456"
Receive messages:
aws sqs receive-message \
--queue-url "$QUEUE_URL" \
--max-number-of-messages 10 \
--wait-time-seconds 20
Key: messages from the same group are returned in order. Messages from different groups can be received by different consumers in parallel.
Step 3 — Deduplication (content-based vs explicit)
Content-based deduplication
When ContentBasedDeduplication=true, SQS generates a deduplication
ID from the SHA-256 hash of the message body.
# Content-based dedup — same body within 5 min is NOT re-enqueued
aws sqs send-message \
--queue-url "$QUEUE_URL" \
--message-body '{"orderId": "order-001"}' \
--message-group-id "customer-123"
# This second message with the SAME body is silently dropped (within 5 min)
aws sqs send-message \
--queue-url "$QUEUE_URL" \
--message-body '{"orderId": "order-001"}' \
--message-group-id "customer-123"
Explicit deduplication ID
When ContentBasedDeduplication=false (or overridden), the producer
sends an explicit MessageDeduplicationId.
# Explicit dedup — producer controls dedup semantics
aws sqs send-message \
--queue-url "$QUEUE_URL" \
--message-body '{"orderId": "order-001", "timestamp": "2026-01-01T10:00:00Z"}' \
--message-group-id "customer-123" \
--message-deduplication-id "order-001"
Key: use explicit dedup when the same logical message may have different bodies (e.g., retries with updated timestamps). Use a stable business key as the dedup ID.
Step 4 — High-throughput FIFO mode
High-throughput FIFO mode requires setting BOTH DeduplicationScope and ThroughputLimit. This enables per-message-group throughput scaling.
# High-throughput FIFO queue
QUEUE_URL=$(aws sqs create-queue \
--queue-name "high-throughput-orders.fifo" \
--attributes "FifoQueue=true,DeduplicationScope=messageGroup,ThroughputLimit=messagesPerGroupId,VisibilityTimeout=60" \
--query 'QueueUrl' --output text)
Critical: both DeduplicationScope=messageGroup and
ThroughputLimit=messagesPerGroupId must be set together. Setting
only one results in an API error.
Throughput comparison:
Standard FIFO: 300 TPS per API action (shared across all groups)
High-throughput FIFO: 300 TPS per API action PER message group
10 groups = 3,000 TPS
100 groups = 30,000 TPS
Step 5 — DLQ for FIFO
The DLQ for a FIFO queue MUST also be a FIFO queue. A Standard queue cannot serve as a DLQ for a FIFO queue.
DLQ_URL=$(aws sqs create-queue \
--queue-name "order-processing-dlq.fifo" \
--attributes "FifoQueue=true" --query 'QueueUrl' --output text)
DLQ_ARN=$(aws sqs get-queue-attributes --queue-url "$DLQ_URL" \
--attribute-names "QueueArn" --query 'Attributes.QueueArn' --output text)
aws sqs set-queue-attributes --queue-url "$QUEUE_URL" \
--attributes "RedrivePolicy={\"deadLetterTargetArn\":\"${DLQ_ARN}\",\"maxReceiveCount\":\"5\"}"
Key: maxReceiveCount determines how many times a message is
received before it is moved to the DLQ. See Step 9 for redrive.
Step 6 — Visibility timeout tuning
The visibility timeout determines how long a message is invisible to other consumers after being received. If the consumer does not delete the message before the timeout expires, the message becomes visible again and may be processed by another consumer (causing duplicates).
aws sqs set-queue-attributes --queue-url "$QUEUE_URL" \
--attributes "VisibilityTimeout=120"
Guidelines: set the visibility timeout to AT LEAST 2x the expected
processing time. Use change-message-visibility for per-message
overrides. See references/dlq-and-throughput.md for the full tuning
table.
Step 7 — SSE-KMS encryption
SSE-KMS encrypts messages at rest using a KMS key (AWS-managed or customer-managed).
aws sqs set-queue-attributes --queue-url "$QUEUE_URL" \
--attributes "KmsMasterKeyId=arn:aws:kms:us-east-1:123456789012:key/abc123,KmsDataKeyReusePeriodSeconds=300"
The KMS key policy must allow SQS to kms:GenerateDataKey and
kms:Decrypt. For cross-account producers, the key policy must also
allow those accounts. See references/dlq-and-throughput.md for KMS
key policy examples.
Step 8 — Access policy
The queue access policy controls who can send and receive messages.
By default, only the queue owner can access the queue. For
cross-account delivery, grant sqs:SendMessage to the producer's
account and ensure the producer's IAM role also permits it.
Step 9 — Redrive policy
The redrive policy defines the DLQ and maxReceiveCount. Messages
that exceed maxReceiveCount are moved to the DLQ.
# Redrive from DLQ back to the main queue
aws sqs start-message-move-task \
--source-arn "$DLQ_ARN" \
--destination-arn "$MAIN_QUEUE_ARN" --query 'TaskHandle' --output text
Key: StartMessageMoveTask is the modern API for moving messages
from a DLQ back to the source queue. It preserves message attributes.
Step 10 — Cross-account delivery
Cross-account delivery allows producers in one account to send messages to a FIFO queue in another account. This requires:
- The queue access policy grants
sqs:SendMessageto the producer account. - The producer's IAM role allows
sqs:SendMessageto the queue. - If SSE-KMS is enabled, the KMS key policy allows the producer account.
See references/dlq-and-throughput.md for a full cross-account
access policy example with Terraform.
Key: for FIFO queues, cross-account messages must include both
MessageGroupId and MessageDeduplicationId (or the queue must have
ContentBasedDeduplication=true).
Step 11 — Recent features
→ Moved to references/advanced-patterns.md — recent AWS features (2023-2026).
NEVER do these things
NEVER use a Standard queue as a DLQ for a FIFO queue. The DLQ for a FIFO queue MUST also be a FIFO queue. The API will reject a redrive policy pointing to a Standard queue DLQ.
NEVER omit the
.fifosuffix in the queue name. FIFO queue names MUST end with.fifo. The API rejectscreate-queue --queue-name "my-queue" --attributes "FifoQueue=true"without the suffix.NEVER use a single message group ID for all messages. A single group ID serializes ALL messages through one consumer, eliminating parallelism. Use per-entity group IDs (e.g., customer ID, order ID) to scale throughput.
NEVER set DeduplicationScope or ThroughputLimit alone. High-throughput FIFO mode requires BOTH
DeduplicationScope=messageGroupANDThroughputLimit=messagesPerGroupId. Setting only one results in an API error.NEVER assume content-based deduplication catches logical duplicates. Content-based dedup hashes the message BODY. Two messages with different bodies but the same logical content (e.g., an order retry with a new timestamp) are NOT deduplicated. Use explicit
MessageDeduplicationIdfor semantic dedup.NEVER set visibility timeout lower than the consumer processing time. If the timeout expires before the consumer deletes the message, the message becomes visible again and may be processed twice. Set the timeout to at least 2x the expected processing time.
NEVER assume high-throughput mode is free. High-throughput FIFO has a different pricing tier (higher per-request cost), changes deduplication scope from queue-level to group-level, and counts against a separate account quota. Evaluate all three before enabling.
NEVER forget MessageGroupId when sending to a FIFO queue. Every message sent to a FIFO queue MUST include a
MessageGroupId. Without it, the API rejects the message.NEVER convert a Standard queue to FIFO or vice versa. The queue type (FifoQueue attribute) is IMMUTABLE after creation. To change types, create a new queue and migrate consumers/producers.
NEVER assume cross-account delivery works without access policy AND IAM permissions. Cross-account delivery requires BOTH: (1) the queue access policy grants
sqs:SendMessageto the producer's account, AND (2) the producer's IAM role allowssqs:SendMessageto the queue. Both sides must be configured.
Output format
SQS_FIFO: <queue-name> (<queue-url>)
VERDICT: READY_TO_DEPLOY | PREREQUISITES_MISSING
CHECKLIST:
[✓|✗] Queue name: <name>.fifo
[✓|✗] FifoQueue: true (immutable)
[✓|✗] ContentBasedDeduplication: true | false (explicit dedup ID)
[✓|✗] DeduplicationScope: queue | messageGroup
[✓|✗] ThroughputLimit: perQueue | messagesPerGroupId
[✓|✗] High-throughput mode: enabled (per-group dedup + throughput) | disabled
[✓|✗] Message group ID strategy: <per-entity|single-group> — <description>
[✓|✗] Visibility timeout: <seconds> (consumer processing time estimate: <seconds>)
[✓|✗] DLQ: <dlq-name>.fifo (<dlq-arn>) — maxReceiveCount: <count> | None
[✓|✗] SSE-KMS encryption: enabled (<key-arn>) | disabled
[✓|✗] Access policy: <same-account|cross-account> — <description>
[✓|✗] Redrive policy: configured (maxReceiveCount=<count>) | not configured
[✓|✗] Cross-account delivery: enabled (producer accounts: <list>) | disabled
[✓|✗] Tags: <key=value list>
VERIFICATION_COMMANDS:
aws sqs get-queue-attributes --queue-url <url> --attribute-names All
aws sqs get-queue-attributes --queue-url <dlq-url> --attribute-names All
Worked example — standard FIFO with deduplication, DLQ, and SSE-KMS
SQS_FIFO: order-processing.fifo (https://sqs.us-east-1.amazonaws.com/123456789012/order-processing.fifo)
VERDICT: READY_TO_DEPLOY
CHECKLIST:
[✓] Queue name: order-processing.fifo
[✓] FifoQueue: true (immutable)
[✓] ContentBasedDeduplication: false (explicit dedup ID)
[✓] DeduplicationScope: queue
[✓] ThroughputLimit: perQueue
[✓] High-throughput mode: disabled
[✓] Message group ID strategy: per-entity (customer ID) — per-customer ordering with parallel processing
[✓] Visibility timeout: 120 (consumer processing time estimate: 60s)
[✓] DLQ: order-processing-dlq.fifo (arn:aws:sqs:us-east-1:123456789012:order-processing-dlq.fifo) — maxReceiveCount: 5
[✓] SSE-KMS encryption: enabled (arn:aws:kms:us-east-1:123456789012:key/abc123)
[✓] Access policy: cross-account — producer account 999999999999 granted sqs:SendMessage
[✓] Redrive policy: configured (maxReceiveCount=5)
[✓] Cross-account delivery: enabled (producer accounts: 999999999999)
[✓] Tags: Environment=production, Application=order-service
VERIFICATION_COMMANDS:
aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/123456789012/order-processing.fifo --attribute-names All
aws sqs get-queue-attributes --queue-url https://sqs.us-east-1.amazonaws.com/123456789012/order-processing-dlq.fifo --attribute-names All
Error handling
→ Moved to references/error-handling.md — symptom → cause → fix for delivery, duplicate processing, throughput, DLQ, and cross-account failures.
References (load on demand)
- references/advanced-patterns.md — Mindset (three FIFO misconceptions) and recent AWS features (2023-2026).
- references/error-handling.md — error-handling deep dive: message delivery, duplicate processing, throughput limits, DLQ attachment, cross-account failures.
- references/deduplication-and-ordering.md — pre-existing; extended with the message-group-ID partitioning and deduplication-ID management heuristics moved from SKILL.md.
- references/dlq-and-throughput.md — pre-existing; extended with the high-throughput FIFO quota caveats moved from SKILL.md.
Domain
AWS CloudOps / Amazon SQS FIFO Queue Provisioning and Message Ordering.
AWS documentation
- SQS FIFO queues — https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-fifo-queues.html
- Deduplication — https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html
- High-throughput FIFO — https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-queues.html
- DLQ and redrive — https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html
- SSE-KMS — https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html