Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork4.5k
Open
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 entryin the batch request contains an impermissible character: my.message.idaws 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 entryin the batch request is too long: myreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongid
How are you starting LocalStack?
With a docker-compose file
Steps To Reproduce
How are you starting localstack (e.g.,bin/localstack command, arguments, ordocker-compose.yml)
services:localstack:image:localstack/localstack:4.12.0container_name:localstackenvironment: -DEBUG=1 -LS_LOG=info -SERVICES=events,lambda,s3,secretsmanager,sns,sqs -HOSTNAME=localstack -LAMBDA_REMOVE_CONTAINERS=falsevolumes: -./images/localstack:/etc/localstack/init/ready.d -/var/run/docker.sock:/var/run/docker.sockports: -'4566:4566'
Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)
awslocal sns create-topic --name my-topic-localawslocal 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: b570b3ee2
Anything else?
Similar to#7312