Skip to content

Commit

Permalink
doc: aws cli usage (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
tungbq authored Mar 17, 2024
2 parents 9438fbc + 023ae6a commit 809d0f7
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/usage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ This guide us how to use the `devops-toolkit` with serveral usecases

- Check [**helm_usage**](./helm_usage.md)

## AWSCli

- Check [**awscli_usage**](./awscli_usage.md)

## Troubleshooting

- For any issues, check [this document](../troubleshooting/TROUBLESHOOTING.md)
57 changes: 57 additions & 0 deletions docs/usage/awscli_usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Use awscli in the devops-toolkit

## Prerequisite

An AWS account

## awscli document

Some document to help you start with awscli

- <https://docs.aws.amazon.com/cli/>
- <https://github.com/tungbq/devops-basic/tree/main/topics/aws>

## Note

To use the existing container instead of creating one, use `docker exec` command instead of `docker run`

```bash
docker exec -it my_devops_toolkit /bin/bash
```

## Use case 1: Configure credentials and list S3 bucket with awscli

```bash
docker run --rm --network host -it devops-toolkit:latest
###############################################
# Now we are in the docker container terminal #
###############################################
# Configure credentials
aws configure
# List S3 buckets
aws s3 ls
```

Sample Result

```bash
root@docker-desktop:~# aws configure
AWS Access Key ID [None]: xxxxxxxx
AWS Secret Access Key [None]: xxxxxxxx
Default region name [None]: xxxxxxxx
Default output format [None]: xxxxxxxx
```

## Use case 2: Using AWS config from the host

Mount the `.aws` when running toolkit container

```bash
docker run --rm --network host -it -v ~/.aws:/root/.aws devops-toolkit:latest
# List bucket
aws s3 ls
```

## Troubleshooting

- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

0 comments on commit 809d0f7

Please sign in to comment.