You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/storage/catalog/aws-s3/index.md
+98-2Lines changed: 98 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,9 +34,9 @@ The Segment Tracking API processes data from your sources, and collects the Even
34
34
35
35
## Create a new destination
36
36
37
-
Complete the following steps to configure the AWS S3 Destination with IAM Role Support.
37
+
Complete either [Create an IAM role in the AWS console](#create-an-iam-role-in-the-aws-console) or [Create an IAM role using the AWS CLI](#create-an-aws-role-using-the-aws-cli) to configure the AWS S3 Destination with IAM Role Support.
38
38
39
-
### Create an IAM role in AWS
39
+
### Create an IAM role in the AWS console
40
40
41
41
To complete this section, you need access to your AWS dashboard.
42
42
@@ -100,6 +100,102 @@ To complete this section, you need access to your AWS dashboard.
100
100
101
101
If you have server-side encryption enabled, see the [required configuration](#encryption).
102
102
103
+
### Create an IAM role using the AWS CLI
104
+
105
+
To create an IAM role with external ID and with S3 permissions using the AWS CLI, follow the steps below.
106
+
107
+
#### Prerequisites
108
+
To create an S3 IAM role, you must first install and configure the AWS CLI on your local machine and create an S3 bucket. Refer to Amazon's documentation, [Getting started with the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html) for more information.
109
+
110
+
#### Procedure
111
+
1. Copy the following code snippet and save it as a file on your local machine titled `trust-relationship-policy.json`. Replace `<YOUR_WORKSPACE_ID>` with your Segment workspace ID.
2. Navigate to the folder containing `trust-relationship-policy.json` and run the following command to create your IAM role and attach the trust relationship document, replacing `<YOUR_ROLE_NAME>` with the name you want to give this IAM role:
136
+
137
+
```python
138
+
aws iam create-role --role-name <YOUR_ROLE_NAME>--assume-role-policy-document file://trust-relationship-policy.json --description "IAM role for Segment to assume (AWS S3 destination)"
139
+
```
140
+
141
+
>info ""
142
+
> To verify that you successfully created an IAM role, log into your AWS console and open the IAM Management Console. Under the Trust Relationship tab, there should be a key-value pair: a `sts:ExternalID` key with a value of `your Segment workspace ID`.
143
+
144
+
3. Copy the following IAM policy, replacing `<YOUR_BUCKET_NAME>` with the name of your S3 bucket, and save it as a file on your local machine titled `iam-policy.json`.
7. Run the following command to attach the IAM policy to the IAM role, replacing `<YOUR_ROLE_NAME>` with the name of your role and `<ARN_FROM_STEP_6_OUTPUT>` with the Arn output from the last step:
191
+
192
+
```python
193
+
aws iam attach-role-policy --role-name <YOUR_ROLE_NAME>--policy-arn <ARN_FROM_STEP_6_OUTPUT>
194
+
```
195
+
196
+
> info ""
197
+
> To verify that you have successfully created your IAM role, navigate to your AWS console and open the IAM Management Console. On the Permissions tab, verify that there is a `segment-s3-putobject` Permissions policy.
198
+
103
199
104
200
### Add the AWS S3 with IAM Role Support Destination
0 commit comments