From the course: Running Microsoft Workloads on AWS

Install the AWS CLI

- [Instructor] In the previous video, I walked you through the process of creating an account that could be used to programmatically access the Amazon Cloud from a command prompt environment. Now, I want to show you how to go into your Windows PC and set up that command prompt environment for Amazon Cloud access. So to do that, we're going to be installing a tool called AWS CLI. So to get started, what I want to do is open up an elevated PowerShell session and in Windows 11, the way that I would do that is by clicking on the start button and then going to terminal. And I'm going to right-click on terminal and choose the Run as administrator option. So that way we're opening up an elevated environment. I'll click yes. And so now, we're running an elevated PowerShell session, and you can tell that this session is elevated by the word "administrator" that appears in the tab at the top of the window. So what I'm going to do is type msiexec.exe /i and then we need the URL that points to the AWS CLI tool. So I'm going to type https://awscli. colon slash.amazonaws.com AWSCLIV2 because we're going to be downloading version two of AWS CLI. And then .msi. I'll press Enter, and this is going to start the installation process. And the installation process is simple. We click Next, we accept the license agreement, and click Next. And Click next again and click Install. And then click Finish. And at that point, AWS CLI is installed. Now one of the things that I found in working with AWS CLI is that sometimes, you have to restart your command prompt environment before you'll be able to use it. So that being said, I'm just going to go ahead and close out Windows terminal and I'm going to reopen it. So once again, I'm going to right-click on terminal and I'll go to Run as administrator and click Yes. And this time what I'm going to do is open a Windows command prompt window. So I'm going to click on the down arrow and choose command prompt. And now we're at the Windows command prompt. And I want to check to make sure that AWS CLI was indeed installed correctly. So I'm going to type aws because when you're interacting with AWS from a command prompt environment, not PowerShell, but from a Windows command prompt environment, all of the commands will generally start with aws. And then I'm going to type space and then dash dash, and then version. And you'll notice that I did use two dashes. In a Windows environment, command line parameters are often designated with a single dash, but in the open source world, oftentimes, parameters use two dashes, and that's what we're doing here. So I'm going to press Enter. And that indicates to us that AWS CLI was indeed installed successfully. So because it has been installed, we need to configure AWS CLI to use the credentials that we have established already. So to do that, I'm going to type aws configure. I'll press Enter. And I'm prompted for my AWS access key ID. And remember I pasted all of that to Notepad. So I'm going to open up Notepad and I'm going to select my access key, and I'll right-click on it and choose Copy. And then I'll press CTRL + V and press Enter. And now I'm prompted to enter my secret access key. Once again, I'll switch over to Notepad. I'll select my secret key. I'll right-click and choose Copy. And then I'll press CTRL + V and that paste the secret key. I'll press Enter. Now I'm prompted for the name of the default region. The region that I'm going to use is US East one. You're obviously going to use a region that's specific to your own use case. So I'll just go ahead and type us-east-1 and press Enter. And then I'm prompted to enter a default output format. What this is saying is that when I run an AWS command and it generates output, what format do I want that output to be in? And I'm just going to go with JSON. So I'm going to type JSON and press Enter. And the configuration process is complete. So that's how you go about setting up the Windows command prompt to access AWS.

Contents