Skip to main content

SQS

Protocol: Query (XML) and JSON 1.0 (both supported)
Endpoint: POST http://localhost:4566/
SQS supports Standard and FIFO queues, dead-letter queues, visibility timeout, and batch operations. Queue URL format:
http://localhost:4566/000000000000/<queue-name>
ActionDescription
CreateQueueCreate a standard or FIFO queue
DeleteQueueDelete a queue
ListQueuesList all queues
GetQueueUrlLook up a queue URL by name
GetQueueAttributesGet queue configuration attributes
SetQueueAttributesUpdate queue configuration
SendMessageSend a message to a queue
SendMessageBatchSend up to 10 messages in one call
ReceiveMessagePoll for messages
DeleteMessageAcknowledge and delete a message
DeleteMessageBatchDelete multiple messages at once
ChangeMessageVisibilityExtend or reset a message’s visibility timeout
ChangeMessageVisibilityBatchChange visibility for multiple messages
PurgeQueueDelete all messages in a queue
TagQueueAdd tags to a queue
UntagQueueRemove tags from a queue
ListQueueTagsList tags on a queue
ListDeadLetterSourceQueuesFind queues that use this queue as DLQ
StartMessageMoveTaskStart a DLQ redrive task
ListMessageMoveTasksList DLQ redrive tasks

Configuration

floci:
  services:
    sqs:
      enabled: true
      default-visibility-timeout: 30  # Seconds
      max-message-size: 262144        # 256 KB

Examples

export AWS_ENDPOINT=http://localhost:4566

# Create a standard queue
aws sqs create-queue --queue-name orders --endpoint-url $AWS_ENDPOINT

# Create a FIFO queue
aws sqs create-queue \
  --queue-name orders.fifo \
  --attributes FifoQueue=true \
  --endpoint-url $AWS_ENDPOINT

# Send a message
QUEUE_URL="$AWS_ENDPOINT/000000000000/orders"
aws sqs send-message \
  --queue-url $QUEUE_URL \
  --message-body '{"event":"order.placed","id":"abc123"}' \
  --endpoint-url $AWS_ENDPOINT

# Receive messages
aws sqs receive-message \
  --queue-url $QUEUE_URL \
  --max-number-of-messages 10 \
  --endpoint-url $AWS_ENDPOINT

# Delete a message (replace RECEIPT_HANDLE with the value from ReceiveMessage)
aws sqs delete-message \
  --queue-url $QUEUE_URL \
  --receipt-handle "RECEIPT_HANDLE" \
  --endpoint-url $AWS_ENDPOINT

# Set up a dead-letter queue
DLQ_ARN=$(aws sqs get-queue-attributes \
  --queue-url $AWS_ENDPOINT/000000000000/orders-dlq \
  --attribute-names QueueArn \
  --query Attributes.QueueArn \
  --output text \
  --endpoint-url $AWS_ENDPOINT)

aws sqs set-queue-attributes \
  --queue-url $QUEUE_URL \
  --attributes "{\"RedrivePolicy\":\"{\\\"deadLetterTargetArn\\\":\\\"$DLQ_ARN\\\",\\\"maxReceiveCount\\\":3}\"}" \
  --endpoint-url $AWS_ENDPOINT

SNS

Protocol: Query (XML) and JSON 1.0 (both supported)
Endpoint: POST http://localhost:4566/
SNS supports topics, subscriptions, and real fan-out to SQS queues, Lambda functions, and HTTP endpoints.
ActionDescription
CreateTopicCreate a topic
DeleteTopicDelete a topic
ListTopicsList all topics
GetTopicAttributesGet topic configuration
SetTopicAttributesUpdate topic configuration
SubscribeSubscribe an endpoint (SQS, HTTP, Lambda, email)
UnsubscribeRemove a subscription
ListSubscriptionsList all subscriptions
ListSubscriptionsByTopicList subscriptions for a specific topic
GetSubscriptionAttributesGet subscription settings
SetSubscriptionAttributesUpdate subscription settings
ConfirmSubscriptionConfirm a pending subscription
PublishPublish a message to a topic
PublishBatchPublish up to 10 messages in one call
TagResourceTag a topic
UntagResourceRemove tags from a topic
ListTagsForResourceList tags on a topic
Supported subscription protocols: sqs, lambda, http, https.

Examples

export AWS_ENDPOINT=http://localhost:4566

# Create a topic
TOPIC_ARN=$(aws sns create-topic --name notifications \
  --query TopicArn --output text \
  --endpoint-url $AWS_ENDPOINT)

# Subscribe an SQS queue
QUEUE_ARN=$(aws sqs get-queue-attributes \
  --queue-url $AWS_ENDPOINT/000000000000/orders \
  --attribute-names QueueArn \
  --query Attributes.QueueArn --output text \
  --endpoint-url $AWS_ENDPOINT)

