Skip to content

Commit 809d0f7

Browse files
authored
doc: aws cli usage (#120)
2 parents 9438fbc + 023ae6a commit 809d0f7

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

docs/usage/README.md

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ This guide us how to use the `devops-toolkit` with serveral usecases
2222

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

25+
## AWSCli
26+
27+
- Check [**awscli_usage**](./awscli_usage.md)
28+
2529
## Troubleshooting
2630

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

docs/usage/awscli_usage.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Use awscli in the devops-toolkit
2+
3+
## Prerequisite
4+
5+
An AWS account
6+
7+
## awscli document
8+
9+
Some document to help you start with awscli
10+
11+
- <https://docs.aws.amazon.com/cli/>
12+
- <https://github.com/tungbq/devops-basic/tree/main/topics/aws>
13+
14+
## Note
15+
16+
To use the existing container instead of creating one, use `docker exec` command instead of `docker run`
17+
18+
```bash
19+
docker exec -it my_devops_toolkit /bin/bash
20+
```
21+
22+
## Use case 1: Configure credentials and list S3 bucket with awscli
23+
24+
```bash
25+
docker run --rm --network host -it devops-toolkit:latest
26+
###############################################
27+
# Now we are in the docker container terminal #
28+
###############################################
29+
# Configure credentials
30+
aws configure
31+
# List S3 buckets
32+
aws s3 ls
33+
```
34+
35+
Sample Result
36+
37+
```bash
38+
root@docker-desktop:~# aws configure
39+
AWS Access Key ID [None]: xxxxxxxx
40+
AWS Secret Access Key [None]: xxxxxxxx
41+
Default region name [None]: xxxxxxxx
42+
Default output format [None]: xxxxxxxx
43+
```
44+
45+
## Use case 2: Using AWS config from the host
46+
47+
Mount the `.aws` when running toolkit container
48+
49+
```bash
50+
docker run --rm --network host -it -v ~/.aws:/root/.aws devops-toolkit:latest
51+
# List bucket
52+
aws s3 ls
53+
```
54+
55+
## Troubleshooting
56+
57+
- For any issues, check [this reference](../troubleshooting/TROUBLESHOOTING.md)

0 commit comments

Comments
 (0)