Welcome to the Elastic Load Balancer Demo and the lab number three of our AWS Introduction Course. I am at the aws.amazon.com. It's the homepage of the web console, and I'm logging inside. This is the homepage of the AWS web console. The first thing that you want to do is to double check that you in the right region. The lab and tutorial is written for the Northern California which is "us-west-1". And if you go to the url and double check, it says "us-west-1". That's what you want to have.
So now let's go and create our first instance. It will be the public instance because we want to create an image. So I'm going to the EC2 and clicking on the Launch Instance. I'm picking Amazon Linux, the default size, t2.micro. And then in my user data, I will copy this special user data which will create Apache HTTP server, and it will create the web page as well, the HTML file. Feel free to copy the content or just paste it from the file, from the source code that I provide. This is the HTML that will be shown. If you want, you can modify it. It's very interesting. It's more interesting to have your own text, to see that your own text deployed, than to use the boiler plate. So feel free to read my comments for the user data. They're in the lab document and also in the source code. But we will move forward. All the settings are default. We will be having the Public IP for this particular instance, just because we want to make sure all the packages are installed. So for the storage, you just keep the default setting, the tags are not necessary.
And for the Security Group, if you have an open Security Group, you can pick that. I have an open one, so everything is open. Then we click Launch. I would say "Proceed wiithout a key pair" because I'm sure that my user data will work brilliantly and everything would be deployed. That's the power of the user data. If you tested it once, you can rest assured most of the times it will work correctly. Of course if you have a lot of dependencies that you are installing, might not work. But in most cases it's good and you don't need to go and manually do anything. So our instance is starting. You can verify that you can see that "Hello World", "Hello World University", "Node University". So it's not ready yet.
Okay, so this is our message, "Hello World Node University". You saw me pushing that user data, of obviously your URL would be different. So now we can go back and now we can create an image. This way we do not have to recreate this instance. We don't have to run user data, we don't need to do anything. So from the menu, you select "Create Image", you put the image name, image description, and then you would click Create Image. Once your image is created, there are few places where you can verify that you actually have that image.
One of the places in your EC2 console, so you would go under Images and you would find AMIs. So I already created this image a few weeks ago. Your date would be recent, but you can verify that everything else looks good. such as the ebs support, your description, the name, etc., etc. So once you have this image ready, you can terminate your public instance because you're not going to need it anymore.