Skip to content

Commit ae4684a

Browse files
author
markzegarelli
authored
Merge pull request #1686 from segmentio/putRecords-Migration
Put records migration
2 parents a7530f2 + a16a511 commit ae4684a

File tree

1 file changed

+29
-3
lines changed
  • src/connections/destinations/catalog/amazon-kinesis

1 file changed

+29
-3
lines changed

src/connections/destinations/catalog/amazon-kinesis/index.md

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ This document was last updated on February 05, 2020. If you notice any gaps, out
2424
"Effect": "Allow",
2525
"Action": [
2626
"kinesis:PutRecord",
27-
"kinesis:PutRecords"
27+
"kinesis:PutRecords",
28+
"iam:SimulatePrincipalPolicy"
2829
],
2930
"Resource": [
30-
"arn:aws:kinesis:{region}:{account-id}:stream/{stream-name}"
31+
"arn:aws:kinesis:{region}:{account-id}:stream/{stream-name}",
32+
"arn:aws:iam::{account-id}:role/{role-name}"
3133
]
3234
}
3335
]
3436
}
3537
```
36-
**Note:** A previous version of this policy document only granted `PutRecord` access, which could slow down Kinesis write times by disallowing file batching. Substitute the updated policy document above to grant Kinesis `PutRecords` (plural) and allow batching.
38+
**Note:** A previous version of this policy document only granted `PutRecord` access, which could slow down Kinesis write times by disallowing file batching. Substitute the updated policy document above to grant Kinesis `PutRecords` (plural) and allow batching. We've also requested `iam:SimulatePrincipalPolicy`, which will allow us to verify that the IAM Role has the appropriate Kinesis permissions without invoking the Kinesis API.
3739

3840
3. Create an IAM role.
3941
Follow these instructions to [Create an IAM role](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html#roles-creatingrole-user-console) to allow Segment permission to write to your Kinesis Stream. When prompted to enter an Account ID, enter "595280932656". Make sure to enable 'Require External ID' and enter your Segment Source ID as the External ID*. This can be found by navigating to Settings > API Keys from your Segment source homepage. When adding permissions to your new role, find the policy you created above and attach it.
@@ -178,6 +180,30 @@ Replace that snippet with the following, and replace the contents of the array w
178180
}
179181
```
180182

183+
### Update IAM to Support PutRecords
184+
185+
The Kinesis destination defaults to use PutRecords. A previous version of the IAM policy document only granted `PutRecord` access, which can slow down Kinesis write times and degrade data deliverability. Substitute the updated policy document above to grant Kinesis `PutRecords` (plural) and allow batching, like this:
186+
```json
187+
{
188+
"Version": "2012-10-17",
189+
"Statement": [
190+
{
191+
"Effect": "Allow",
192+
"Action": [
193+
"kinesis:PutRecord",
194+
"kinesis:PutRecords",
195+
"iam:SimulatePrincipalPolicy"
196+
],
197+
"Resource": [
198+
"arn:aws:kinesis:{region}:{account-id}:stream/{stream-name}",
199+
"arn:aws:iam::{account-id}:role/{role-name}"
200+
]
201+
}
202+
]
203+
}
204+
```
205+
After you update the IAM policy, Segment systems default to use PutRecords for more efficient data transmission. This is a zero-downtime change and does not impact your data other than increasing the deliverability success rate.
206+
181207
### Use a single secret ID
182208
If you have so many sources using Kinesis that it is impractical to attach all of their IDs to your IAM role, you can instead opt to set a single ID to use instead. This approach should be avoided in favor of the above approach if possible since it will result in you having to keep track of a secret value. To set this value, go to the Kinesis destination settings from each of your Segment sources and set the 'Secret ID' to a value of your choosing. This value is a secret and should be treated as sensitively as a password. Once all of your sources have been updated to use this value, find the IAM role you created for this destination in the AWS Console in Services > IAM > Roles. Click on the role, and navigate to the **Trust Relationships** tab. Click **Edit trust relationship**. You should see a snippet that looks something that looks like this:
183209

0 commit comments

Comments
 (0)