banner



How To Install Aws Cli On Ubuntu 16.04

AWS is an excellent cloud service provider. One of the reasons for its popularity is the easy to use web interface and the broad range of services offered.

 AWS too provides a rich set up command line based tool to access different services. These handy tools enable developers to automate, configure and manage AWS deject resources from a Linux terminal.

In this post, we'll walk through the process of installing and configuring the AWS CLI and see an example of how easy information technology utilize to create and manage AWS resources.

What is the AWS CLI

AWS CLI is a tool that pulls all the AWS services together in ane central panel, enabling developers to hands command and configure multiple AWS services using a command line interface.

Information technology reduces and in some cases eliminates the dependency of navigating & interacting with AWS Management Panel.

The AWS CLI is an open source tool congenital on superlative of the AWS SDK for Python (Boto) that provides commands for interacting with AWS services. With minimal configuration, you can start using all of the functionality provided past the AWS Management Console from your terminal.

How to install AWS CLI on ubuntu

To install AWS CLI y'all volition demand an AWS account, in guild to get an access key ID and hugger-mugger admission key and Python installed on your ubuntu development desktop.

At that place are two methods you tin choose to install the AWS CLI on your Ubuntu Laptop, both will deliver the same outcome so you tin can cull whichever is best for yous. We'll provide both so can choose.

How to install the AWS CLI using PIP

To Install the AWS ClI simply open a terminal window and execute the following control:

Once the command has completed y'all tin can then ensure the $PATH to AWS CLI is configured which enables you to globally use the command: aws . You tin can do this in one line control using :

ensure y'all refresh your bash contour past either closing the last window and reopening it or by using

How to Install AWS CLI on Ubuntu via Ubuntu repository

Alternatively, you tin install the AWS CLI directly from the default Ubuntu repositories.

In one case install has completed yous can confirm the version using

The console will respond with something like too

Alert

The version of AWS CLI bachelor in the Ubuntu Bundle repository may not exist the most up to engagement version. So if y'all desire to ensure you're using the most upward to date version it is probably improve to install the AWS CLI using pip.

Configure AWS Cli

Earlier using aws-cli, you lot demand to configure your AWS credentials. You lot can do this in several ways:

  • Surround variables
  • Shared credentials file
  • Config file
  • IAM Part

The quickest way to get started is to execute aws configure which will configure your credentials to use for all our AWS configuration workflows.

Cheque out the Configure AWS CLI with Multiple accounts

Y'all volition exist prompted for your credentials. Yous volition demand to create IAM business relationship details. Y'all should not use your AWS Root account details.

After completion of this step the AWS CLI has at present been configured on your motorcar and ready for use.

Detailed information of the aws configure check out the Configuring the AWS CLI

Quick case to test AWS CLI

In lodge to illustrate how easy it is to utilise the AWS CLI to manage and configure AWS resources we will run through the process of creating and deleting an Amazon Uncomplicated Storage (S3) container.

The offset footstep to check out what is bachelor is simply to call up the assistance file for the aws s3 commands

We can use the AWS CLI to list all the S3 buckets we take access too with our business relationship

all your S3 bucket names will be displayed in your terminal window.

Nosotros can create a bucket using the following command and optionally gear up the region if you would like to create a bucket in a region other than the default region you configured.

Create S3 bucket using aws last

Remove S3 bucket using terminal

We tin can also delete the saucepan by issuing a like command but changing information technology slightly to use rb

Copy entire directory of files to S3 bucket using terminal

If you lot accept an entire directory of files you desire to load up to test you don't have to add them line by line. The AWS CLI comes with some great flexible option switches yous can utilise to simply load up all documents in the in a directory.

An example of this, say you wanted to load up all the files in your electric current working directory to an S3 bucket. You could use the following control with the boosted --recursive selection

Download files from S3 using concluding

If you lot want to download all the files from our S3 bucket you tin easily exercise so using the sync command

Benefits of the AWS CLI

The main benefits of the AWS CLI, that information technology saves developers time and frustration from having to the AWS Management Console. Thus enabling easier installs, support of all services, automating processes and commands from a familiar terminal command environment.

  • Easier to install. Smooth, quick, uncomplicated, and standardized.
  • Supports all Amazon Web Services. yous control all the services from one simple tool.
  • Saves time. Developers notice information technology faster and easier to utilize the AWS CLI once they reach a sure level of proficiency.
  • Scripting. The power to automate control of all Amazon's web services with scripts. Shell scripts make information technology piece of cake to fully automate cloud infrastructure.

Configure AWS CLI with Multiple accounts

Developers will typically have several accounts to employ across several environments. Fortunately, AWS CLI enables you to configure several profiles to use.

AWS CLI enables you to configure multiplenamed profiles that are stored in theconfig andcredentials files.

You tin can configure boosted profiles by usingaws configure with the--contour choice, or past calculation entries to the config andcredentials files.

If you lot desire to create contour for development then but execute the configure with the switch --profile

Y'all can then add your development specific AWS Key and Secret and Region details. Y'all can then configure your application to brand utilize of the specific profile should you require.

Developers will often and preferably should have different AWS Keys and Hole-and-corner to the actual Production keys being utilised. Undoubtedly developers should have separate environments they apply for executing, running and testing i.e. Evolution, Staging and Product Environments.

In all likelihood these environments will connect to different resources then every bit not to corrupt the Production Data etc.

In .cyberspace core you tin can configure the AWS SDK to retrieve the desired Profile data from the Environment Specific AppSettings files. For instance, yous can create an appsettings.Development.json to make utilise of the Development Profile.

The convention for all developers to create a development contour eliminates the need for storing AWS Keys and Secrets in the App Settings.

This can also easily be achieved in Node, PHP, Ruby, Become and Python environments past following a similar strategy and making use of those languages configuration options.

Disadvantages of the AWS CLI

  • Your Admission Keys are stored in plaintext on disk.This is NOT secure.
  • You're e'er using permanent Access Keys for auth rather than Temporary Admission Keys that are rotated.
  • Your credentials sit down around on disk forever and the default Named Profile gets used for all commands if yous forget to specify a different one, which is fault prone.

Summary

The AWS Control Line Interface (CLI) is a unified tool to manage your AWS services enabling you with just 1 tool to download and configure, y'all can control multiple AWS services from the command line and automate them through scripts.

  • Near
  • Latest Posts

Source: https://garywoodfine.com/how-to-install-and-configure-aws-cli-on-ubuntu/

Posted by: beusbeffight.blogspot.com

0 Response to "How To Install Aws Cli On Ubuntu 16.04"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel