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
질문됨 7년 전959회 조회
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/*"
            ]
        }
    ]
}
AWS
Mike_O
답변함 7년 전
profile picture
전문가
검토됨 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