AWS Kinesis integration

Kinesis integrations enable you to automatically forward events that occur in Ably to AWS Kinesis streams.

Create a Kinesis integration

To create a Kinesis integration in your dashboard:

  1. Login and select the application you wish to integrate with Kinesis.
  2. Click the Integrations tab.
  3. Click the New Integration Rule button.
  4. Choose Firehose.
  5. Choose AWS Kinesis.
  6. Configure the Kinesis settings.
  7. Click Create.

You can also create a Kinesis integration using the Control API.

Settings

The following settings are available when creating a Kinesis integration:

SettingDescription
AWS RegionSpecifies the AWS region of your Kinesis Stream.
Stream NameDefines the name of the Kinesis Stream to connect to.
AWS authentication schemeChoose the authentication method. Either AWS credentials or ARN of an assumable role.
AWS CredentialsIf using AWS credentials, enter the values in key:value format.
ARN of an assumable roleIf using ARN of an assumable role, enter the ARN of the role that Ably can assume to access your Kinesis stream.
SourceSpecifies the event types being sent to Kinesis.
Channel filterFilters the source channels based on a regular expression.
EncodingSpecifies the encoding format of messages. Either JSON or MsgPack.
EnvelopedCheckbox to set whether messages should be enveloped or not. Enveloped is the default.
Partition keySpecifies the partition key used to route messages to a Kinesis stream shard.

AWS authentication

Delegate access to your AWS resources by creating an IAM role that the Ably AWS account can assume.

This approach follows AWS best practices, as it avoids sharing access keys directly. Specify the role's ARN to grant Ably the necessary permissions in a secure manner.

Create a Kinesis policy

The following steps show you how to create a policy for AWS Kinesis.

  1. In the IAM console sidebar select Policies.
  2. Click Create Policy.
  3. Click the JSON tab and enter the following JSON to configure the policy:
JSON

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "ReadWriteToSingleStream",
      "Effect": "Allow",
      "Action": [
        "kinesis:DescribeLimits",
        "kinesis:DescribeStream",
        "kinesis:GetShardIterator",
        "kinesis:GetRecords",
        "kinesis:ListTagsForStream",
        "kinesis:MergeShards",
        "kinesis:PutRecord",
        "kinesis:PutRecords",
        "kinesis:UpdateShardCount"
      ],
      "Resource": [
        "arn:aws:kinesis:<YOUR_AWS_REGION>:<YOUR_AWS_ACCOUNT>:stream/<YOUR_STREAM_NAME>"
      ]
    }
  ]
}
  1. Click Next: Tags. You don't need to add any tags.
  2. Click Next: Review.
  3. Enter a suitable name for your policy.
  4. Click Create Policy.

You have created a policy that grants the permissions required to use a Kinesis stream. You must now attach it to the role that you'll specify in your Ably integration rule.

Create a role

Create an IAM role as follows:

  1. In the AWS IAM console, click Roles in the sidebar and then click Create Role.
  2. For type of trusted entity select Another AWS account.
  3. For Account ID specify 203461409171. This is the Ably AWS account.
  4. Click the Require external ID checkbox and then enter an external ID of <Your_Ably_Account_ID>.<Your_Ably_app_ID>.
  5. Click Next: Permissions.
  6. Now select the policy you created earlier to attach to this role. You can type the name of your policy into the Filter policies search box.

Then ensure the checkbox for the policy is selected.

  1. Click Next: Tags.
  2. You don't need to add tags so click Next: Review.
  3. Enter a suitable name for your role.
  4. Click Create Role.
Select...