Skip to content

Commit 4a23308

Browse files
committed
Making changes requested in code review
1 parent cae2e3f commit 4a23308

File tree

1 file changed

+60
-63
lines changed
  • src/connections/storage/catalog/aws-s3

1 file changed

+60
-63
lines changed

src/connections/storage/catalog/aws-s3/index.md

Lines changed: 60 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -110,91 +110,88 @@ To create an S3 IAM role, you must first install and configure the AWS CLI on yo
110110
#### Procedure
111111
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.
112112

113-
```json
114-
115-
{
116-
"Version": "2012-10-17",
117-
"Statement": [
113+
```json
118114
{
119-
"Sid": "",
120-
"Effect": "Allow",
121-
"Principal": {
122-
"AWS": "arn:aws:iam::595280932656:role/segment-s3-integration-production-access"
123-
},
124-
"Action": "sts:AssumeRole",
125-
"Condition": {
126-
"StringEquals": {
127-
"sts:ExternalId": "<YOUR_WORKSPACE_ID>"
115+
"Version": "2012-10-17",
116+
"Statement": [
117+
{
118+
"Sid": "",
119+
"Effect": "Allow",
120+
"Principal": {
121+
"AWS": "arn:aws:iam::595280932656:role/segment-s3-integration-production-access"
122+
},
123+
"Action": "sts:AssumeRole",
124+
"Condition": {
125+
"StringEquals": {
126+
"sts:ExternalId": "<YOUR_WORKSPACE_ID>"
127+
}
128+
}
128129
}
129-
}
130+
]
130131
}
131-
]
132-
}
133-
```
132+
```
134133

135134
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:
136135

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`.
136+
``` python
137+
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)"
138+
```
143139

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`.
140+
3. To verify that the IAM role is created, log into the 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`.
145141

146-
```json
142+
4. 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`.
147143

148-
{
149-
"Version": "2012-10-17",
150-
"Statement": [
144+
```json
151145
{
152-
"Sid": "PutObjectsInBucket",
153-
"Effect": "Allow",
154-
"Action": [
155-
"s3:PutObject",
156-
"s3:PutObjectAcl"
157-
],
158-
"Resource": "arn:aws:s3:::<YOUR_BUCKET_NAME>/segment-logs/*"
146+
"Version": "2012-10-17",
147+
"Statement": [
148+
{
149+
"Sid": "PutObjectsInBucket",
150+
"Effect": "Allow",
151+
"Action": [
152+
"s3:PutObject",
153+
"s3:PutObjectAcl"
154+
],
155+
"Resource": "arn:aws:s3:::<YOUR_BUCKET_NAME>/segment-logs/*"
156+
}
157+
]
159158
}
160-
]
161-
}
162-
163-
```
159+
```
164160

165161
5. Navigate to the folder containing `iam-policy.json`, and run the following command to create the IAM policy:
166162

167-
``` python
168-
aws iam create-policy --policy-name segment-s3-putobject --policy-document file://iam-policy.json --description "Allow Segment to PutObject into S3 destination bucket"
169-
```
163+
``` python
164+
aws iam create-policy --policy-name segment-s3-putobject --policy-document file://iam-policy.json --description "Allow Segment to PutObject into S3 destination bucket"
165+
```
166+
170167
6. A successful output has the following format. Take note of the `Arn,` as you'll need it in the next step.
171168

172-
``` json
173-
174-
{
175-
"Policy": {
176-
"PolicyName": "segment-s3-putobject",
177-
"PolicyId": "AABC1DE2F34GG567H",
178-
"Arn": "arn:aws:iam::012345678912:policy/segment-s3-putobject",
179-
"Path": "/",
180-
"DefaultVersionId": "v1",
181-
"AttachmentCount": 0,
182-
"PermissionsBoundaryUsageCount": 0,
183-
"IsAttachable": true,
184-
"CreateDate": "2021-11-11T01:21:00+00:00",
185-
"UpdateDate": "2021-11-11T01:21:00+00:00"
169+
``` json
170+
{
171+
"Policy": {
172+
"PolicyName": "segment-s3-putobject",
173+
"PolicyId": "AABC1DE2F34GG567H",
174+
"Arn": "arn:aws:iam::012345678912:policy/segment-s3-putobject",
175+
"Path": "/",
176+
"DefaultVersionId": "v1",
177+
"AttachmentCount": 0,
178+
"PermissionsBoundaryUsageCount": 0,
179+
"IsAttachable": true,
180+
"CreateDate": "2021-11-11T01:21:00+00:00",
181+
"UpdateDate": "2021-11-11T01:21:00+00:00"
182+
}
186183
}
187-
}
188184

189-
```
185+
```
186+
190187
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:
191188

192-
``` python
193-
aws iam attach-role-policy --role-name <YOUR_ROLE_NAME> --policy-arn <ARN_FROM_STEP_6_OUTPUT>
194-
```
189+
``` python
190+
aws iam attach-role-policy --role-name <YOUR_ROLE_NAME> --policy-arn <ARN_FROM_STEP_6_OUTPUT>
191+
```
195192

196193
> 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.
194+
> To verify that the IAM role is created, navigate to the AWS console and open the IAM Management Console. On the Permissions tab, verify that there is a `segment-s3-putobject` Permissions policy.
198195

199196

200197
### Add the AWS S3 with IAM Role Support Destination

0 commit comments

Comments
 (0)