-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Open
Labels
aws:snsAmazon Simple Notification ServiceAmazon Simple Notification Servicestatus: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
SNS has some validation on the entry ids in batch publish requests including allowed characters and length: https://docs.aws.amazon.com/sns/latest/api/API_PublishBatchRequestEntry.html
LocalStack does not currently perform this validation
awslocal sns publish-batch --topic-arn "arn:aws:sns:us-east-1:112233445566:my-topic-local" --publish-batch-request-entries '[{"Id": "message.id", "Message": "{}"}]'
{
"Successful": [
{
"Id": "message.id",
"MessageId": "3a6c4dfe-2329-47a7-a8aa-905abdc04a43"
}
],
"Failed": []
}
awslocal sns publish-batch --topic-arn "arn:aws:sns:us-east-1:112233445566:my-topic-local" --publish-batch-request-entries '[{"Id": "myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongid", "Message": "{}"}]'
{
"Successful": [
{
"Id": "myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongid",
"MessageId": "cf07aa73-9357-427d-b2b0-f15b3eb76c82"
}
],
"Failed": []
}Expected Behavior
Publishing in AWS gives these errors:
aws sns publish-batch --topic-arn "arn:aws:sns:eu-west-2:*:my-topic" --publish-batch-request-entries '[{"Id": "my.message.id", "Message": "{}"}]'
An error occurred (InvalidBatchEntryId) when calling the PublishBatch operation: The Id of a batch entry in the batch request contains an impermissible character: my.message.id
aws sns publish-batch --topic-arn "arn:aws:sns:eu-west-2:*:my-topic" --publish-batch-request-entries '[{"Id": "myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongid", "Message": "{}"}]'
An error occurred (InvalidBatchEntryId) when calling the PublishBatch operation: The Id of a batch entry in the batch request is too long: myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongidHow are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)
services:
localstack:
image: localstack/localstack:4.12.0
container_name: localstack
environment:
- DEBUG=1
- LS_LOG=info
- SERVICES=events,lambda,s3,secretsmanager,sns,sqs
- HOSTNAME=localstack
- LAMBDA_REMOVE_CONTAINERS=false
volumes:
- ./images/localstack:/etc/localstack/init/ready.d
- /var/run/docker.sock:/var/run/docker.sock
ports:
- '4566:4566'Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
awslocal sns create-topic --name my-topic-local
awslocal sns publish-batch --topic-arn "arn:aws:sns:us-east-1:112233445566:my-topic-local" --publish-batch-request-entries '[{"Id": "message.id", "Message": "{}"}]'Environment
- OS: macOS 15.6.1
- LocalStack:
LocalStack version: 4.12.0
LocalStack build date: 2025-12-11
LocalStack build git hash: b570b3ee2Anything else?
Similar to #7312
Metadata
Metadata
Assignees
Labels
aws:snsAmazon Simple Notification ServiceAmazon Simple Notification Servicestatus: backlogTriaged but not yet being worked onTriaged but not yet being worked ontype: bugBug reportBug report