S3 permissions STS assume role bucket to bucket copy

0

Customer has verified that STS assume role is working and can copy a local file to an s3 bucket.

The issue they are having is with bucket to bucket copies. What IAM policy statement do they need to have for that. They are allowing put and list object do they also need some other s3 permission for the copy to work?

They have verified that they can perform a normal put from local and that worked but a bucket directly to another bucket copy is not working.

Would it require a bucket policy? Could it be since they are assuming a role, that the role then does not have access to assume the role on their side to get the files from the source?

AWS
gefragt vor 7 Jahren960 Aufrufe
1 Antwort
0
Akzeptierte Antwort

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/*"
            ]
        }
    ]
}
AWS
Mike_O
beantwortet vor 7 Jahren
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen