In this guide, you will learn how to get started with the AWS CLI and use it to interact with AWS services.
The AWS Command Line Interface (AWS CLI) is an open-source tool that enables you to interact with AWS services using command-line shell commands. The AWS CLI provides the same functionality as the AWS Management Console but allows for automation and scripting.
bash
, zsh
, or tcsh
to run AWS CLI commands.The AWS CLI allows you to perform administrative and resource management tasks on AWS, offering direct access to AWS services’ public APIs. The CLI is updated as AWS releases new features and services, often within 180 days of launch.
Profiles are collections of settings that the AWS CLI uses to execute commands. By default, the AWS CLI uses the default profile, but you can define multiple custom profiles.
--profile
parameter or set the AWS_PROFILE
environment variable to switch profiles for the current session.You can configure the AWS CLI using the aws configure
command. This command will prompt you for four pieces of information:
Your AWS access keys consist of the Access Key ID and Secret Access Key. These are used to authenticate and sign requests made to AWS.
The default region is where the AWS CLI will send requests unless a region is explicitly specified in a command. You should select the region closest to your infrastructure or where most of your AWS services reside, e.g., us-west-2
for the US West (Oregon) region.
The default output format determines how the results of AWS CLI commands are displayed. The available formats are:
grep
, sed
, or awk
.The AWS CLI is a powerful tool that can simplify AWS management through scripting and automation. Configuring the CLI properly allows you to efficiently manage AWS resources from your command line environment.