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:
- Login and select the application you wish to integrate with Kinesis.
- Click the Integrations tab.
- Click the New Integration Rule button.
- Choose Firehose.
- Choose AWS Kinesis.
- Configure the Kinesis settings.
- Click Create.
You can also create a Kinesis integration using the Control API.
Settings
The following settings are available when creating a Kinesis integration:
Setting | Description |
---|---|
AWS Region | Specifies the AWS region of your Kinesis Stream. |
Stream Name | Defines the name of the Kinesis Stream to connect to. |
AWS authentication scheme | Choose the authentication method. Either AWS credentials or ARN of an assumable role. |
AWS Credentials | If using AWS credentials, enter the values in key:value format. |
ARN of an assumable role | If using ARN of an assumable role, enter the ARN of the role that Ably can assume to access your Kinesis stream. |
Source | Specifies the event types being sent to Kinesis. |
Channel filter | Filters the source channels based on a regular expression. |
Encoding | Specifies the encoding format of messages. Either JSON or MsgPack. |
Enveloped | Checkbox to set whether messages should be enveloped or not. Enveloped is the default. |
Partition key | Specifies 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.
- In the IAM console sidebar select Policies.
- Click Create Policy.
- Click the JSON tab and enter the following JSON to configure the policy:
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>"
]
}
]
}
- Click Next: Tags. You don't need to add any tags.
- Click Next: Review.
- Enter a suitable name for your policy.
- 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:
- In the AWS IAM console, click Roles in the sidebar and then click Create Role.
- For type of trusted entity select Another AWS account.
- For Account ID specify 203461409171. This is the Ably AWS account.
- Click the Require external ID checkbox and then enter an external ID of
<Your_Ably_Account_ID>.<Your_Ably_app_ID>
. - Click Next: Permissions.
- 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.
- Click Next: Tags.
- You don't need to add tags so click Next: Review.
- Enter a suitable name for your role.
- Click Create Role.