Skip to content

Commit 3bbe324

Browse files
committed
fix code samples [netlify-ignore]
2 parents da69a2c + 6462cb2 commit 3bbe324

File tree

1 file changed

+33
-57
lines changed

1 file changed

+33
-57
lines changed

src/connections/data-residency.md

Lines changed: 33 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -67,72 +67,48 @@ To begin with Local Data Storage, complete the following steps in your AWS accou
6767
Segment requires this access to write raw data to your regionally hosted S3 bucket. Specifically, this allows Segment (as the Segment S3-copy user) to use `s3:PutObject`. To enable encryption at rest, use the default S3 mechanism. If you have server-side encryption enabled with AWS KMS managed keys, see the additional [required configuration step](/docs/connections/storage/catalog/amazon-s3/#encryption). To edit the bucket policy, right-click the bucket name in the AWS management console, and select **Edit policy**.
6868

6969
4. Create a new IAM role in your AWS account with a trust relationship to the role which allows Segment to use the Segment `workspace_id` as `externalID`.
70+
5. Attach this IAM policy to the role defined in Step 4.
7071
```json
71-
{
72-
"Version": "2012-10-17",
73-
"Statement": [
74-
{
75-
"Sid": "",
76-
"Effect": "Allow",
77-
"Principal": {
78-
"AWS": [
79-
"arn:aws:iam::595280932656:role/segment-regional-archives-production-access"
72+
{
73+
"Version": "2012-10-17",
74+
"Statement": [
75+
{
76+
"Sid": "ListObjectsInBucket",
77+
"Effect": "Allow",
78+
"Action": "s3:ListBucket",
79+
"Resource": [
80+
"arn:aws:s3:::YOUR_BUCKET_NAME"
8081
]
8182
},
82-
"Action": "sts:AssumeRole",
83-
"Condition": {
84-
"StringEquals": {
85-
"sts:ExternalId": [
86-
"YOUR_WORKSPACE_ID"
87-
]
88-
}
83+
{
84+
"Sid": "AllObjectActions",
85+
"Effect": "Allow",
86+
"Action": "s3:*Object*",
87+
"Resource": [
88+
"arn:aws:s3:::YOUR_BUCKET_NAME/*",
89+
]
8990
}
90-
}
91-
]
92-
}
93-
```
94-
5. Attach this IAM policy to the role defined in Step 4.
95-
```json
96-
{
97-
"Version": "2012-10-17",
98-
"Statement": [
99-
{
100-
"Sid": "ListObjectsInBucket",
101-
"Effect": "Allow",
102-
"Action": "s3:ListBucket",
103-
"Resource": [
104-
"arn:aws:s3:::YOUR_BUCKET_NAME"
105-
]
106-
},
107-
{
108-
"Sid": "AllObjectActions",
109-
"Effect": "Allow",
110-
"Action": "s3:*Object*",
111-
"Resource": [
112-
"arn:aws:s3:::YOUR_BUCKET_NAME/*",
113-
]
114-
}
115-
]
116-
}
91+
]
92+
}
11793
```
11894
This access allows Segment to run local deletions jobs from regionally hosted data for a given user ID.
11995

12096
6. If you are using KMS encryption on your S3 bucket, add the following policy to the IAM role:
12197
```json
122-
{
123-
"Version": "2012-10-17",
124-
"Statement": [
125-
{
126-
"Sid": "AllowKMS",
127-
"Effect": "Allow",
128-
"Action": [
129-
"kms:GenerateDataKey",
130-
"kms:Decrypt"
131-
],
132-
"Resource": "$YOUR_KEY_ARN"
133-
}
134-
]
135-
}
98+
{
99+
"Version": "2012-10-17",
100+
"Statement": [
101+
{
102+
"Sid": "AllowKMS",
103+
"Effect": "Allow",
104+
"Action": [
105+
"kms:GenerateDataKey",
106+
"kms:Decrypt"
107+
],
108+
"Resource": "$YOUR_KEY_ARN"
109+
}
110+
]
111+
}
136112
```
137113

138114
### Local Data Storage configuration

0 commit comments

Comments
 (0)