|
| 1 | +[中文](./IAM-Policy_CN.md) |
| 2 | + |
| 3 | +# Set up Credential for Amazon S3 |
| 4 | + |
| 5 | +- ## Step 1: Create IAM Policy |
| 6 | + |
| 7 | +Open AWS Management Console, Go to IAM > Policy, click **Create Policy** |
| 8 | + |
| 9 | +Create a policy using below example IAM policy statement with minimum permissions. Change the `<your-bucket-name>` in the policy statement accordingly. |
| 10 | + |
| 11 | +_Note_: If it's for S3 buckets in China regions, please make sure you also change to use `arn:aws-cn:s3:::` instead of `arn:aws:s3:::` |
| 12 | + |
| 13 | +- ### For Source Bucket |
| 14 | + |
| 15 | +``` |
| 16 | +{ |
| 17 | + "Version": "2012-10-17", |
| 18 | + "Statement": [ |
| 19 | + { |
| 20 | + "Sid": "dth", |
| 21 | + "Effect": "Allow", |
| 22 | + "Action": [ |
| 23 | + "s3:GetObject", |
| 24 | + "s3:ListBucket" |
| 25 | + ], |
| 26 | + "Resource":[ |
| 27 | + "arn:aws:s3:::<your-bucket-name>/*", |
| 28 | + "arn:aws:s3:::<your-bucket-name>" |
| 29 | + ] |
| 30 | + } |
| 31 | + ] |
| 32 | +} |
| 33 | +``` |
| 34 | + |
| 35 | + |
| 36 | +- ### For Desination Bucket |
| 37 | + |
| 38 | +``` |
| 39 | +{ |
| 40 | + "Version": "2012-10-17", |
| 41 | + "Statement": [ |
| 42 | + { |
| 43 | + "Sid": "dth", |
| 44 | + "Effect": "Allow", |
| 45 | + "Action": [ |
| 46 | + "s3:PutObject", |
| 47 | + "s3:GetObject", |
| 48 | + "s3:ListBucket", |
| 49 | + "s3:PutObjectAcl", |
| 50 | + "s3:AbortMultipartUpload", |
| 51 | + "s3:ListBucketMultipartUploads", |
| 52 | + "s3:ListMultipartUploadParts" |
| 53 | + ], |
| 54 | + "Resource": [ |
| 55 | + "arn:aws:s3:::<your-bucket-name>/*", |
| 56 | + "arn:aws:s3:::<your-bucket-name>" |
| 57 | + ] |
| 58 | + } |
| 59 | + ] |
| 60 | +} |
| 61 | +``` |
| 62 | + |
| 63 | +> Note that if you want to enable S3 Delete Event, you will need to add `"s3:DeleteObject"` permission to the policy. |
| 64 | +
|
| 65 | +> Data Transfer Hub native support the S3 source bucket enabled SSE-S3 and SSE-KMS, but if your source bucket enabled *SSE-CMK*, please replace the source bucket policy with the policy in the link [for S3 SSE-KMS](./S3-SSE-KMS-Policy.md). |
| 66 | +
|
| 67 | +- ## Step 2: Create User |
| 68 | + |
| 69 | +Open AWS Management Console, Go to IAM > User, click **Add User**, follow the wizard to create the user with credential. |
| 70 | + |
| 71 | +1. Specify a user name, for example *dth-user*. And for Accesss Type, select **Programmatic access** only. Click **Next: Permissions** |
| 72 | +1. Select **Attach existing policies directly**, search and use the policy created in Step 1, and click **Next: Tags** |
| 73 | +1. Add tags if needed, click **Next: Review** |
| 74 | +1. Review the user details, and Click **Create User** |
| 75 | +1. Make sure you copied/saved the credential, and then click **Close** |
| 76 | + |
| 77 | + |
0 commit comments