What is AWS CLI and how we should use it? - NareshIT
What is AWS CLI and how we should use it

What is AWS CLI and how we should use it? - NareshIT

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:

No alt text provided for this image

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:

  • ???????Groups
  • ???????Permissions
  • ???????Tags
  • ?????Access Advisor
  • ???????Security Credentials

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:?

No alt text provided for this image

And you will be asked for:

  • ??????AWS Access Key ID
  • ??????AWS Secret Access Key
  • ??????Default region name: chose your AWS region
  • ??????Default Output format: This can be JSON, Text, or table.

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

No alt text provided for this image

Step3: This will list the content of the existing bucket. Now, let's create a new s3 bucket with the help of AWS CLI

No alt text provided for this image

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

No alt text provided for this image

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:

  • We will train you based on the certificate you are applying for based on your personal preference.
  • There will be extensive practical training, and you will be taught practical of each nitty-gritty of the AWS based on the certificate applied.
  • You will get extensive theoretical training via classroom or online training, whatever you select.
  • You will get well-crafted and highly-researched course material.
  • Chance to work on a live project.
  • And we assure you of complete guidance till you get the certificate from AWS.?
  • Also, we will guide you in your job hunt if you are a fresher.
  • On-premises complete AWS training for the corporates with all the relevant offerings mentioned above.

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

要查看或添加评论,请登录

社区洞察

其他会员也浏览了