What is AWS CLI and how we should use it? - NareshIT
Naresh i Technologies
Only Institute to offer the 'Most Comprehensive eLearning Platform to suit the self-learning needs of all CMS and LMS
AWS is the leading cloud service provider with around 34% cloud market share currently. It is also the oldest and most developed cloud service provider, and you can understand why it's number one even more than Azure at present. AWS CLI is a tool that helps in the management of all AWS services. And you can manage multiple AWS services via the CLI and provide the option for automation via the script. In this article, we are going to find out how we can make use of the AWS CLI. Naresh I Technologies is among the top five computer training institutes in India and the number one computer training institute in Hyderabad. Contact us today for your AWS training.
- Prerequisites to Use AWS CLI
1.??????AWS account: You will need an AWS account. The new AWS account provides free tier access for 12 months.
2.??????And AWS CLI is installable on macOS, Linux distribution, and Windows OS.
a.??????Windows installer for 64-bit and 32 bits
b.?????For MAC and Linux: You need to follow the below steps:
??????????????????????i.?????Do the installation of Python 2.6.5 or a later version.
?????????????????????ii.?????Instant pip, which is the Package installer for Python
Run the below command from the command prompt:
New user creation
Step 1: To start, you should log in to the console using your AWS account credentials.
Step 2: Once you log in, you will see the AWS Management Console Dashboard.
Step 3: Below the "Find services," type "IAM" in the text box.
Step 4: Now, you will find the IAM or the " Identity and Access Management Console" for AWS. Its console provides the below functionalities.
a.??????AWS resources and services access management
b.?????The user creates an option and permission managing option
Creating Group and Managing it:
Step 5: You need to click on the "Users" option, which you will find in the left vertical menu.
User Permissions
Step 1: To start with, you need to click on "Add User," which you will find in the Add User in the AWS IAM Dashboard.
Step 2: You can have access to the only management console, or through programmatic access, you can have access to it as well as API and AWS CLI. We are going to choose Programmatic access as we will use AWS CLI.
Step 3: Now, provide the user name, and we have already selected the programmatic access on this very page.
Step 4: Now, click on next after you chose the access type.
Step 5: Now, we have to assign permissions to this new user.?You can:
a.??????Add it to the existing group
b.?????Copy the existing user permission
c.??????Attach to the user's existing policy
Step6: For the current task, we are attaching the "existing policy" by selecting the "Administrator Access" policy.
a.??????IAM Policies defines permission.
b.?????When policy relates to the AWS Resources, it inherits the permissions in it.
c.??????Briefly, it is a permission template.
Step7: After you have added the existing policy, you can relate the tags with the resources
a.??????Tag is the assigned label to the resource.
b.?????Each tag comes with a key and value, and the value is optional.
c.??????You can categorize the AWS resources with the help of the tags.
Step 8: Click on "next," and you will see the review screen. It is a summary of what you have selected.
Step 9: After you have verified the summary, click on create. You will get a new user with the username and the details.
领英推荐
User Creation Response
a.??????You will find the "Access Key ID" and the "Secret access key" on the user creation success screen.
b.?????And we require storing them securely and not sharing them with anybody.
a.??????Alternatively, details are available as CSV files as well.
b.?????Keep the key or the CSV file at some safe location, as you cannot retrieve the secret access key if it is lost.
Now, click on the close, and you will see the user dashboard. You thus have the new user.
?- How to use AWS CLI?
– Configuration
Step1: Click on the new username. You will see the relevant details of the user.
Like:
Step 2: Here, we are going to use the Security Credentials Object, now click on the security credentials tab.
Step3: You will see Access Key Id, which you made with "Active" status.
Step 4: In this case, the Access key status is a significant security feature for the administrator.
Step 5: Now, you have the user with access to the AWS resources programmatically.
How to configure Command Prompt/Terminal
1. You need to log in to the command prompt in "Windows" and "the terminal window" in the case of "mac" and "Linux."
2. We, however, need to configure the CLI before we access AWS resources through CLI.
We need to run the below command for configuring the AWS CLI:?
And you will be asked for:
Now have configured the CLI with the user profile we created.
?AWS CLI Test Run
Step 1: We are going to use AWS S3 in our AWS CLI demo
Step 2: Run command
Step3: This will list the content of the existing bucket. Now, let's create a new s3 bucket with the help of AWS CLI
Step 4: This will result in a new bucket creation.
Step 5: Now, let us try bucket creation in some other region than the default region
Step 6: we can now find it created in the s3 via the management console for verification. You will also find the "new region," which confirms we are correct.
?- Conclusion
AWS CLI is quite useful.?The management console cannot do some AWS tasks through AWS CLI can do any job programmatically, and we have already discussed in the previous article why we should use it
Naresh I Technologies is among the top 5 computer training institutes in India. Also, it is the number one computer training institute in Hyderabad. We provide training for all computer technologies. We also serve all students as well as "professionals" and corporates via online training, classroom training, and on-premises corporate training. Our trainers are highly experienced, and we have world-class computer lab facilities. If you join us, we assure you of getting well-researched course material, and we move forward during the training with a well-thought plan. Hence, you always know what you have to learn and prepare yourself well. And after attending our training sessions, your knowledge base will become firmer.?Also, by the end of the course, you will find yourself ready to face the IT market. And if you opt for corporate training for your employees, by the end of it, you will find your employees good enough to face the new challenges you have thought of while choosing for the corporate training. AWS is not a must for all IT techies as it's the most well-developed cloud service in the market. We provide AWS training also. Contact us today for your AWS training.
What you will get through our AWS training:
You can contact us anytime for your?AWS training?online as well as call us directly, or you can give us a missed call. And one of our customer care representatives will contact you asap.
Follow us for More Updates:?https://bit.ly/NITLinkedIN