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년 전