- [Narrator] Over the years, AWS has done a phenomenal jobevolving the web console into a remarkably approachablepowerful tool for managing infrastructure.Throughout this course, I'll primarily be usingthe web console, however, only through automationis the management of your AWS infrastructure scalable.One of the many available automation toolsis 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 installand configure it.
Here I've opened a web browser on the leftand a terminal window on the right.With this setup I can read instructions in the browser.I can also copy commands from the web browserinto my terminal.Let's go ahead and do a Google search for how to downloadthe AWS CLI.The very first link will take you to the comprehensiveAWS documentation, where you can downloadand install the CLI.Scrolling down on this page, I see that the CLIis available for Windows, as well as Linux, OS X or Unix.
![]()
AWS Command Line Interface — Installing, Configuring and Using cmacroot No Comment AWS provides its customers with many ways to interact with their services, today we are going to cover the installation, configuration and usage of the AWS CLI.
I happen to be on a Mac, so I'm going to usethe bundled installer for OS X.As you can see the prerequisites,we obviously need the operating system, as well as Python.I'm going to run the Python version commandto make sure I have a version that's compatible.Great, I have Python 2.7.10 installed,which meets the minimum requirement.Scrolling down a little bit more,I can see that AWS provides the three commands I needto download and install the CLI.I can simply highlight them, copy them and paste theminto my terminal.
The first command downloads the CLI bundleto my local machine.The second command simply unpacks the local CLI bundle.This third command is what does the actual install.The password it's asking me for is my local passwordon my Mac.Okay, looks like that finished successfully.You can see in the output, it says I can now runusr/local/bin/aws -version to make sure that itactually works.So I'm just going to copy that, paste it in and run it.
Great, it looks like I'm running version 1.10.53of the AWS CLI.Let's also just confirm that usr/local/bin is in my path,by typing which aws.Wonderful, that means I can type aws on the command lineinstead of fully qualifying it.On Windows, you can use the MSI installerto make the AWS CLI availablefrom the Windows command prompt.However, if you have Windows 10,I highly recommend installing the Windows subsystemfor Linux.
Command Line Interface Download
This gives you a bash environment.Detailed instructions on how to installthe Windows subsystem for Linuxcan be found on Microsoft's website.I will be using bash throughout this course,so it will be much easier to follow along on Windowsif you use the Windows subsystem for Linux.I can start the bash environment by opening the Windows menuand typing bash.Bash on Ubuntu on Windows is what I'm looking for,so I can make sure it's selected and hit the enter key.Great, that pops me up a bash environment.
As of this recording, the bash environment is still in beta.As such, there are a variety of utilitieswhich are not installed by default.One of those utilities is the Python package manager, Pip.Let's go ahead and install Pip using the instructionson the AWS Install CLI page.Unintuitively for Windows users,we have to use the instructions for Linux.First I need to download the installation script.I can simply copy the command and paste itinto my bash environment.The next thing I need to do is run the script with Python.
Wonderful, if you remember from the bundled installinstructions, it uses the unzip utility.This is something that is not installed by defaultin this environment.Let's go ahead and install the unzip utility using apt-get,a common way of managing packages on Linux.Wonderful, that installed successfully.At this point we can either use the bundled installercommands to install the CLI,or we can simply use Pip.Since we just installed Pip,let's use it to install the CLI.
Once again, we need to use the Linux command.I simply copy it in and paste it into my bash shell.We can confirm that the CLI was installed correctlyby typing which aws.One thing to note about CLI configuration.It stores configuration information in a .aws directoryunder your local users home directory.One feature the CLI supports is the conceptof named profiles.
That is, you can specify a named profile as a parameterto any CLI command.When you do that, it will reference the configurationoptions for that named profile.This is very useful when you need to access multipleAWS environments using different credentials.When I initially configure the CLI,I like to specify junk values in order to force meto use the named profiles I so strongly prefer.Let's see what those values are by runningthe AWS configure command.The first thing it asks for is my AWS access key ID.
This is a unique ID for a specific credential.I'm going to specify a junk value, none.The second thing it looks for is the AWS secret access key,which is the password that accompanies the key ID.Again, I'm going to specify a junk value.The third thing it looks for is the default region name.The region name, when passed into the CLI,tells the CLI what region to run the command in.Finally, it asks for a default output format.
The output format is typically textor JavaScript Object Notation or JSON.JSON is very programmer friendly and it is particularlyuseful when automating.Let's take a peek at the configuration filesthat just got created in my .aws directory.I'm going to use the terminal text editor called VIto look at these files.In the config file, you can see that for the outputand for the region, the junk values of none, that I specifygot passed in.
Let's take a look at the credentials file.We see that in the credentials file, the access key IDand secret access key, also contain the junk default valuesthat I put in.In this course, I'll be using two separate AWS accounts.I've already created credentials for those accounts.Now let's set up the CLI, so that I have named profiles,so I can reference the accounts by profile name.The first thing we'll do is copy in the config information.I'm going to use the VI editor to make my changes.
The first thing I'm going to open is the config filefor the CLI, and the second file I'm going to openis my configuration file.In the config file that the CLI references,the only profile we see is the default one,with the junk values for output and region.Opening up my local configuration information,I see that I have two profiles set up.The first one is my snijim.dev.admin profileand the second one is my snijim.research.admin profile. Hp officejet 8500a plus manual.
Those happened to reference two separate accounts.I'm going to copy that profile informationand go back into the config file that the CLI references.I've simply appended the named profilesto the CLI config file.I see that for my dev account,the default region is eu-west-1,and for my research account,the default region is us-west-2.Let's do the same thing for the credentials file.Again, the credentials file simply contains a defaultprofile with junk values.
Meanwhile my local credentials fileactually has valid credentials.I'm going to do the same thingand copy those credentials,go back to my CLI credentials file and paste them in.Now, for my dev profile and my research profileI see that I actually have valid credentials.Now that that bit of tedious configuration is done,I'm ready to use the CLI.
This post provides a step-by-step guide with a list of commands on how to install AWS CLI on macOS using Homebrew.
What is AWS CLI?
“The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.” ~ AWS CLI
What is Homebrew?
Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS operating system. It is known as the missing package manager for macOS. How to download game data for dream league soccer.
Quick Commands
The following is the single command required to install AWS CLI on macOS using Homebrew.
Aws Command Line Interface Download SoftwareBrew Commands
This section provide a quick set of commands on how to install AWS CLI on macOS using Homebrew. It is assumed that Homebrew is already installed. If not, please follow this link.
SummaryAws Command Line Interface Download For Windows 7
Congratulations! You have successfully installed AWS CLI on macOS making use of Homebrew. Please feel free to follow me on any of the social media platform to leave comments.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |