# 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
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chloe-codes1.gitbook.io/til/aws/aws-services/aws_cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
