Skip to content

Instantly share code, notes, and snippets.

@thomaspoignant
Created July 16, 2021 16:01
Show Gist options
  • Save thomaspoignant/672bf5f17b7971fb81406220a33a33a2 to your computer and use it in GitHub Desktop.
Save thomaspoignant/672bf5f17b7971fb81406220a33a33a2 to your computer and use it in GitHub Desktop.
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