A docker image for running AWS CLI commands.
It could be used in two ways:
-
You prefer to use your own version of AWS CLI but need to perform Shibboleth authentication to your account
-
You want to enjoy all available AWS-related tools by opening a bash session inside the container
You can use this image to access Shibboleth-protected accounts.
To create a temporary session, just run shib-auth
inside the container:
docker run --rm -it --volume "$HOME/.aws:/root/.aws" bostonuniversity/aws-tools shib-auth
It is suggested to wrap the command above as an alias:
echo "alias awslogin='docker run --rm -it --volume \"$HOME/.aws:/root/.aws\" bostonuniversity/aws-tools shib-auth'" >> ~/.bashrc
# Source the file or re-login to your host
This session will only be available for a few hours but you can alway run that command again to create a new one.
Note that this container will attempt to use Duo 2FA authentication but it's
been only tested for the push
method (both manual and automated).
You can modify these environment variables to fine-tune for your own case:
Variable name | Default value |
---|---|
AWS_REGION | us-east-1 |
AWS_OUTPUT_FORMAT | json |
AWS_LOGIN_URL | https://www.bu.edu/awslogin |
-
Open aws-shell with default aws profile:
docker run --rm -it \ --volume "$HOME/.aws:/root/.aws" \ --volume "$(pwd):/code" \ bostonuniversity/aws-tools
-
Open bash with a specific aws profile:
docker run --rm -it \ --volume "$HOME/.aws:/root/.aws" \ --volume "$(pwd):/code" \ -e AWS_PROFILE=<aws_profile> \ bostonuniversity/aws-tools /bin/bash
-
Persist the the shell history and other things across runs:
docker run --rm -it \ --volume aws-tools:/root \ --volume "$HOME/.aws:/root/.aws" \ --volume "$(pwd):/code" \ bostonuniversity/aws-tools /bin/bash
In Windows, the syntax is a little bit different, for example:
docker run --rm -it ^
--volume %cd%:/code ^
--volume C:\Some\Temporary\Directory:/root/.aws ^
--volume aws-tools:/root ^
bostonuniversity/aws-tools /bin/bash
docker run --rm -it --volume ${PWD}:/code --volume C:\Some\Temporary\Directory:/root/.aws --volume aws-tools:/root bostonuniversity/aws-tools /bin/bash
aws-cli
aws-shell
awsebcli
ecs-cli
bash
less
curl
git
jq
groff
py-pip
python
python3
nodejs
npm
chromium
To troubleshoot or add new features to this image, use docker-compose
.
The first step is to build the image locally:
docker-compose build
Then, you can run the container with bash:
docker-compose run --rm aws bash