There are two ways to assign cross-account permissions for Amazon S3:
Using Bucket Policies
- Add a Bucket Policy to each desired bucket that grants permission to the other account
- Add permissions to the desired IAM Users and IAM Roles in Account-B that allow them to access the buckets in Account-A
Note that the permissions are required in both directions.
The downside to this method is that the Bucket Policy must be applied to every bucket that you want to make available. Also, this will not work for creating new buckets since there is no bucket policy to grant access.
Using an IAM Role
- Create an IAM Role in Account-A (
Role-A
) that has all desired S3 permissions, and a Trust Policies that trusts Account-B
- From Account-B, call
AssumeRole()
on Role-A
- Use the returned credentials to manage S3 resources in Account-A
This does not require any Bucket Policies, but has the requirement to call AssumeRole()
.
See also: Provide cross-account access to objects in S3 buckets