In this lesson, we learned how to configure an S3 Bucket Policy to make an object publicly accessible. Below is a step-by-step breakdown of the process.


1. Enable Public Access in Bucket Settings

By default, public access is blocked in AWS S3 to prevent accidental data leaks. To allow public access:

⚠️ Warning: Making an S3 bucket public can expose sensitive data. Only do this for specific use cases, such as serving static assets.


2. Creating an S3 Bucket Policy

Now that public access is enabled, we must define a Bucket Policy to grant read permissions.

Using the AWS Policy Generator

AWS provides a Policy Generator to help create policies easily:

  1. Select "S3 Bucket Policy" as the policy type.
  2. Set permissions:
  3. Specify the Resource ARN:

Example Policy

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": "*",
      "Action": "s3:GetObject",
      "Resource": "arn:aws:s3:::your-bucket-name/*"
    }
  ]
}

  1. Generate the policy and copy it into the Bucket Policy section.
  2. Save the changes.