A bucket policy is a resource-based AWS Identity and Access Management (IAM) policy. A Bucket Policy is used to grant other AWS accounts or IAM users access permissions for the bucket and its objects.
A Bucket Policy has the following structure:
{
"Version":"2012-10-17",
"Statement":[]
}
The statement comprises of the various actions, permissions, resource location and other necessary information.
-
Granting Permissions to Multiple Accounts with Added Conditions
-
Granting Permissions for Amazon S3 Inventory and Amazon S3 Analytics
After creating a bucket in S3 (testbucket1), use the following steps to add policies to it:
-
Select the bucket to which you want to add the policies.
-
Choose Persmissions -> Bucket Policy
-
The Bucket Policy editor will open. It the editor you can change an existing policy or add a custom policy, in JSON. Use the Policy Generator link to create a policy.
To copy S3 objects across AWS accounts read this interesting blog by Parag Poddar: Tensult Blogs(A Medium Corporation)
For more details on how to add bucket policies, use the official documentation provided by AWS : AWS S3 Bucket Policy