Amplitude Data's AWS Kinesis Cohort integration lets you stream your cohort membership updates straight to a Kinesis stream.
The payload sent to Pub/Sub is a JSON object. Example:
1{ 2 "cohort_name": "Test Cohort", 3 "cohort_id": "gs72ns", 4 "in_cohort": true, 5 "computed_time": "1685748245", 6 "message_id": "some-message-id:54", 7 "users": [{ 8 "user_id": "user1@amplitude.com", 9 "user_properties": {10 "city": "San Francisco",11 "fav_animal": "Bat"12 }13 },14 {15 "user_id": "user2@amplitude.com",16 "user_properties": {17 "city": "Seattle",18 "fav_animal": "Cat"19 }20 }]21}
Before you get started, create a Kinesis topic in your AWS account, and an IAM role that will be used by Amplitude to publish cohort updates to the stream.
Create a Kinesis stream in the AWS console.
Create an IAM role that gives Amplitude permission to write directly to your AWS Kinesis Stream.
1{ 2 "Version": "2012-10-17", 3 "Statement": [ 4 { 5 "Effect": "Allow", 6 "Principal": { 7 "AWS": "arn:aws:iam::358203115967:root" 8 }, 9 "Action": "sts:AssumeRole"10 }11 ]12}
Create an IAM Policy to give Amplitude permission to write to your Kinesis Stream.
Select the Create Policy from JSON option and use the following template policy in the Policy Document field. Be sure to change the {account-id} to your account-id, and replace {region} and {stream-name} with the applicable values. Also replace {role-name} with the role just created.
1{ 2 "Version": "2012-10-17", 3 "Statement": [ 4 { 5 "Effect": "Allow", 6 "Action": [ 7 "kinesis:PutRecord", 8 "kinesis:PutRecords", 9 "iam:SimulatePrincipalPolicy"10 ],11 "Resource": [12 "arn:aws:kinesis:{region}:{account-id}:stream/{stream-name}",13 "arn:aws:iam::{account-id}:role/{role-name}"14 ]15 }16 ]17}
Assign the new policy to the role.
Make note of the role ARN, stream region, and stream name. You need these to set up the destination in Amplitude.
Thanks for your feedback!
July 4th, 2024
Need help? Contact Support
Visit Amplitude.com
Have a look at the Amplitude Blog
Learn more at Amplitude Academy
© 2024 Amplitude, Inc. All rights reserved. Amplitude is a registered trademark of Amplitude, Inc.