aws sns subscribe \
  --topic-arn $TOPIC_ARN \
  --protocol sqs \
  --notification-endpoint $QUEUE_ARN \
  --endpoint-url $AWS_ENDPOINT

# Publish a message
aws sns publish \
  --topic-arn $TOPIC_ARN \
  --message '{"event":"user.registered"}' \
  --endpoint-url $AWS_ENDPOINT

# Fan-out: verify the SQS queue received the message
aws sqs receive-message \
  --queue-url $AWS_ENDPOINT/000000000000/orders \
  --endpoint-url $AWS_ENDPOINT

EventBridge

Protocol: JSON 1.1 (X-Amz-Target: AmazonEventBridge.*)
Endpoint: POST http://localhost:4566/
EventBridge supports custom event buses, rules with event patterns, and targets including SQS, SNS, and Lambda. A default event bus is always available.
ActionDescription
CreateEventBusCreate a custom event bus
DeleteEventBusDelete an event bus
DescribeEventBusGet event bus details
ListEventBusesList all event buses
PutRuleCreate or update a rule with a schedule or event pattern
DeleteRuleDelete a rule
DescribeRuleGet rule details
ListRulesList rules
EnableRuleEnable a disabled rule
DisableRuleDisable a rule
PutTargetsAdd targets to a rule
RemoveTargetsRemove targets from a rule
ListTargetsByRuleList targets for a rule
PutEventsPublish custom events to an event bus

Examples

export AWS_ENDPOINT=http://localhost:4566

# Create a custom event bus
aws events create-event-bus \
  --name my-bus \
  --endpoint-url $AWS_ENDPOINT

# Create a rule matching a pattern
aws events put-rule \
  --name order-placed-rule \
  --event-bus-name my-bus \
  --event-pattern '{"source":["com.myapp"],"detail-type":["OrderPlaced"]}' \
  --state ENABLED \
  --endpoint-url $AWS_ENDPOINT

# Add a Lambda target
aws events put-targets \
  --rule order-placed-rule \
  --event-bus-name my-bus \
  --targets '[{
    "Id": "process-order",
    "Arn": "arn:aws:lambda:us-east-1:000000000000:function:process-order"
  }]' \
  --endpoint-url $AWS_ENDPOINT

# Publish an event
aws events put-events \
  --entries '[{
    "Source": "com.myapp",
    "DetailType": "OrderPlaced",
    "Detail": "{\"orderId\":\"123\",\"amount\":99.99}",
    "EventBusName": "my-bus"
  }]' \
  --endpoint-url $AWS_ENDPOINT

# Send to the default bus
aws events put-events \
  --entries '[{"Source":"myapp","DetailType":"test","Detail":"{}"}]' \
  --endpoint-url $AWS_ENDPOINT

Kinesis

Protocol: JSON 1.1 (X-Amz-Target: Kinesis_20131202.*)
Endpoint: POST http://localhost:4566/
Kinesis supports streams with multiple shards, enhanced fan-out consumers, shard split and merge operations, and KMS encryption.
ActionDescription
CreateStreamCreate a stream
DeleteStreamDelete a stream
ListStreamsList all streams
DescribeStreamGet stream details and shard info
DescribeStreamSummaryLightweight stream description
RegisterStreamConsumerRegister an enhanced fan-out consumer
DeregisterStreamConsumerRemove a consumer
DescribeStreamConsumerGet consumer details
ListStreamConsumersList consumers for a stream
SubscribeToShardSubscribe to a shard for enhanced fan-out
PutRecordWrite a single record
PutRecordsWrite up to 500 records
GetShardIteratorGet an iterator for reading
GetRecordsRead records from a shard
SplitShardSplit a shard into two
MergeShardsMerge two adjacent shards
AddTagsToStreamTag a stream
RemoveTagsFromStreamRemove tags
ListTagsForStreamList tags
StartStreamEncryptionEnable KMS encryption
StopStreamEncryptionDisable encryption

Examples

export AWS_ENDPOINT=http://localhost:4566

# Create a stream
aws kinesis create-stream \
  --stream-name events \
  --shard-count 2 \
  --endpoint-url $AWS_ENDPOINT

# Put a record
aws kinesis put-record \
  --stream-name events \
  --partition-key "user-123" \
  --data '{"event":"page_view","page":"/home"}' \
  --endpoint-url $AWS_ENDPOINT

# Get a shard iterator
SHARD_ID=$(aws kinesis describe-stream \
  --stream-name events \
  --query 'StreamDescription.Shards[0].ShardId' --output text \
  --endpoint-url $AWS_ENDPOINT)

ITERATOR=$(aws kinesis get-shard-iterator \
  --stream-name events \
  --shard-id $SHARD_ID \
  --shard-iterator-type TRIM_HORIZON \
  --query ShardIterator --output text \
  --endpoint-url $AWS_ENDPOINT)

# Read records
aws kinesis get-records \
  --shard-iterator $ITERATOR \
  --endpoint-url $AWS_ENDPOINT

Build docs developers (and LLMs) love