How to install the AWS CLI on macOS in 2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey how is it going chris here from 99scloud.com in this video i will be showing you how to install the aws cli for mac os [Music] hi and welcome back in this tutorial we will learn what cli is and what you can use it for we will install the aws cli on our mac then we will create an iam user with programmatic access so that the aws cli can access the services in the cloud we will then configure the aws cli with the new user credentials and in the end we will test the aws cli to make sure that everything works so without further ado let's get right started okay so what is the aws cli and what can we use it for the aws cli is a unified tool to manage aws services through command line commands so it's basically the command line equivalent to the web console over which you can administrate your services you can create new aws services edit these services and also delete the services through the command line directly on your mac the command line tool is also useful to upload files to s3 buckets and other uses such as create and upload aws lambda code so now that we know what the aws cli is and what it does we can get started with the installation okay so let's get started with the installation aws has a page that explains the process so you can search for it on google or find the link in the comment section below this video once on the page you'll see that they talk about the aws cli1 and the aws cli2 we will use the latest which is the aws cli2 and we will use the mac os user interface installer so click on that to start the download once downloaded execute the installer over the download section of the browser or through the downloads folder once the installer has started click the continue button and on the next screen click the continue button again you'll now see the license agreement screen so read the license and then click the continue button you'll get the message that you need to agree to license so click the agree button on the next screen it will give you some options on the installation keep this as is and click the continue button this brings you to a screen on which you can now change the install location by default it will install it for all users and that's fine let's have a look quickly what we see when we click on the change install location button so the recommendation is keeping the default and install it for all users on this computer if you however choose install for me only you will need to ensure that all the folders exist to where the aws cli will be installed otherwise you will get an error at the end of the installation you will then need to provide your passwords to give the installer permissions for the installation once the installation completed you can click the close button it will ask you if you want to move the installer to the trash you can click on the move to trash button as we don't need it any longer the next step now that we have installed the aws cli is to make sure that we have the aws binary in the system pass so that we can execute it without specifying the full pass to the directory the aws binary was installed in by default it is installed in a location which is usually not in the pass so that's why we are creating a symbolic link so in order to do that let's open the terminal window you can find the terminal window in your applications folder under the utilities folder the program is called terminal once the terminal is open you can type bash which is a little bit easier than the default shell that comes with your mac if you have installed the aws cli for all users then the folder will be under slash usr slash local and it will be called aws cli so let's create a symbolic link as we are running the command with sudo we will need to specify the system password i have previously installed the aws cli already that's why it is telling me that the file exists this won't happen if you install it for the first time okay now that everything is installed let's verify that we can execute the command click on the verify installation link on the website you'll see two commands that we can execute to check if all is okay which aws will output the path to the aws file so we know it is there then we can type aws minus minus version to see if we have the right version installed okay we have now the aws binary installed and ready but if we execute it we will not be able to do anything on the aws cloud the reason for this is because the aws cli needs to have access to the aws cloud in order to execute all these commands so we will now go into the aws identity and access management service called iam and there we can set up a user with programmatic access which our aws binary needs so that it can access the service the aws services remotely let's head to the aws website and login to the web console in case you haven't registered yet there is a link below this video to an article that explains how to register with aws you can also find the link to the aws website in the comment section below okay so once logged in you will be able to see all the aws services we will however use the search field and search for iam the aws identity and access management service iam is one of the services you'll have to familiarize yourself with as you'll almost always will have to use it when configuring new services or allowing users to access services on the main iem service page click on the users link and then on the add user button at the top on the next page you can add a username to your liking under access type you need to tick the programmatic access checkbox aws will only allow remote connections to this user if this box is ticked if you don't tick it you won't be able to remotely connect to your aws services once you've done that click the next permissions button on the next page you will have to specify a user group as we want to access all services we will specify the administrators group in our case but be careful and only do this if you know that your computer is secure if you wouldn't want to give access to everything you could create your own user group and only specify the services that you need access to but in our case we will go with the administrator permission so tick the administrator's checkbox and click next tags you can use text if he wants to group services together to identify them we will not do this and you can click on next review on the review page you will see a summary of what will be created and you can click the create user button to create the user once the user is created you can see that also an access key id and the secret access key has been created you'll need these keys for the programmatic access so don't click close yet click on the download csv link to download the keys to your computer so that you have them for later use you'll now see the user in the list if you would have to create new keys if you have forgotten to download or copy them you could create new ones here under the security credentials the secret key will only be visible once you have created the access key after that it will not be visible anymore and you will have to create new keys if you forgot to save them okay we are coming now to the next step which is to configure the aws cli with the user credentials that we have created you can use google and search for configure aws cli on mac or you can use the link in the comments section below this video to get onto the page that explains how to configure the aws cli with the user credentials that we have created in the topic section of the site click on the configuration basics link to get to the description on how to configure the aws cli and then you can click on the quick configuration with aws configure this brings us to an example page that explains what we need to do first we need to run the aws configure command then we will need to specify the aws access key id that we have created then we will need to specify the aws secret access key which we also have created then we need to specify the aws region which is the data center location that you have chosen by default and then we need to tell how we want to see the output and we will use json here as outputs so let's open our csv file where we have the user credentials in the terminal let's now run aws configure now we can copy and paste the access key id and hit enter then we can copy the secret key and hit enter again then we will add the region you can find the default region if you log in to the web console and it should be visible on the top right and then you can type json to select json as a default output format okay the configuration completed about what has actually happened in the background in the background aws configure has created a folder called dot aws in your home folder in this folder it created a credentials file and a config file with all the details so every time you run the aws command it will look up the credentials and the details from this file so now that we have configured the aws and edit the credentials we can finally test if everything is working so let's check if we can list all the buckets we have configured in our s3 service if you didn't configure any buckets don't worry about it then you will just get an empty output but it will at least show that you don't get any error and it should work so and here we go we see the list of my s3 buckets so that was it that brings us to the end of this video and i hope you are now able to manage aws using the aws cli if this video was helpful i'd appreciate if you could give it a thumbs up and subscribe if you want to see more content like this in future have a good one and see you in the next tutorial
Info
Channel: 99th Cloud
Views: 1,745
Rating: undefined out of 5
Keywords:
Id: vefyYGn9C00
Channel Id: undefined
Length: 14min 46sec (886 seconds)
Published: Tue Jul 20 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.