Simple Storage Service (Amazon S3) is a object storage for the Internet. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere on the web. You can store and retrieve data using the AWS Management Console or AWS CLI but AWS management console is a simple and intuitive web interface.
Here in this tutorial, we will see how to upload, view, copy, move and delete objects in Bucket . If you want to get deep understanding of Amazon S3 then please check our previous tutorial where we explained everything about simple storage service.
Create a Bucket
Every object in Amazon S3 is stored in buckets. Before storing data in Amazon S3, you must create a bucket. AWS doesn’t charge for creating a bucket. AWS charges only for storing objects in the bucket and for transferring objects in and out of the buckets. So let’s create a bucket using AWS management console.
Creating a bucket using the AWS Management Console is very simple, first you need to sign up for Amazon S3. Open the Amazon S3 console at https://console.aws.amazon.com/s3/.
In first field, provide a unique DNS-compliant name for the new bucket.
- Bucket Name must be unique across all existing bucket names in Amazon S3.
- After creating the bucket you cannot change the name of that bucket.
- For Region, choose the region where you want to locate your bucket. Then click on Create.
Note : If you want to copy settings from an existing bucket, then put the name of that bucket in the third field.
Finally, you have created a bucket in Amazon S3.
By default, created bucket is not public. It is a private bucket. You can change it to public bucket if required
Uploading Objects into Bucket
As you have created a bucket, now you’re ready to add an object into it. An object can be a log file, a photo, a video, etc.
In the Bucket Name list, select the bucket that you want to upload your object into.
Into that particular bucket, click on upload.
In the Upload dialog box, You can drag and drop the files or click on Add files.
Choose a file to upload, and then click on Open.
check the file and click on Upload.
You can verify the uploaded file inside the bucket.
View an Object
As you have already added an object to a bucket, you can view information about your object and download the object to your local computer.
Select the object by clicking on check box.
After clicking on check box, you will get a dialogue box which will print all the information related to the bucket and you can download the object in your local machine.
Copy & Move an Object
So far you have added objects to a bucket and downloaded the objects. Now you will see how to copy or move an object into another folder in same bucket or into another bucket.
Select the object and click on actions, you will see two options copy and move.
If you want to copy the object in same bucket or different bucket then click on copy option. In the dialogue box choose the appropriate bucket name.
Here you can review the copied or moved file.
As you copied an object to another bucket. You can move the objects just like copy operation only you need to opt move option rather than copy.
Delete an Object and Bucket
So far you have uploaded, viewed and copied/moved objects to a bucket. Now you will see how to delete an object and bucket.
Delete an Object
You can delete objects individually or you can empty entire bucket, which deletes all the objects in the bucket without deleting the bucket.
Click on check box of object and then click on Actions. You will see delete option inside a dialogue box.
Click on Delete. Now object is deleted from your bucket.
Empty a Bucket
In the Bucket list, choose the bucket icon next to the name of the bucket that you want to empty and then click on Empty.
In Empty bucket dialog box, enter the name of the bucket for confirmation and then click on Confirm.
So you have deleted all the objects contained in the bucket.
Delete a Bucket
If you are no longer needed a bucket then you can delete that specific bucket. In the Bucket name list, choose the bucket icon next to the name of the bucket that you want to delete and then click on Delete.
In the Delete bucket dialog box, enter the name of the bucket for confirmation and then click on Confirm.
Hence, the bucket is deleted from your account.
In this tutorial, you learned about working with objects and buckets in Amazon S3. In our upcoming tutorial, you will learn about more in Amazon S3, so stay tune. Thanks!!