Aayushi Kesharwani
Aayushi Kesharwani

Reputation: 11

Making some object of the same bucket private and some public?

I am just a beginner to AWS. I was learning about S3 and making bucket public by editing the public access setting of a bucket.

So, I wanted to ask that can I make some objects of the same bucket private and some public?

Upvotes: 0

Views: 639

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269340

By default, all objects in an Amazon S3 bucket are private.

There are severals ways to grant access to objects:

  • Use a Bucket Policy to make a bucket, or part of a bucket, public. This is useful for static websites where anyone can access content.
  • Use an IAM Policy on an IAM User or IAM Group to grant access to a bucket (or part of a bucket) to a specific user or group of users. This is ideal for job-specific access.
  • Use an Access Control List (ACL) on an object to make a specific object public. This requires the permission to be set on each specific object, so is safer than making a whole bucket public.
  • Use a Pre-Signed URL when your application programmatically determines whether somebody should gain access to an object. For example, if your application is a photo-sharing website, the app can determine which user is entitled to see which photos. It can then generated a time-limited URL that grants temporary access to the object. Ones the URL expires, access is no longer available.

So, to answer your question:

  • There is no need to "make some objects of the same bucket private" because they are private by default
  • Choose one of the above methods to grant public access, or access to specific users

Upvotes: 1

Related Questions