From the course: AWS: High Availability

Command Line Interface (CLI) for Mac - Amazon Web Services (AWS) Tutorial

From the course: AWS: High Availability

Command Line Interface (CLI) for Mac

"

- [Instructor] Over the years, AWS continues to do an excellent job, evolving the web console into an approachable, powerful tool for managing infrastructure. I'll primarily use the web console for configuration throughout this course. However, automation is crucial to managing AWS infrastructure at scale. One of the many available automation tools is the AWS command line interface or CLI. I'll be using it at times throughout this course. So let's take a moment to see how to install and configure it on MacOS. If you already have the CLI installed and are comfortable working with it, please feel free to skip to the next chapter. Here, I've opened a web browser on the left. And a terminal window on the right. With this setup, I can read instructions in the browser. I can also copy commands from the browser into my terminal. The easiest way to find the CLI is to fire up your favorite search engine, and search for download AWS CLI. In this case, I'm on a Mac. So I'm going to add the Mac suffix to that search. The first link takes me to the comprehensive AWS documentation, where I can download and install the CLI. I happen to be doing this install at a point of transition. Note that the CLI no longer supports versions, 2.6 or 3.3 of Python. Scrolling down a bit on this page I get to the prerequisites. Here I can check the Python version. So I copy that command and paste it into my terminal. Wonderful. I already have Python 2.7 installed on my laptop. I'm going to proceed and install the CLI using the bundled installer. Scrolling down a bit more, I can simply copy that command and paste it into my terminal. Okay. I see that the curl command to download the bundle has completed. As has the unzip command. All I need to do now is hit enter in the sudo command, to install the CLI will fire off. Here, I have to specify the password for the user on my laptop. After a couple of moments, I get the confirmation message that the CLI has been installed. Now I can simply verify which version of the CLI I have running. That looks great. All that's left now is to configure it. This can be done by simply running AWS configure. I am prompted for an access key ID and a secret access key. I'm going to choose to not specify those at this time. That said, I am going to specify a default region of us-west2. I also am prompted for default output format, which I'm simply going to skip it this time. When using the CLI, I prefer to use named profiles. By passing a profile parameter into the CLI when executing a command, it's possible to use different sets of AWS credentials. This is particularly powerful if you actively use the CLI with multiple AWS accounts. On a Mac, these files are stored in the AWS directory, under your home directory. The first file is a config file. And the second is a credentials file. I have pre-created those files for the accounts I'm going to use. Let's take a quick look at them now. In the config file, I can see the five named profiles of set up each with a default region. Examining the credentials file, I see the access key and secret access key that I'm using for each profile. I'm going to copy both the config and credentials file into the .AWS directory for later use. In the next video, I'll run through installing the CLI on a windows machine.

Inhalt