This video demystifies the cloud by defining SaaS, PaaS, IaaS, AWS, Azure, and Google. Watch a demo of how easy cloud is using Amazon Web Services EC2.
- [Instructor] Howdy, in this video, we're going to talk about one of my favorite subjects, cloud computing. If you're familiar with using the cloud, you may want to skip ahead, but we wanted to do some hands-on show-and-tell for folks that haven't gotten to work with the cloud yet. While arguing about what cloud is was popular for a few years. Most agree that the definition the National Institute of Standards and Technology put out in 2011 is sufficiently definitive. Anything that has on-demand self-service provisioning, broad network access, resource pooling, rapid elasticity, and a metered service counts as cloud.
There are three general cloud service models. Software as a service or SaaS is where an entire application is provided for you. Salesforce, TurboTax, and Office 365 are examples of SaaS offerings. Platform as a service or PaaS is where you can deploy custom applications to the cloud platform without managing the underlying systems yourself. Google App Engine, Microsoft Azure App Service, and Pivotal Web Services which has hosted Cloud Foundry are examples of public PaaSes.
Infrastructure as a Service, pronounced IaaS for obvious reasons, is where you get operating system level access to discrete systems in the cloud. These are usually Vms and not bare metal. Google Compute Engine, Microsoft Azure Virtual Machines, and of course the 900-pound gorilla, Amazon Web Services EC2, showcase IaaS offerings. But enough theory, let me show you what that means. Here I'll log into my Amazon Web Services account to show you the basics.
When you log into the Amazon console, EC2 is the part of Amazon that gives you virtual machines. So follow the link to the EC2 dashboard. We'll go to the Instances section. This shows me all of the Instances that I either have currently running or it also shows terminated ones for about an hour after they've been killed. If I select one that is already running, we can see the size of the Instance it is, its public IP address, its Security group rules, and other details about the Instance.
But we want to start an Instance of our own, so we'll go up to this blue button at the top that says, Launch Instance. It then gives us the opportunity to choose what image we want to start our Instance from. It provides us with a bunch of stock operating systems from Ubuntu to Windows. We can also choose specialty images from the community or from vendors, or images that I've made and already saved in AWS. For this demo, we'll go ahead and pick the Amazon Linux base image.
Then it takes us to Choose an Instance Type screen where you determine the size of the virtual machine that you want to run. These range from the one CPU, one gig of memory on the t2.micro small Instance, but go up through 64 CPUs and 256 gigs of RAM on very large Instances. You have a large set of options to choose from in terms of CPU memory and disk configuration. For this demo, we're going to pick the t2.micro Instance size.
And click Review and Launch. This brings us to a final screen where we can review and configure other aspects of our Instance. We could go in and change Security Group settings as you can see this is going to allow me to reach Port 22 on this box from anywhere that will allow me to SSH into it easily. Under Storage, we can change what disks and what type of disks that we want associated with this Instance. I'm just going to take the defaults and click the blue Launch button at the bottom.
So now it asks me for the SSH key pair that I want to associate with this box. I've already created an SSH key pair called, infra-auto, and uploaded it. And I'm going to select it and acknowledge that if I don't have my key pair file, then I'm going to start a box that I'm never going to be a to get into. And then I click the Launch Instances button. Amazon starts launching the Instance, it provides a convenient link here where you can go back to the EC2 screen and watch it.
So you can see it's initially in a pending state and initializing. It can take it up to five minutes to boot up and become fully operational. So we're going to pause here and not subject you to five minutes of waiting and we'll be right back when the Instance is finished creating. All right we're back. As you can see, our Instance is now in running state. Amazon has assigned it a Public IP address and a Public DNS entry that we can use to connect to it.
So let's go ahead and log into this box. All right here we are at our bash command line. This is just terminal on the Mac, on Windows you can use the Windows 10 Anniversary edition, Linux shell. We're going to SSH, into our Instance. We're going to use the SSH key that I set up, the default user name for Amazon, Linux is ec2-user, and we're using the external DNS entry that the Amazon console gave us.
Since it's our first time connecting, it's going to us, "Are we sure that were doing "the right thing?" Once we say, "Yes," it'll let us in. And here we are in our own little Amazon Linux box. Do a PS to show you the running processes. It of course has only been up for a couple minutes. I'm going to go ahead and clear my screen. Now if I want to install something, then it should be as simple as for example, yum installing the NGINX Web server.
That looks good to me. And then we should be able to go back to our web browser. So I've gone back to the AWS console. I'm going to go change the Security group for this Instance to allow port 80 access. As we saw earlier, it's set up to only allow port 22, therefore when I start my web server, it's running, but no one can get to it. So I'll add a simple HTTP rule for port 80 for a Mini IP address.
Now that we've installed our NGINX Web server, I'm going to go ahead and start it. I'm going to type, sudo service nginx start. Then I'm going to type, curl localhost, just to check and make sure that it's running. Okay, great. So we know that we have a running web server on this box. Now we need to go back and expose it in Amazon. So Amazon tries to be secure by default, you can see that I've gone back here to the Instance we just started.
By default, it has inbound rules only allowing Port 22, which is SSH. So to access our new web server, we'll go through to the Security groups and add a second inbound rule to allow HTTP. We go to the Inbound rules and edit them. We add a new rule. It has popped down with the common choices. And we'll add a rule for HTTP Port 80 from all IP addresses.
And once that is saved, we should be able to go to a second tab in our web browser, paste in the external DNS of our Instance, and there we are, our brand-new NGINX Web server that we've started using Amazon. But using the UI isn't very DevOps, so we're going to do the same thing starting it using the Amazon command line. So I've logged out of my AWS Instance, I'm back here at the bash prompt. and we're going to use the Amazon CLI which I've already installed here.
I'll type, aws ec2, which is the EC2 section. And I'll show you the Instances that I already have running with the described Instances. I'm also going to specify the region, which we were using the us-east-1 region to run our Instances. Amazon has different regions or data centers all across the world. And when I do that, I get a lovely JSON Blob back describing every one of my running Instances in detail.
Just cleared my screen, so that we're starting with a clean page. So to start a new Instance, we're going to do what we did in the UI, but using the command line. So again with the aws ec2, this time we're going to use the run-instances command. And the things that we specified of course were our image ID, you may not have noticed when we went in through the UI that it had a specific kind of AMI code name, but it did, this d91d1, that is the same Amazon Linux AMI that we selected through the UI as our Instance type.
We're going to use a t2.micro again. And we're going to run it in our us-east-1 region. Hit Enter, it'll think about it a second, and it gives us the same information back that we were viewing through the console in terms of, now I am initializing your Instance with this private IP address in these details. We don't have the public IP address yet, it's not actually up yet. You can either pull here at the command line using describe-instances or you can go back to the console and watch and see when it's finished coming up.
So here we're back in the console, you could see our Instance that we started with the command line initializing. So now I have a bunch of Instances running, but that's okay. The t2.micro size costs 2.3 cents an hour which is $16.50 a month, but I don't plan to run these all month. If I want to get rid of one, I can simply go in and choose to terminate it. You can start and stop the Vms, which will maintain their state and just turn them off and on.
To terminate them, it'll actually destroy the entire VM and make it go away. And so I'll make that one go away. So of course Amazon has way more than just these virtual machines, they have a giant list of services that includes everything from managed MySQL databases, called RDS, to MapReduce options to DNS to their own CDN. They have a wide variety of services.
Google Cloud Platform and Microsoft Azure have similar portfolios. They try to put together all the chunks that you don't want to have to build yourself. Many of the companies I've worked at in the last decade, including mid-sized enterprises, have migrated completely to public cloud hosting for their computing needs. Unless you have specialized needs that require specialty on-premise hardware or suffer from extremely unusual network conductivity challenges, public cloud offerings can give you extremely efficient access to services on demand.
And that's a quick primer on public cloud. As we talk more about automation, the power unlocked by this form of self-service provisioning will become even more clear. Of course when we properly automate, we wont' be logging into through the UI and tampering with our systems manually, we'll driving all of that out of source control using automation. Next, we'll discuss hardware and private cloud.
- Testing your infrastructure
- Going from infrastructure code to artifacts
- Unit testing your infrastructure code
- Creating systems from your artifacts
- Instantiating your infrastructure from a defined model
- Provisioning with CloudFormation
- Immutable deployment with Docker
- Container orchestration with Kubernetes