-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |