When I’m writing this tutorial I’m using macOS Sierra but everything should work correctly also on previous versions of macOS like El Capitan, Yosemite, Mavericks and so on.
This tutorial describes how to use the console to manage your cloud. I think it’s clearer and easier way than their website interface.
Let’s start. I assume that you’ve heard something about Amazon’s cloud. If not let me introduce you in the first chapter, everyone else can go directly to next chapters.
Table of Contents
What is Amazon’s Cloud?
We call it AWS, it’s shortcut from Amazon Web Services. At the beginning of Amazon there was just an online shop like thousand others. However, they grew up to spectacular size acting in many countries in the world. Working in this scale (from our – IT side of course) requires a lot of servers working together. Amazon engineers had to develop something that allows them to manage their server farms which are located around the world. Everything that they involved had to be easy, cheap and scalable. They did it and we are looking at it when we are using AWS.
- An account on Amazon.
- A user with access key ID and secret access key (instruction bellow).
- Installed brew.
Create access key ID and secret access key
I hope that you don’t need details how to create an account on Amazon website, so let’s go directly to creating a user with programmatic access.
- Login to your account on aws.amazon.com.
- On dashboard choose “IAM” in section “Security, Identity & Compliance”.
- Look at the left sidebar, there you have option “Users”, follow it.
- Click blue button “Add user”.
- Fill in the form, remember to mark options Programmatic access.
- Now you have to assign the user to some group or attach to it some polices. Other words, you are defining what user can do on Amazon Cloud. At this moment you can just add created user to the group ec2_admin which allows you to do most everything.
- Go to next step (review) and again click blue button, this time called “Create user”.
- You should see a table with created user, there are columns Access key ID and Secret access key.
- Copy your keys or download CSV file which contains that data.
Amazon provides two powerful tools which you can use to manage your cloud directly from command line. A both of them are written in python and
pip is nothing more than packet manager for python which allows us to install these tools.
Probably you should have installed it, you can check it using a command line, just type:
If get something like bellow then you can go to next step, if not, stay a little bit longer in this chapter.
pip 9.0.1 from /Library/Python/2.7/site-packages (python 2.7)
Ok, you don’t see anything that could look like message above. We know that you haven’t
pip, so let’s install it! Don’t close the command line and type that line:
brew install python
brew with python will try to install
pip as a default packets manager after it, try again run the command:
Everything that you have to do is to type that four words in your terminal. It will install this tool to use only by your user on your mac, so you don’t need to grant root permissions using sudo.
pip install awscli --user
If everything has gone ok then you could have run that command to see the version which you installed.
The command to install tool to manage Elastic Beanstalk is also really easy:
And again, let’s check the version.
Create the first project on Amazon behind load balancer
First, what you need to do is to create an empty folder and go there, you can do that:
mkdir amazon_project && cd amazon_project
After that, you have to type only one command
You can see some easy form, which asks you a few question to prepare everything.
Select a default region
Amazon has datacenter around the world, so choose the prime where you want to work. Definitely, servers at the US are cheaper than others, so for the test, you can choose Oregon.
3) us-west-2 : US West (Oregon)
Because you run first time that command you have to fill in next questions using yours Access key ID and Secret access key which you created few steps earlier.
You have not yet set up your credentials or your credentials are incorrect You must provide your credentials.
As a first step you have to provide your Access key ID and after that Secret access key.
You are creating your first project on Elastic Beanstalk you have to figure out some names, it could be
Oh no, “Elastic Beanstalk could not find any platforms”
You’ve just typed the name of your new application, and see you it as an error like in header? Don’t worry, you have to come back to Amazon website, to section “IAM”, then to “Users” find your new created user and click blue button “Add permissions”. There click on “Attach existing policies directly” and in search form paste it:
AWSElasticBeanstalkFullAccess. You should find out one result, check it and click blue button “Next: Review” and then another blue button “Add permissions”.
What exactly did you do? You give your user privileges to manage service Elastic Beanstalk. So, go on!
Type again that commend:
Choose region like previously and type a name your new application.
Select a platform.
Amazon has predefined few systems, some specialized and two general (
Multi-container Docker). We can start with
docker, so type a number which is on the left of the docker name.
Select a platform version.
Don’t ask, just choose the first option. On the first place there is always the newest version of the platform, you don’t need an older version, right?
Do you want to set up SSH for your instances?
Yes! Unless you don’t want to have access to your new instance from your command line, then ignore, but I don’t recommend it.
Select a keypair.
Security is so important on Amazon, so you need to create some keys which will be used to get connected to your instance. Chose options
[ Create new KeyPair ].
Type a keypair name.
Click enter, at this moment, the default name will be enough.
If stronger password then it will be harder to crack it, so don’t save your keyboard.
Enter same passphrase again:
Repeat your password, please.
And again repeat your password.
You are ready
It’s everything. Your Amazon account has been set up the same as your first application on Elastic Beanstalk. In some next post, I will describe how you can use it. Stay tuned!
Avaiable datacenters (regions)
|1||us-east-1||US East||N. Virginia|
|2||us-west-1||US West||N. California|
|11||sa-east-1||South America||Sao Paulo|