Search for S3

AWS – How to add files to S3

Are you trying to understand AWS S3 and how to add files in there?

Below I will show you how to add files to S3 using just a few simple steps:

AWS S3 Flow
AWS S3 Flow

 

Create an AWS free tier account

Just go here and create a free account.

Create account on AWS
Create account on AWS

Go to the S3 dashboard in AWS

Search for S3
Search for S3

Once you have an account and are logged in search for S3. Click on the first result from the search bar.

The first thing you should notice is that S3 is Global. It does not require a region selection.

AWS S3 Global
AWS S3 Global

Create bucket (Folder)

Create S3 bucket
Create S3 bucket

Click on the big blue button that says “Create bucket”. A bucket is basically just a folder, a directory.

Enter a name for your bucket. This has to be unique across all bucket names in AWS S3.

Select a region. This is where your data is going to get stored. It’s basically a data center. There’s a lot of data centers across the world but ideally, you should choose the one that near you. I live in Manchester, so the nearest ones are EU (Ireland) or EU (London). I will go for Ireland.

Now here you have two options. You either press “Create” and the bucket it will just get created using the default options, or, you click next and go through the options. In this tutorial, I will go through all the options.

Set properties

  1. Versioning – This allows you to keep multiple versions of an object (i.e text file) in the same bucket. Depending on the type of data you want to store, you might want to enable this option. I will not need it for this tutorial.
  2. Server access logging – This feature will keep track of all the requests for access to your bucket. It will be a log record. This access log information can be useful for security reasons or auditing. I will not need it for this tutorial.
  3. Tags – AWS encourages you to use tags in everything you to. This will help you keep track of costs or categorize your products/services.  I will enable this and some example tags that you might want to use. Remember that this is optional.
  4. Object-level logging – This feature will add additional costs. This feature allows you to log data events like GetObject, DeleteObject or PutObject. You will need to configure this using CloudTrail. Learn more about it here.  I will not need it for this tutorial.
AWS S3 - Set properties
AWS S3 – Set properties

Once you have selected all of your properties, click Next.

Set permissions

Setting the right permissions is a very important step when creating your bucket on S3.

  1. Manage users – You will be the owner of the bucket, therefore you will get Read and Write permission. This allows you to see and add data into your bucket.
  2. Access for other AWS account – You also have the option to add another AWS account as a user in your bucket if you want to.
  3.  Manage public permissions – Depending on the purpose of this bucket, you might want or not want to grant public read access to the public. If it’s confidential data then do not grant public access to anyone. If you want to turn this bucket into a static website then you will have to make it public to the world, for it to be visible to everyone. My previous post shows you how to create a static website using an S3 Bucket.  I will not grant public read access to this bucket.
  4. Manage system permissions – This will allow Amazon S3 Log Delivery to create log files into your bucket. I will grant the write access.
AWS S3 - Set permissions
AWS S3 – Set permissions

Once your permissions are all set and you are happy with them click Next. Review everything and click Create Bucket.

Adding files into the bucket

Once your bucket has been created open it and you should get to this page:

AWS S3 - See bucket
AWS S3 – See bucket

Here you can create folders, upload items and more.

To upload a file click Upload.

Drag and Drop your file in there or just click the Select button. Click Next to check if you are happy with the permissions and properties.

I will leave the permissions as the default ones.

In “Set properties” you will find Storage Class and Encryption. 

You should choose your storage class depending on your data.

  1. STANDARD – This storage class is ideal for performance-sensitive use cases and frequently accessed data.
  2. STANDARD_IA – This storage class (IA, for infrequent access) is optimized for long-lived and less frequently accessed data, for example backups and older data where frequency of access has diminished, but the use case still demands high performance. See more here Note

    There is a retrieval fee associated with STANDARD_IA objects which makes it most suitable for infrequently accessed data. For pricing information, see Amazon S3 Pricing.

  3. REDUCED_REDUNDANCY – The Reduced Redundancy Storage (RRS) storage class is designed for noncritical, reproducible data stored at lower levels of redundancy than the STANDARD storage class, which reduces storage costs. This is the cheapest one and is great for saving costs if you have lots of data that can be archived. Be aware that AWS also offers Glacier for data archiving.

In case the data is sensitive use one of the encryption methods shown in the page. I will not use any encryption since this is just a test tutorial.

AWS also allows you to add Metadata to your file and tags.

AWS S3 - Set properties
AWS S3 – Set properties

Click Next and review everything before uploading. Click Upload when if everything looks fine.

Your file on S3

Now, if you click on your file you will be shown the below page:

AWS S3 - File info page

This page is displaying information about the file you have just added and also giving you some more options.

  • LATEST VERSION – If you have versioning enabled for this file, this drop down will allow you to select which version you want to see.
  • OPEN  – will literally open the file for you in the browser, depending on the type of file. In my case, if I click open it will open a new tab in browser and show the content of the .txt file.
  • DOWNLOAD – will download the file.
  • DOWNLOAD AS – will download the file as the specified type you choose.
  • MAKE PUBLIC – will make this file public, available to the world. Before clicking this button, click on the link highlighted in yellow. You should see a Denied message on the page, not the content of the file. If you make the file public now and click the link again the file will be visible.
  • COPY PATH – will copy the path to your file.

If you click on Properties you will see the below page.  You can edit any of the properties that you want on this page.

 

AWS S3 - File properties
AWS S3 – File properties

 

If you click on Permissions  you will see the below picture. Here you can add more permissions to users or revoke permissions.

AWS S3 - File Permissions
AWS S3 – File Permissions

 

That’s it. This is how you create a new S3 bucket in AWS and upload files into it. Have a look here if you want to see how to create a static website using just AWS S3.

Remember that is always a good thing to read the documentation. See more here: http://docs.aws.amazon.com/AmazonS3/latest/user-guide/upload-objects.html 

As always, let me know in the comments if you have any questions.

error

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.