Amazon S3 (Simple Storage Service) Summarization

Hello everyone. So this article is all about the summarization of AMAZON S3 and I am going to show you about the basic operations like create bucket , upload object, copy object with AWS python SDK. 
#<b>Introduction - What is AMAZON S3?</b>

Amazon S3 is a web service provide by AWS(Amazon Web Service). It is an cloud object storage which allow user to store , retrieve , analyze the data anytime with any amount from anywhere.

#<b>Amazon S3 Benefit - Why we should use S3?</b>
1. <b>Durability , Reliability & Scalability :</b> Amazon S3 promise of 99.99% of durability because the data is distributed across a minimum of three physical facilities and we can store any amount of data on S3.
2. <b>Query in Place :</b> We can analyze the data in place. No need to move data into another separate analytic system.
3. <b>Security :</b> It's prevent DDoS Attack and we also can add an additional security layer to our data and more than that it has IAM which we can define individual user account with permission across AWS service. We also can monitoring and logging to see the API call who , where , whom is calling with the help of AWS CloudTrail.
4. <b>Flexible Management :</b> Since objects can tagged with customizable metadata so we can see and control the storage consumption , cost for each workload.
5. <b>Easy Flexible Data Transfer :</b> We can choose the widest range of options to transfer our data into or out of Amazon S3 and with S3 API, it is really easy to transfer data over the internet/
6. <b> Most Supported Platform :</b> Beside AWS service there are more than 3500 software which we can integrate with Amazon S3.

#<b>Getting Start</b>
First of all , we have to know all the basics thing within S3.
1. <b> Bucket </b> : Bucket is a container for objects store in Amazon S3.
2. <b> Object</b> : everything that we upload into S3 we consider it as object. It can be a text file , image ,video.
3. <b> Key </b> : Key is a unique identifier for an object within a bucket.Every objects in bucket must has exactly one key. It is use to identify the object.
4. <b> IAM </b> : With IAM(AWS Identify and Access Management)we can securely control access to AWS services and resources for our users. We can create and manage AWS users and groups and set permissions to allow and deny access to AWS resources.

#<b>Making Requests Using IAM User Credential - AWS SDK for python</b>
AWS support many programming languages such as JAVA , dotNet , PHP , Ruby , Python ...etc but for this time we are going to use AWS SDK for python which is boto.
###<b> What is boto?</b>
Boto is AWS SDK for python which allow python developer to write software that make use of Amazon service like S3 or EC2.

###<b>Let's start!</b>

####1. Installation
We are going to use boto3 with python 3.5

```bash
pip install boto3
```
####2. Configuration
Before we can use boto3 we have to set up authentication credentials. We can find credentials for our AWS account in IAM console.

- Then install AWS CLI by typing:

```bash
pip install awscli
```
- Ok, so now we can configure the file by typing:


```bash
aws configure
```

- Then input your information

```bash
aws access key id [None]: input your access key.
aws secret access key [None]: input your secret key.
default region name [None]: input your region.
output [ None]: you can type the output you need or just press the enter key.
```

####3. Using boto3
To use boto3, first we have to import it and tell what service we are going to use.

```python3
import boto3
#telling boto3 that we are going to use amazon s3
s3 = boto3.resource('3')
```

- Creating Bucket

```python3
import boto3
s3= boto3.resource('s3')
s3.create_bucket(Bucket='putyourbucketname',CreateBucketConfiguration={'LocationConstraint':'input your region'})
```

- List all buckets in S3

```python3
import boto3
s3= boto3.resource('s3')
for bucket in s3.buckets.all():
   print(bucket.name)
```
- Upload object to S3

```python3
import boto3
s3= boto3.resource('s3')
Bucket= s3.Bucket('bucketname')
Bucket.upload_file(file,key,ExtraArgs={'ACL':'public-read'}
```
- Download object from S3

```python3
import boto3
s3= boto3.resource('s3')
s3.Bucket("bucketname").download_file("filenameins3","filenameyouwanttosaveinlocal")
```
- Copy object in S3

```python3
import boto3
s3= boto3.resource('s3')
source={
'Bucket':'bucketname',
'Key':'key'}
s3.meta.client.copy(source,'otherbucket','otherkey')
```

#<b>Disadvantages of Amazon S3</b>
Ok, so now let's talk about the drawback or disadvantages of Amazon S3. In my opinion I think the drawback of Amazon S3 are its capability and cost.

###<b>S3 Capability</b>
You may wonder "What do you mean by capability"? Ok so like you all know , S3 is an object storage which we use to store object file such as image , video ,text file which has public URL so we can manipulate it to host a static site if we want to host dynamic site it is not possible.

###<b>Cost</b>
If your static site is big , popular or has lots of traffics and your contents contain lots of big file like videos.The cost is going to be high. Here is how the cost is calculate on s3.
http://www.hostingadvice.com/how-to/aws-s3-pricing/.