S3 (Simple Storage Service) falls under the "Storage" service of AWS (Amazon Web Services). In simple words, S3 is nothing more than an object store where you can store your items (files, videos, images, documents and any file type). We can restrict access to files according to our requirements. We can keep multiple versions of the file if needed. We can access our data at any time and wherever it is necessary to have access to the Internet at the lowest possible cost. To understand more about billing, click here.
To use S3 service and upload items, a user can create a bucket that must have a unique name globally. By default, we can only create up to 1
In this article I will show you how to create an S3 bucket on AWS, upload an object, and perform basic operations.
- AWS Account ( Create if you do not have one)
What We Will Do
- Login to AWS.
- Create an S3 bucket (We create a public bucket).
- Upload an item.
- Access the item.  Manage permissions (Change access control to Private)
Log in to AWS
Click here to go to the AWS login page.
When we hit the link above, we see a web page as follows where we have to log in using our login credentials.
Once we log in to AWS successfully, we will see the main console with all the services listed as follows.
Creating an S3 bucket
There is no need to select a region before creating an S3 bucket but when you create a bucket it will be prompted to specify the region. When we see a list of S3 buckets, all buckets from the entire region are listed.
Since there is no need to choose the region, we should go straight ahead to create an S3 bucket.
To create an S3 click on "Services" in the upper left corner we see the following screen with all available services on AWS. Click "S3" available under "Storage".
Click “ Create Bucket ”. Give the bucket a name. This name should be globally unique and buckets of the same name should not be found on AWS around the world. Each evey bucket on AWS has a unique name and does not match with any other bucket.
Select the desired region, may be the closest. Click "Next" to continue.
On this screen we can configure the bucket according to our requirements. If we want to keep multiple versions of objects, we can enable versioning. There are various options available, for the moment we will keep everything unchecked (default) and continue. You can try later if you want to explore the S3 in detail. We can enable server access logging if we want to keep access logs to the bucket. We can tag the bucket so we can use these tags for billing purposes. If we want to save objects in an encrypted form, we can do that. For now, click "Next" to continue with the default settings.
By default, the S3 bucket blocks all public access to it. In this guide, we will give the public access to try some external / public operations. To make the bucket public, uncheck the box " Block all public access " and click " Next "
Review the settings and click "Create bucket" if everything looks good.
Well, we have just created a bucket that is publicly available. To upload items, click on the bucket name and enter the bucket.
Upload an item to S3
Uploading an item is very easy in S3 Bucket. To upload an item, go to the bucket and click "Upload". We will get the following screen.
Browse the desired item by clicking "Add Files" and clicking "Next".
Click "Next" once you have uploaded the item.
Under “ Manage Public Permissions ” Select “ Provide Public Read Access to the Objects ”. Click “ Next to continue ”
Keep default “ Storage Class ” to “ Standard ” and click at " Next ". The S3 Standard is for general storage of frequently accessed data.
Review the settings and click " Upload ".
<img src = "https://www.howtoforge.com/images/create_an_s3_bucket_on_aws/Screenshot_2019-10-17_at_3.09_.14_PM_.png" alt = "File list in S3  Access Objects in Amazon S3
One we have uploaded the item, we can access it anywhere as it is publicly available. To access the uploaded item, click on it and under " Overview " copy " Object URL ".
Hit this URL and the item will be downloaded.
Deal with Amazon S3 Permissions (Change to Private)
Having items that are publicly available is not recommended at all. To restrict access to the items and make them available only by the owner, we will follow the steps mentioned below.
Select desired item, click on " Permissions " and click "Edit" to edit " Bl and all public access "field. Check the " Block All Public Access " and " Confirm " dialog box.
Now we can try to access the object by entering the object's URL in another window. We will see the message “Access Denied”. Now this item can only be downloaded / displayed from the item's owner account.