[Recipes] Create an S3 Bucket, Create Folders and Upload Files

Problem: 

Need to understand basic S3 operations by practice.

Solution Summary: 

We will create an S3 bucket, create folders, add files and access files.

Prerequisites: 

This lab assumes that you have setup AWS account as explained in the previous labs.

Solution Steps: 

  1. Login to AWS Console

  2. Got to S3 Dashboard

  3. Click on Create Bucket

  4. Enter a Bucket name and region, and click next. Bucket name should be unique across all bucket names in Amazon S3.

  5. Leave Versioning, Logging, Tags disabled. Click next.

  6. Leave Manage users and Manage public permissions, as is and click next.

  7. Review all details and click on ‘Create Bucket’.

  8. Bucket will appear.

  9. Click on Bucket, go to properties tab and explore properties and settings: Versioning, Logging, Static website hosting, Tags, Cross-region replication, Transfer acceleration, Events.

    • Note: To use cross-region replication, you must enable versioning on this bucket and on the target bucket.

  10. Now go to the Objects tab and upload any file. I will be uploading Buddytutor logo.

  11. Continue to click next, keeping options as is, but making a note of all options.

  12. Finally review and upload.

  13. Click on the image and explore all tabs: Overview, Properties, and Permissions. Overview will have: Open, Download, Download as and Make public. Properties will have Storage class, Encryption, Metadata, and Tags. Permissions are used to change read and/or write permissions for the file.

  14. Try to access it by clicking on the link provided (e.g. https://s3.ap-south-1.amazonaws.com/buddytutor/BT_Logo_213.png as I have selected Mumbai region). You will receive and error XML. This is because, by default, the object is private.

  15.  Go to the permissions tab of the object (by clicking on the file) and give read permission for Everyone. Now if you try to access the link again, you should see the image (or any file you had entered).

  16. Try creating a folder inside the bucket.

  17. Upload a file to this folder. Make it public by clicking on the ‘Make Public’ option in the overview page of the image.

  18. Go to the bucket home page, select all files (and folders) and delete it using delete option under the More dropdown.

 

Important Notes (Exam Tips)

  1. Folders are not actually created within a bucket. They are just symbolic and the whole name (along with path) is the actual key to the file. E.g. myfolder1/myfolder2/nyfile.txt.

Recipe Tags: 

Comments

sireesha A's picture

Good prctical explanation with step by step

Learn Serverless from Serverless Programming Cookbook

Contact

Please first use the contact form or facebook page messaging to connect.

Offline Contact
We currently connect locally for discussions and sessions at Bangalore, India. Please follow us on our facebook page for details.
WhatsApp (Primary): (+91) 7411174113
Phone (Escalations): (+91) 7411174114

Business newsletter

Complete the form below, and we'll send you an e-mail every now and again with all the latest news.

About

CloudMaterials is my blog to share notes and learning materials on Cloud and Data Analytics. My current focus is on Microsoft Azure and Amazon Web Services (AWS).

I like to write and I try to document what I learn to share with others. I believe that knowledge is useless unless you share it; the more you share, the more you learn.

Recent comments

Photo Stream