1 個回答
- 最新
- 最多得票
- 最多評論
0
They need GetObject, ListBucket on the source bucket. Also they need PutObject on the destination bucket.
Permissions do not matter WHERE the command is executed. It matters what they are executed against.
You can do this with a bucket policy, or in a role. A bucket policy would have to identify the Principals and is IMO a little more cumbersome.
Here is an example using a role: Put it in a policy attached to a role, and attach the role to an EC2 instance or to an EC2 user.
Here's the policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "SourceBucket",
"Effect": "Allow",
"Action": [
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucket-a",
"arn:aws:s3:::bucket-a/*"
]
},
{
"Sid": "DestBucket",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::bucket-b",
"arn:aws:s3:::bucket-b/*"
]
}
]
}
已回答 7 年前
相關內容
- AWS 官方已更新 2 年前
- AWS 官方已更新 3 年前