# AWS CLI

> Writing it down because I keep forgetting...
>
> [Docs](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)

\ <br>

## What is the AWS Command Line Interface?

<br>

* An **open source tool** that allows you to interact with AWS services using the command-line shell
* With AWS CLI, you can run commands with **minimal configuration** from your desired terminal program that implement the same functionality provided by the browser-based AWS Management Console
  * `Linux shells`
    * Run commands on **Linux** or **MacOS** using common shell programs like **bash**, **zsh**, **tcsh**
  * `Windows command line`
    * On Windows, run commands using **PowerShell** or **Windows command prompt**
  * `Remotely`
    * Run commands on **EC2** instances through remote terminal programs like **PuTTY**, **SSH**, or **AWS Systems Manager**

\ <br>

## Installing the AWS CLI version 2 on Linux

<br>

### 1. Download the installation file

> Using `curl` command

```bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
```

<br>

### 2. Unzip the installer

```bash
unzip awscliv2.zip
```

<br>

### 3. Run the install program

```bash
sudo ./aws/install
```

<br>

### 4. Confirm the installation

```bash
chloe@chloe-XPS-15-9570 ~
$ aws --version
aws-cli/2.0.19 Python/3.7.3 Linux/5.3.0-61-generic botocore/2.0.0dev23
```

\ <br>

## Configuring the AWS CLI

<br>

### configure

```bash
$ aws configure get aws_access_key_id
default_access_key

$ aws configure get default.aws_access_key_id
default_access_key

$ aws configure get aws_access_key_id --profile testing
testing_access_key

$ aws configure get profile.testing.aws_access_key_id
testing_access_key
```

<br>

ex)

> Checking region

```bash
chloe@chloe-XPS-15-9570 ~/Workspace/kendra-button/frontend/kendra-button-front
$ aws configure get region
us-west-2
```
