I am going to assume you already have some insight into the services AWS offers and most importantly, the EC2 instance. If you don’t, here’s a quick recap/summary:

AWS offers EC2 as a server, more like what you would run in your physical data center.It’ll have access to storage, memory, and a network interface,

and its primary drive will come with a fresh and clean operating system running. Follow this link to learn more about EC2 instances.

Now that we know what EC2 is( did you open the link? No seriously, open it . ill wait).

AWS allows us to launch EC2 instances in regions. You can checkout your region by clicking the right top corner of the console. Follow this link to learn a bit more about AWS regions. AWS offers two ways of launching instances:

  • using the AWS console
  • using the AWS CLI(which is why we are here right?)

okay enough talk, let’s get right into it.

To launch an instance, we need to follow the following steps which will be treated in detail:

  • install AWS CLI.
  • configure AWS CLI.
  • generate key pair.
  • create a security group for instance.
  • create/launch an instance.

Install AWS CLI

Installing the AWS CLI should be a very simple process. The latest version at the time of this writing is 2.0.54. You can check your CLIversion by running this in your terminal:

zeus-of-python@eli:~$ aws --version

This gives the following output:

aws-cli/2.0.54 Python/3.7.3 Linux/4.15.0-118-generic exe/x86_64.ubuntu.18

On Linux, you can install the latest version of the CLI by running the following command.

zeus-of-python@eli:~$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"

unzip the package and install.

zeus-of-python@eli:~$ unzip awscliv2.zip
zeus-of-python@eli:~$ sudo ./aws/install

verify installation.

zeus-of-python@eli:~$ aws --version

For Windows and Mac, follow this link to install the CLI.

#aws-free-tier #aws-ec2 #aws-cli

Launching an EC2 Instance Using AWS CLI
1.15 GEEK