Gagan Sidhu
Gagan Sidhu

Reputation: 52

Access cross account data uploaded by other user on S3

Suppose, I have 3 AWS Accounts :

User A and User B uploads data to MyBucket in Account C Both users have permissions to read/write data in the bucket.

But they cannot view the content of files uploaded by other account means User A cannot view the content of the file uploaded by User B

Is there any way to let my both users see the content of each other?

Upvotes: 0

Views: 39

Answers (1)

ttulka
ttulka

Reputation: 10892

Maybe a bucket policy is missing there:

 MyBucketPolicy:
    Type: AWS::S3::BucketPolicy
    Properties:
      Bucket: !Ref MyBucket
      PolicyDocument:
        Statement:
        - Action: ["s3:*"]
          Effect: Allow
          Resource:
          - !Sub "arn:aws:s3:::${MyBucket}"
          - !Sub "arn:aws:s3:::${MyBucket}/*"
          Principal:
            AWS:
            - !Sub "arn:aws:iam::${AccountA}:role/cross-account-role"
            - !Sub "arn:aws:iam::${AccountB}:role/cross-account-role"

Upvotes: 2

Related Questions