1 Antwort
- Neueste
- Die meisten Stimmen
- Die meisten Kommentare
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/*"
]
}
]
}
beantwortet vor 7 Jahren
Relevanter Inhalt
- AWS OFFICIALAktualisiert vor 2 Jahren
- AWS OFFICIALAktualisiert vor 4 Monaten
- AWS OFFICIALAktualisiert vor 3 Jahren
- AWS OFFICIALAktualisiert vor 2 Jahren