Advertisement
Intermediate AWS, S3 & Storage

How do S3 bucket policies and access control lists work together to control who can access objects stored in a bucket?

Short answer

A bucket policy is a resource based JSON policy attached directly to an S3 bucket that defines which principals, whether specific IAM users, roles, or entirely different AWS accounts, are allowed to perform specific actions on the bucket or its objects, while access control…

Save AWS mock interview
Advertisement
AModel answer
A bucket policy is a resource based JSON policy attached directly to an S3 bucket that defines which principals, whether specific IAM users, roles, or entirely different AWS accounts, are allowed to perform specific actions on the bucket or its objects, while access control lists provide a more limited, older mechanism for granting basic read or write permissions at the individual object or bucket level, with bucket policies generally being the preferred, more flexible and precise approach for most modern access control needs.
Example

aws s3api put-bucket-policy --bucket my-bucket --policy file://bucket-policy.json

Real-world example
A company shares a specific S3 bucket containing shared reference data with a partner organization's AWS account by adding a bucket policy that explicitly grants that partner account read only access, without making the bucket publicly accessible to anyone else.
Likely follow-ups
  • What is the difference between a bucket policy and an IAM policy for controlling S3 access?
  • Why has AWS moved away from recommending ACLs for most modern use cases?
Related topics