Coming Soon
Show timestamps
00:00
Let's take a look at how we can set up an EC2 instance running Windows instead of Linux.
00:06
It's pretty much the same process. We're going to go into the EC2
00:09
dashboard, and I'm going to launch a new instance here.
00:13
I'll just call this—uh, I don't know—test Windows instance.
00:17
And for the quick start base image, we're obviously going to select Windows.
00:21
From the selection here, let's see... There are a few different options. Twenty
00:27
five server... I guess I could do 2022 as well.
00:30
I'm just going to go with the most recent one, but it looks like I don't actually have t2.micro as an option here.
00:37
I guess that's just for the 2025 version. So if I wanted, let's see, 2022,
00:40
then it would still be free-tier eligible.
00:44
Yeah, so the 2025 image, for some reason, doesn't run on the t2.micro,
00:47
but the 2022 version does. So if I want to use the free tier, I
00:50
would have to use Windows 2022, which I can do right here.
00:54
But to be honest, Windows instances use up more
00:57
resources, so I generally won't deploy Windows to a t2.micro.
01:01
I'll always go a little bit bigger. So I'm just going to go with t2.medium.
01:04
It's just easier to have more resources. Actually, maybe even a t2.large,
01:07
just for these Windows instances.
01:10
For the key pair, I already made one when we set up the Linux instance, so I can
01:14
just use that same key pair for all the EC2 instances as long as they're in the same region.
01:18
So I'm still in that Oregon region. Network settings—I'm going to leave, yeah, just the same.
01:23
I'm going to create a new security group here and allow RDP traffic instead of SSH traffic.
01:29
We'll connect to Windows instances by default using RDP—Remote Desktop Protocol—instead of SSH.
01:36
We'll see how to do that in a moment. I'll allow that from anywhere.
01:39
By default, we get 30 gigabytes for our SSD.
01:43
That seems fine. I'm just going to launch this instance. So this is just the most basic Windows instance.
01:48
That's launching, so I'll head over and grab the details here.
01:52
Again, I'm just going to select this instance. We can see all the details—it's going
01:55
to be just like the Linux details, but we're going to connect a little bit differently.
02:00
So I'm going to come over here and go to the RDP client
02:03
connection settings, because we are going to connect with an RDP client.
02:07
On my Mac, I have Microsoft Remote Desktop, and that's what I'll use to connect to this instance.
02:13
I think I can actually—yeah—I can download a Remote Desktop file, which I'll do right here.
02:17
So I'll just download that. It will go into my Downloads directory.
02:21
If I open that up, it should try connecting to my remote EC2 instance, but now I need the
02:27
password for the Administrator on the Windows EC2.
02:31
I can get the password here, and remember, we used
02:35
the same key that we used to connect over SSH for Linux.
02:39
So to get the password here, we actually have to use that same key that's stored on my
02:43
local machine and use that to generate a new password.
02:47
It's going to ask to decrypt a password, and it needs my private key.
02:50
Where do I put in the private key? Oh, I've got to wait four minutes after launching the instance.
02:54
That's kind of annoying. Okay, I guess I'll just wait four minutes.
02:58
So, in the RDP client, after four minutes once it's launched, you can click "Get Password" here because we'll need that to connect over RDP.
03:04
Right here, we upload the private key file. Again, this is the same key used for SSH when we
03:08
did the Linux instance, but we're going to use it now to generate the password for the Windows instance.
03:14
I can't actually see my hidden directories here, so I'm just going to open... my .ssh
03:20
directory on my Mac, and then it was that us-west-2 key.
03:25
There it is right there. I'm just going to drag that in and open it.
03:28
And this is my private key. You should never share this with anyone.
03:33
I'm just going to delete this after the video, but this is the key we use for SSH.
03:38
This is the key we're going to use to decrypt the password. So let's see...
03:42
Is it going to give me a password? There it is. That is my password.
03:45
So if I copy this, then head back over to RDP,
03:49
I can paste this password in—same password as right there.
03:53
And then if I continue and then allow, continue again,
03:56
this should now create an RDP connection to that Windows instance in Oregon.
04:00
Here we go. Okay, so yeah—I am now connected to a Windows instance in Oregon, which is pretty cool.
04:05
While this is setting up, I'm just going to head back over to
04:08
my web console so we can take a look at a couple of things.
04:12
First of all, if we go to launch a new instance—I'm not going to launch one right now—I just want to look at the settings.
04:16
So, for on-demand Linux-based pricing for a t2.micro,
04:20
it's going to be 0.0116 USD per hour.
04:23
If we're using Windows, it's 0.0162 per hour.
04:27
Okay, they seem like small numbers, but they add up, especially with bigger instances. We're paying more for Windows.
04:32
We have to pay for the Windows licensing fee, and Windows tends to be
04:35
more resource-intensive, so we're going to need a larger instance size.
04:39
It just kind of seems worse to use Windows when we could be using Linux—spending less and getting better performance.
04:45
There are occasions when you need Windows—and you know if you're a person who needs
04:49
Windows—but for the most part, when we're doing things, I think it just makes way more sense to use Linux.
04:54
However, I do sometimes like to set up a quick Windows instance when I need to test out Windows things.
05:00
For example, for this course, I have my CloudCourse CLI.
05:05
This is a full Windows setup. It even comes with the annoying pop-ups that I don't care about.
05:10
Come on, go away. I just want to use a browser—really, Microsoft?
05:14
Okay, here we go. Alright. So, like I said, for cloudcourse.dev, I had to make a
05:19
command line interface application that you could use to verify you've done everything correctly.
05:23
But this has to be cross-compiled and work on Mac, Windows, and Linux.
05:27
So, when I want to test on Windows and I don't have a Windows machine, it can be really,
05:31
really easy to just set up an EC2 instance running Windows and
05:35
then test out my applications on this instance rather than needing my own Windows machine.
05:39
I can then download my software that I want to test on Windows and make sure it works correctly.
05:45
Let's see. I'm going to open up a PowerShell prompt here and…now I have to remember PowerShell.
05:51
I think I can cd into…am I going to be able to just get away with that?
05:55
Downloads. Oh, nice. Okay, so I can cd into Downloads
05:59
and then I can try running cloudcourse.exe since it's a Windows machine.
06:03
Then I can just test out if my software works on Windows, or I can cross-compile on this actual Windows machine.
06:07
Like, I've had situations where I'm working on a desktop app and it just makes more
06:10
sense to compile on Windows, so I quickly set up a Windows VM for that.
06:13
So, for me, I really only set up these Windows EC2 instances when I need to test that something works on Windows.
06:19
And again, there are more use cases—some people need to set up their entire infrastructure on Windows EC2 instances.
06:25
But for the rest of this course, we're really just going to be using Linux EC2 instances,
06:29
except for the next part, where we're going to talk about Mac OS EC2 instances.