Prerequisites
Before setting up a Kinesis destination, ensure that you have:- An AWS account with access to Kinesis
- A Kinesis stream (or permissions to create one)
- AWS credentials with the following permissions:
kinesis:PutRecordkinesis:PutRecordskinesis:DescribeStream
Create a Kinesis destination
Step 1: Set up your Kinesis stream
If you don’t already have a Kinesis stream, create one in the AWS Console or using the AWS CLI:"StreamStatus": "ACTIVE" in the response.
Step 2: Create AWS credentials
Create an IAM user or role with permissions to write to your Kinesis stream. You need:- AWS Access Key ID
- AWS Secret Access Key
- AWS Session Token (optional, for temporary credentials)
Step 3: Add the destination to Ampersand
Go to the Destinations page in the Ampersand Dashboard and create a new Kinesis destination. You’ll need to provide:| Field | Type | Required | Description |
|---|---|---|---|
| Destination name | string | Yes | Alias to reference in your amp.yaml file |
| Stream name | string | Yes | Name of your Kinesis stream |
| Region | string | Yes | AWS region where your stream is located (e.g., us-west-2) |
| AWS Access Key ID | string | Yes | AWS access key with Kinesis permissions |
| AWS Secret Access Key | string | Yes | AWS secret access key |
| AWS Session Token | string | No | Session token for temporary credentials |
| Partition key template | string | No | JMESPath template for partition key |
| Endpoint URL | string | No | Custom Kinesis endpoint if applicable (e.g. when using LocalStack) |
Ampersand encrypts and stores your AWS credentials securely.
Refer to the destination in your integration
After creating your Kinesis destination, reference it in youramp.yaml file:
Message format
Ampersand sends messages to your Kinesis stream in JSON format. All data is wrapped in a top-leveldata object.
Read action messages
action: The action type (readorsubscribe)projectId: Your Ampersand project identifierprovider: The SaaS provider name (e.g.,hubspot,salesforce)groupRef/groupName: Customer group identifier and nameconsumerRef/consumerName: End user identifier and nameinstallationId: The installation instance IDinstallationUpdateTime: When the installation was last updatedobjectName: The object being syncedoperationId: Unique identifier for this sync operationoperationTime: When the operation completedresult: Array of records syncedfields: Normalized field dataraw: Original API response from the provider
Subscribe action messages
Subscribe action messages follow the same structure as read actions, but include additional event-related fields within each result entry:subscribeEventType: Normalized event type (create,update,delete,associationUpdate)providerEventType: Raw event type from the provider APIrawEvent: Original webhook event from the provider (when available)
Partition key configuration
Kinesis uses partition keys to distribute messages across shards. (Learn more in the AWS docs). You can customize the partition key using a JMESPath template. JMESPath is a query language for JSON. See jmespath.org for the full specification. You can specify a partition key template when creating a Kinesis destination in the Ampersand Dashboard. If you don’t specify one, by default we use the message ID as the partition key, so the messages we send will be evenly distributed across your shards.Custom partition key examples
You can customize the partition key by using any of the attributes inside of the message. Since all message data is wrapped in adata object, you need to prefix your JMESPath expressions with data.. Here are some examples:
Use installation ID:
Troubleshooting
Messages not appearing in Kinesis
Check destination configuration:- Verify that the stream name and region are correct in the Ampersand Dashboard.
- Test your AWS credentials:
- Check that IAM permissions for the credential include
kinesis:PutRecordandkinesis:PutRecords.
Limitations
- Message size: Individual records cannot exceed 1 MB (AWS Kinesis limit). If a single record is bigger than this limit, we send it to you in a download URL, similar to what we do for webhook destinations. (More details here).
- Throughput: Limited by Kinesis shard capacity (1 MB/sec write per shard).
- Retention: Messages are retained for 24 hours to 365 days (configurable in AWS).
- Ordering: Only guaranteed within a single partition key.
If you hit these limits, contact
support@withampersand.com to discuss scaling strategies.
