Making the S3 Files Publicly Accessible

Lab Steps

lock
Logging in to the Amazon Web Services Console
lock
Creating an Amazon S3 Bucket
lock
Creating a CloudFront Distribution
lock
Uploading a Demo Image Gallery to the S3 Bucket
lock
Making the S3 Files Publicly Accessible
lock
Testing the CloudFront Distribution
lock
Disabling a CloudFront Distribution
lock
Deleting a CloudFront Distribution
lock
Destroying an S3 Bucket
Need help? Contact our support team

Here you can find the instructions for this specific Lab Step.

If you are ready for a real environment experience please start the Lab. Keep in mind that you'll need to start from the first step.

Introduction

All uploaded files are private by default and can only be viewed by the AWS account owner, but you can make them accessible to everyone using the AWS Console.

In this lab step, you will modify the permissions of the S3 bucket you created earlier so the bucket can be accessed publicly.

 

Instructions 

1. In the S3 Console for your bucket, click the Permissions tab:

alt

 

2. Scroll down to Block public access (bucket settings) and click Edit:

alt

 

3. Uncheck Block all public access:

alt

Also, ensure that all other checkboxes are unchecked.

Note: You should carefully consider anytime you allow public access to S3 buckets. AWS has implemented these security features to help prevent data breaches. For this lab, there is no sensitive data and you do want to allow public access.

To learn more about access control in Amazon S3, visit the AWS documentation.

 

4. To save your changes, scroll to the bottom, and click Save changes:

alt

The Amazon S3 Console will ask you to confirm that you want to make this change.

 

5. Enter confirm in the text-box and click Confirm:

alt

 

6. Navigate back to your bucket's objects by clicking the Objects tab.

 

7. Select the gallery object:

alt

 

8. Click Actions, and then click Make public:

alt

 

9. On the page that opens, click Make public:

alt

You will see a blue notification that the operation is in progress, and then a green notification that the gallery folder has been made public.

 

10. To exit the Make public form, in the top-right, click Close.

Next, you will access the URL of your gallery folder and visit it in your web browser.

 

11. To see the contents of the gallery folder, in the objects list, click gallery/:

alt

 

12. Click the index.html object:

alt

You will see an overview of this object.

 

13. Under Object URL, click the link:

alt

You will see the Demo Gallery webpage load:

alt

Look at the URL in the address bar, it will be similar to:

  • https://calabs-abc123.s3-us-west-2.amazonaws.com/gallery/index.html

The URL of any S3 object follows this template:

  • https://<bucket-name>.s3-us-west-2.amazonaws.com/<object-prefix>/<object-name>

Note: You may encounter older S3 buckets using the following URL format:

  • https://s3-<region>.amazonaws.com/<bucket-name>/<object-prefix>/<object-name> 

In 2020 AWS changed new buckets to use the current format (bucket name as a part of the hostname).

 

Summary

In this lab step, you modified the permissions of the S3 bucket created earlier to access your gallery of images.