SQS and SNS

You can have events shipped to an AWS SNS topic or to an AWS SQS queue if you want. Same as webhook, this can be configured directly from the Dashboard.

Authentication

There are 2 ways to configure authentication for SQS and SNS:

  1. Grant Stream’s AWS account permission to use your SQS/SNS resources. (recommended)
  2. Provide your AWS key and secret in the Stream Dashboard.

Role based policy example (SQS)

If you decide to use the first approach, you need to attach a policy to your SQS like this one:

{
  "Sid": "AllowStreamProdAccount",
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::185583345998:root"
  },
  "Action": "SQS:SendMessage",
  "Resource": "arn:aws:sqs:us-west-2:1111111111:customer-sqs-for-stream"
}

Role based policy example (SNS)

If you decide to use the first approach, you need to attach a policy to your SQS like this one:

{
  "Sid": "AllowStreamProdAccount",
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::185583345998:root"
  },
  "Action": "SNS:Publish",
  "Resource": "arn:aws:sns:us-west-2:1111111111:customer-sns-topic"
}

SQS Best Practices

  • Set the maximum message size set to 256 KB
  • Set up a dead-letter queue for your main queue
  • Setup alerts in case the size of the queue is growing too fast
© Getstream.io, Inc. All Rights Reserved.