Only show these results:

Amazon SNS

Amazon Simple Notification Service (Amazon SNS) is a managed messaging service that supports pub/sub messaging and mobile push notifications.

You’ll learn how to add Amazon SNS as a Nylas Stream.

Prerequisites

Before you begin, you must create grants and an integration. Nylas recommends you review the following documentation, based on your data needs:

Create a New Connector

Set up tip

Keep your dashboard open because you'll be frequently referring to the information there.

  1. Go to the Nylas dashboard and select Streams.
  2. Select Amazon SNS.
  3. Choose your data source.
  4. Keep your dashboard open, we'll move onto the next steps and let you know when you need to refer to the dashboard and when to enter information.

Create SNS Topic

  1. Go through the steps in Creating an Amazon SNS topic.
    1. We recommend topic type to be Standard.
  2. Keep your Topic ARN ready, you’ll need this in Create IAM Role.
  3. Copy the Topic ARN into your dashboard into Destination ARN.

The Amazon Console showing the details of an SNS stream topic. The "ARN" and "Topic owner" fields are obscured.

Create an S3 Bucket (Optional)

Create an S3 bucket to stream data that is larger than 256 KB. By default, the AWS SNS Connector will skip publishing data objects larger than 256 KB.

  1. Go to Amazon S3 and create a new bucket.
  2. Select the bucket and click Copy ARN.
  3. Copy the ARN into the dashboard and save the S3 ARN for Create IAM Role.

The Amazon Console showing the details of an SNS stream topic. The "ARN" and "Topic owner" fields are obscured.

Create IAM Role

You’ll need to create an IAM Role that gives Nylas access to write to your SNS topic and your S3 bucket. You’ll be creating a new role and policy.

  1. Go to IAM.

  2. Go to Access management > Roles.

  3. Select Another AWS account.

    1. Account ID - 925176737378
    2. Select Require external ID (Best practice when a third party will assume this role)
    3. In your dashboard, copy the External ID and add it as the External ID into AWS console.

    The Amazon Console displaying the "Specify accounts that can use this role" page. The fields are filled out with demo information.

  4. On the next screen, click Create policy. This will open a new window or tab. You’ll need to keep both the Create role and Create policy windows open.

  5. Select JSON. Depending on if you are using S3 or not, copy the JSON for your policy. Modify the highlighted items with <YOUR-TOPIC-ARN> and <YOUR-S3-BUCKET-ARN>.


    {
    "Version": "2012-10-17",
    "Statement": [
    {
    "Sid": "VisualEditor0",
    "Effect": "Allow",
    "Action": "sns:Publish",
    "Resource": "<YOUR-TOPIC-ARN>"
    }
    ]
    }
    {
    "Version": "2012-10-17",
    "Statement": [{
    "Sid": "VisualEditor0",
    "Effect": "Allow",
    "Action": [
    "s3:*Object*",
    "sns:Publish"
    ],
    "Resource": [
    "<YOUR-S3-BUCKET-ARN>/*",
    "<YOUR-TOPIC-ARN>"
    ]
    }]
    }
  6. Name the policy nylas-streams-write-policy and save.

  7. Go back to the Create role window and click refresh.

  8. Search for nylas-streams-write-policy and select the policy.

  9. Name the role nylas-streams-write-role and create the role.

  10. Copy the role ARN, and add it your dashboard in IAM Role ARN.

  11. You can save your Nylas Stream.

  12. It will take a few minutes for the Stream to activate.

Test Your Stream

To test for receiving data, setup a subscription in AWS that's listening to the configured SNS topic. View the link below for more about the Amazon configuration.

The sections below detail pulling new messages using SQS.

Poll for New Messages

  1. Go to SQS and select the queue you created for your Stream.
  2. Click Poll for messages

The Amazon Web Services Console showing the "Send and receive messages" page.

Message

If you selected message.create as your data source, create a new email message.

Grants

If you selected grants as your data source, you’ll get notifications when a grant expires or when an account is granted access to an Integration.