Skip to content

Commit 4b840b0

Browse files
authored
Merge pull request #1642 from segmentio/DOC-195
DOC-195
2 parents be6a471 + 18cd8db commit 4b840b0

File tree

1 file changed

+45
-31
lines changed
  • src/connections/destinations/catalog/amazon-kinesis-firehose

1 file changed

+45
-31
lines changed

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

Lines changed: 45 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,51 @@ This document was last updated on February 05, 2020. If you notice any gaps, out
1010

1111
{% include content/connection-modes.md %}
1212

13-
1. Create at least one Kinesis Firehose delivery stream. Follow these [instructions](http://docs.aws.amazon.com/firehose/latest/dev/basic-create.html) to create a new delivery stream.
14-
2. Create an IAM policy. Sign in to the [Identity and Access Management (IAM) console](https://console.aws.amazon.com/iam/) and follow these instructions to [Create an IAM policy](http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create.html) to allow Segment permission to write to your Kinesis Firehose Stream. Select the **Create Policy from JSON** option and use the following template policy in the `Policy Document` field. Be sure to change the {region}, {account-id} and {stream-name} with the applicable values.
15-
16-
```
17-
{
18-
"Version": "2012-10-17",
19-
"Statement": [
20-
{
21-
"Effect": "Allow",
22-
"Action": [
23-
"firehose:PutRecord"
24-
],
25-
"Resource": [
26-
"arn:aws:firehose:{region}:{account-id}:deliverystream/{stream-name}"
27-
]
28-
}
29-
]
30-
}
31-
```
32-
3. Create an IAM role. 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 Firehose 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.
33-
**Note:** If you have multiple sources using Kinesis, enter one of their source IDs here for now and then follow the procedure outlined in the Multiple Sources section at the bottom of this doc once you've completed this step and saved your IAM role.
34-
4. Create a new Kinesis Firehose Destination. In the Segment source that you want to connect to your Kinesis Firehose destination, click the "Add Destination" button. Search and select the Kinesis Firehose destination and enter the options: `Mapped Streams`, `Region`, and `Role Address` (important for the `Role Address` is that the role itself immediately follows "role/" e.g. `arn:aws:iam::874699288871:role/example-role`).
13+
1. Create at least one Kinesis Firehose delivery stream. You can follow these [instructions](http://docs.aws.amazon.com/firehose/latest/dev/basic-create.html) to create a new delivery stream.
14+
2. Create an IAM policy.
15+
- Sign in to the [Identity and Access Management (IAM) console](https://console.aws.amazon.com/iam/).
16+
- Follow [these instructions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_create-console.html#access_policies_create-json-editor) to create an IAM policy on the JSON to allow Segment permission to write to your Kinesis Firehose Stream.
17+
- Use the following template policy in the **Policy Document** field. Be sure to change the `{region}`, `{account-id}` and `{stream-name}` with the applicable values.
18+
19+
20+
```
21+
{
22+
"Version": "2012-10-17",
23+
"Statement": [
24+
{
25+
"Effect": "Allow",
26+
"Action": [
27+
"firehose:PutRecord"
28+
],
29+
"Resource": [
30+
"arn:aws:firehose:{region}:{account-id}:deliverystream/{stream-name}"
31+
]
32+
}
33+
]
34+
}
35+
```
36+
37+
38+
3. Create an IAM role.
39+
- Follow [these instructions](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user.html#roles-creatingrole-user-console) to create an IAM role to allow Segment permission to write to your Kinesis Firehose Stream.
40+
- When prompted to enter an Account ID, enter `595280932656`.
41+
- Select the checkbox to enable **Require External ID**.
42+
- Enter your Segment Source ID as the **External ID**. This can be found in Segment by navigating to **Connections > Sources** and choosing the source you want to connect to your Kinesis Firehose destination. Click the **Settings** tab and choose **API Keys**.
43+
- **Note:** If you have multiple sources using Kinesis, enter one of their source IDs here for now and then follow the procedure outlined in the [Multiple Sources](#best-practices) section at the bottom of this doc once you’ve completed this step and saved your IAM role.
44+
- When adding permissions to your new role, find the policy you created in step 2 and attach it.
45+
46+
4. Create a new Kinesis Firehose Destination.
47+
- In the Segment source that you want to connect to your Kinesis Firehose destination, click **Add Destination**.
48+
- Search and select the **Amazon Kinesis Firehose** destination and enter details for [these settings options](#settings).
3549

3650
## Page
37-
If you're not familiar with the Segment Specs, take a look to understand what the [Page method](https://segment.com/docs/connections/spec/page/) does. An example call would look like:
51+
Take a look to understand what the [Page method](https://segment.com/docs/connections/spec/page/) does. An example call would look like:
3852
```javascript
3953
analytics.page();
4054
```
4155

4256
## Identify
43-
If you're not familiar with the Segment Specs, take a look to understand what the [Identify method](https://segment.com/docs/connections/spec/identify/) does. An example identify call is shown below:
57+
Take a look to understand what the [Identify method](https://segment.com/docs/connections/spec/identify/) does. An example identify call is shown below:
4458
```javascript
4559
analytics.identify('97980cfea0085', {
4660
@@ -49,7 +63,7 @@ analytics.identify('97980cfea0085', {
4963
```
5064

5165
## Track
52-
If you're not familiar with the Segment Specs, take a look to understand what the [Track method](https://segment.com/docs/connections/spec/track/) does. An example identify call is shown below:
66+
Take a look to understand what the [Track method](https://segment.com/docs/connections/spec/track/) does. An example identify call is shown below:
5367

5468
```javascript
5569
analytics.track("User Registered", {
@@ -59,19 +73,19 @@ analytics.track("User Registered", {
5973
```
6074

6175
### Event Mapping
62-
To begin using the Kinesis Firehose destination you must first decide on which Segment events you would like to route to which Firehose delivery streams. This mapping then needs to be defined in your destination settings.
76+
To begin using the Kinesis Firehose destination, you must first decide on which Segment events you would like to route to which Firehose delivery streams. This mapping then needs to be defined in your destination settings.
6377

64-
Segment `track` events can map based on their **event name**. For example, if you have an event called `User Registered`, and you wanted these events to be published to a Firehose delivery stream called `new_users`, you would create a row in your destination settings that looks like this:
78+
Segment `track` events can map based on their **event name**. For example, if you have an event called `User Registered`, and you want these events to be published to a Firehose delivery stream called `new_users`, you would create a row in your destination settings that looks like this:
6579

6680
![track event mapping screenshot](images/track_mapping.png)
6781

68-
Any Segment **event type** (ie. `page`, `track`, `identify`, `screen`, etc.) can also be mapped. This allows you to publish all instances of a given Segment event type to a given stream. To do this, you simply to create a row with the event type and it's corrensponding delivery stream:
82+
Any Segment **event type** (ie. `page`, `track`, `identify`, `screen`, etc.) can also be mapped. This enables you to publish all instances of a given Segment event type to a given stream. To do this, create a row with the event type and its corresponding delivery stream:
6983

7084
![page event mapping screenshot](images/page_mapping.png)
7185

7286
Events can be defined **insensitive to case** so `Page` will be equivalent to `page`. The delivery stream name however needs to be formatted exactly as it is on AWS.
7387

74-
If you would like to route all events to a stream, use an * as the event name.
88+
If you would like to route all events to a stream, use an `*` as the event name.
7589

7690
### Data Model
7791
Let's say you've decided to publish your Segment track events named `User Registered` to your Kinesis Firehose delivery stream named `online_registrations`. If you send Segment the following `track` call:
@@ -101,7 +115,7 @@ firehose.putRecord({
101115
Segment will append a newline character to each record to allow for easy downstream parsing.
102116

103117
## Group
104-
If you're not familiar with the Segment Specs, take a look to understand what the [Group method](https://segment.com/docs/connections/spec/group/) does. An example group call is shown below:
118+
Take a look to understand what the [Group method](https://segment.com/docs/connections/spec/group/) does. An example group call is shown below:
105119

106120
```js
107121
analytics.group("0e8c78ea9d9dsasahjg", {
@@ -166,7 +180,7 @@ Replace that snippet with the following, and replace the contents of the array w
166180

167181
If you have so many sources using Kinesis that it is impractical to attach all of their IDs to your IAM role, you can set a single ID to use instead. **This approach requires that you securely store a secret value, so we recommend that you use the method above if at all possible. **
168182

169-
To set this value, go to the Kinesis Firehose 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:
183+
To set this value, go to the Kinesis Firehose 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:
170184

171185
```json
172186
{

0 commit comments

Comments
 (0)