Skip to main content

Getting Started With Windows Server On Amazon EC2

Hands-On Lab


Photo of

Training Architect





In this learning activity we are going to explore launching our first Windows EC2 instance on Amazon Web Services. This learning activity will focus on the basic concepts of EC2 as well as using automation and powershell to "bootstrap" a web server. We'll learn about elastic IP addresses, security groups, and connecting to the Windows 2012 R2 EC2 instance.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Getting Started with Windows Server on EC2

In this Learning Activity, we are going learn how to launch an EC2 Instance running Windows 2012 server.

First, log in to the AWS console using the provided user name and credentials. Navigate to the EC2 dashboard, click on Launch Instance

Creating Your EC2 Instance

First, choose an Amazon Machine Image (AMI). Since we want to use Windows, scroll down and search for Microsoft Windows Server 2012 R2 and click Select. On the next page, select the t2.small instance type and click Next.

Configuring Your Instance

Leave the 'Number of Instances' as 1 and enable Auto-assign IP. Copy and paste the provided PowerShell script (because it's a Windows instance) in the "User Data" under Advanced Details.

The script can be located by clicking on the provided GitHub URL provided under the instructions associated with this activity. Copy the power shell scripts to your clipboard. Click Next after pasting it into user data space.

In the Volume Type tab, select General purpose SSD (GP2) and click next.

Click on Add tag tab and type 'Name' in the Key space, with any arbitrary name in the value space. Select Add another tag and fill out the key and value spaces with app and windows-web-application-photos, respectively. Hit Next to proceed to the next page.

Select Add rule, Change the Type dropdown on the placeholder list item to HTTP and select Review and Launch.

Launching Your Instance

Check that the settings are correct (if you've followed along, there will be nothing else to change), then click the Launch button in the bottom right. You will receive a prompt window for the key pair. Go ahead and create a new key pair, and name it whatever you would like. Be sure to download it into a location that you can easily access.

Finally, click the Launch Instances button to instruct AWS to launch an instance with the settings we've defined.

You can either copy the 'Public DNS (IPv4)' or 'IPv4 Public IP' and paste it into the URL bar in your browser, and you will see a basic website with web server instance ID and availability zone.

Connect to a Windows Based EC2 Instance

From the EC2 dashboard, select the Connect which is next to the Launch Instance tab. Select Get Password from the small pop-up window, select Choose File to select your .pem file, i.e. your private key, and click Decrypt Password.

Click Download Remote Desktop File, then New. Fill out the connection name with 'Window-server', and PC name with your Public IP Address. The User name should be 'Administrator'. Copy and paste your password into Password space.

Close out the pop-up window, double click on remote desktop page, hit on continue and get connected to your Windows instance.

Elastic IP Addresses

Finally, we will learn how to associate an elastic IP address to an EC2 instance. When you stop and restart your instance, a new public IP address is assigned to it. Select Elastic IP from the list on the left-hand side of the EC2 dashboard, under Network & Security.

Click on Allocate new address tab and select Close. By default, the new IP address is not in use. You must associate it to an instance.

Right-click on the IP address and select Associate Address, select your instance for the Resource type, and select your existing Windows instance for Instance. Click Associate.

You can verify that this works by going back to your EC2 instance and checking that the Public IPv4 IP has been replaced with the newly associated elastic IP address. Your public DNS name should also be replaced.

Congratulations! You've completed this Learning Activity! Once both boxes have been checked off on your dashboard, you can click "Grade Activity" and move on.