In this lesson, we show how to use AWS camera interface on
an AWS instance and allow us to use it to create instance,
start and stop the instance and to associate
elastic IP address with a particular instance.
It allows us to have programmable control on the AWS instance.
For example, it allow us to pick up three instance geography separated by a hour around
the globe and wake them up every eight hours
in a wrong Robbie fashion to save money and be more efficient.
EC2 API is useful when we are dealing with large scale
of system or dealing with complex management requirements.
To make an image from an instance we simply select the instance and then select
the image menu item in
the action menu and choose the choose or create image menu item.
Enter the Image names.
We are going to use for other people or yourself to
recognize and then provide a short descriptions and
then click the create image button on the lower right and it will
take a minute to generate this image and it's pretty fast.
Basically, it's just copy what was a file and the content of
the images and saves that as a template for other people in Chrome.
To launching a image or to clone the image,
we click AMI entry in the images section of the left panel
and we select our coursera CS 691 AMI1 entery here,
and then select the launch menu in the actions menu.
We will go through the same set of configuration process,
the seven step process like before,
but instead of using AMI Amazon the image,
we are now using our own customized one.
Don't forget to choose next, configure instant detail.
Don't do the launching right away because we need to specify the tech name so
that we can uniquely identify the instance
when they are listing in the dashboard in step five.
Okay. So we choose a name this instance cchow_ami2,
so that we can't tell them apart from the previous one.
After setting the security group we open SSF, NTTP and NTTPS,
and also set our home IP address and we can
launch in the instance and it will start within a minute.
So, it's amazing how fast they are.
It used to be a few minutes, quite a few minutes.
Now we can stop and start from our first instance to control
the second instance using the AWS EC2 stop
instance command for and then we will try to restart them.
We just use AWS EC2 stop instance.
To create a new instance,
we can using the AWS EC2 run-instance and this name is kind of misleading.
It's not really that instance is already there.
Here is actually creating the instance,
so to actually start and stop,
we are not using run we are using the start and stop-instance.
Run instance is actually creating it from an image.
We first need to find out what other image ID, specific image ID.
It can be from AWS,
can be from support window,
can be from our own creations.
Then we also need to find out what is the security group ID and this security group
ID will set up and open up the specific pool the firewall to allow outside access.
We can find a security group ID,
lets say we like using the same image app while we set up instance we set up
we can click on the instance and then click on the security group information,
which will just show up in the lower right panel and click
on that the security group wizard one,
and it will pop up and showing you the entry of
the security group and right there in the second entry,
there is an ID start with SG.
SG is a shorthand notation for security group,
SG followed by some number.
Copy that down. That's what we're going to use.