Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
localstack SNS/SQS
docker run --rm -it -p 4566:4566 -p 4571:4571 localstack/localstack
# create topic
aws --region=eu-west-1 --endpoint-url=http://localhost:4566 sns create-topic --name responseTopic
# list topic and get ARN
aws --region=eu-west-1 --endpoint-url=http://localhost:4566 sns list-topics
# create SQS queue
aws --region=eu-west-1 --endpoint-url=http://localhost:4566 sqs create-queue --queue-name test-queue
# Create SNS notification to SQS
aws --region=eu-west-1 --endpoint-url=http://localhost:4566 sns subscribe --topic-arn arn:aws:sns:us-east-1:000000000000:responseTopic --protocol sqs --notification-endpoint http://localhost:4566/000000000000/test-queue
# List content of the SQS queue
aws --region=eu-west-1 --endpoint-url=http://localhost:4566 sqs receive-message --queue-url http://localhost:4566/000000000000/test-queue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment