Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: aws cli usage #120

Merged
merged 3 commits into from
Mar 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)