Skip to content

Instantly share code, notes, and snippets.

@micksmix
Forked from sjjohansen/aws_cli_pyenv
Created August 19, 2020 19:42
Show Gist options
  • Save micksmix/3034d250589e170c6c6f812cabb4e3cf to your computer and use it in GitHub Desktop.
Save micksmix/3034d250589e170c6c6f812cabb4e3cf to your computer and use it in GitHub Desktop.
Adding AWS CLI in Python Virtualenv on MacOS X
# create a directory for you Python Virtual Environments
mkdir -p ~/pyenvs
# create one for the AWS cli then install the CLI
virtualenv ~/pyenvs/aws
~/pyenvs/aws/bin/pip install awscli
~/pyenvs/aws/bin/pip install boto
# run the configuration command. This will prompt you for yur Access Key ID, Secret Access Key and default region
# the config files it writes are in ~/.aws
~/pyenvs/aws/bin/aws configure
# to make life easier, so you don't have to activate the Virtual Env to use it, link the aws command into your ~/bin directory
ln -s ~/pyenvs/aws/bin/aws ~/bin/
# running a test command to make sure it works
aws iam list-users
# profile selection:
export AWS_DEFAULT_PROFILE=cbig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment