Destinations

AWS SQS

Send events to an Amazon SQS queue.

Configuration

Config

FieldTypeRequiredDescription
config.queue_urlstringYesThe SQS queue URL
config.endpointstringNoCustom endpoint URL (for LocalStack, etc.)

Credentials

FieldTypeRequiredDescription
credentials.keystringYesAWS Access Key ID
credentials.secretstringYesAWS Secret Access Key
credentials.sessionstringNoAWS Session Token (for temporary credentials)

Example

curl --location 'https://<OUTPOST_API_URL>/api/v1/<TENANT_ID>/destinations' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer <API_KEY>' \ --data '{ "type": "aws_sqs", "topics": ["orders"], "config": { "queue_url": "https://sqs.us-east-1.amazonaws.com/123456789012/my-queue" }, "credentials": { "key": "<AWS_ACCESS_KEY_ID>", "secret": "<AWS_SECRET_ACCESS_KEY>" } }'
sh

Message Format

Events are sent as SQS messages with:

  • Message Body: The event's data field (JSON)
  • Message Attributes: Event metadata

Example Message

If you publish an event:

{ "topic": "orders", "data": { "order_id": "123", "status": "created" }, "metadata": { "source": "checkout-service" } }
json

Message Body:

{ "order_id": "123", "status": "created" }
json

Message Attributes:

The metadata attribute contains a JSON string with system metadata and any event metadata:

AttributeTypeDescription
metadataStringJSON containing event-id, topic, timestamp, plus any event metadata

Example value:

{"event-id": "evt_123", "topic": "orders", "timestamp": "1704067200", "source": "checkout-service"}
json

IAM Permissions

The IAM user or role needs the following permission:

{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "sqs:SendMessage", "Resource": "arn:aws:sqs:*:*:my-queue" } ] }
json

Using with LocalStack

For local development with LocalStack, set the config.endpoint field:

{ "type": "aws_sqs", "topics": ["orders"], "config": { "queue_url": "http://localhost:4566/000000000000/my-queue", "endpoint": "http://localhost:4566" }, "credentials": { "key": "test", "secret": "test" } }
json