Skip to main content

Wrapper for AWS CLI v2

Project description

AWS CLI v2 for Python

PyPI - awscliv2 PyPI - Python Version

Wrapper for AWS CLI v2. Comes with zero dependencies, updates awscli, gives access to all services!

Before you start

  • This is not an official AWS CLI v2 application, rant there
  • Check the source code of this app, as you are working with sensitive data
  • By default this app uses amazon/aws-cli Docker image
  • To use binaries for your OS, run awsv2 --install
  • Cross-check the source code again, probably I want to steal your credentials

Installation

python -m pip install awscliv2

You can add an alias to your ~/.bashrc or ~/.zshrc to use it as a regular AWS CLI v2

alias aws='awsv2'

Usage

Install AWS CLI v2:

# do not worry if this fails, you can still use awsv2 if you have docker installed
awsv2 --install

Configure default profile if needed:

AWS_ACCESS_KEY_ID='my-access-key'
AWS_SECRET_ACCESS_KEY='my-secret-key'

# --configure <profile_name> <aws_access_key_id> <aws_secret_access_key> [<aws_session_token>]
awsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY}
awsv2 configure set region us-west-1

Use AWS CLI as usual:

# alias for
# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@
awsv2 s3 ls

# or as a python module
python -m awscliv2 s3 ls

Also, you can check scripts/example.sh

Docker fallback

Unless you run awsv2 --install once, application will use amazon/aws-cli Docker image. The image is not ideal, and it uses root user, so fix downloaded file permissions manually. Or just run awsv2 --install

Update it with docker pull amazon/aws-cli.

Container uses two volumes:

  • $HOME/.aws -> /root/.aws - credentials and config store
  • $(cwd) -> /aws - Docker image workdir

Extra commands

awscliv2 contains a few commands to make your life easier, especially in CI or any non-TTY environment.

  • awsv2 -U/--update/--install - Install AWS CLI v2
  • awsv2 --configure <profile_name> <aws_access_key_id> <aws_secret_access_key> [<aws_session_token>] - set profile in ~/.aws/credentials
  • awsv2 --assume-role <profile_name> <source_profile> <role_arn> - create a new profile with assume role credentials
  • awsv2 -V/--version - Output awscliv2 and AWS CLI v2 versions

Development

  • Install poetry
  • Run poetry install
  • Use black formatter in your IDE

How to help

  • Ping AWS team to release an official PyPI package
  • Help me to test MacOS installer and add Windows installer
  • Share your experience in issues

Versioning

awscliv2 version follows PEP 440.

Latest changes

Full changelog can be found in Changelog. Release notes can be found in Releases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

awscliv2-2.1.1.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

awscliv2-2.1.1-py3-none-any.whl (12.3 kB view details)

Uploaded Python 3

File details

Details for the file awscliv2-2.1.1.tar.gz.

File metadata

  • Download URL: awscliv2-2.1.1.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for awscliv2-2.1.1.tar.gz
Algorithm Hash digest
SHA256 9c2cb03d599859c66f5db9588c20be2743cdabdf52968269727dfb495b37f5a4
MD5 ab9dc3ae8012c8dda4eb096fe0c16ecd
BLAKE2b-256 c61eff475cdd3c931859cbc2d1800fba812656938c82bad3ff4ea20a3fce4cff

See more details on using hashes here.

File details

Details for the file awscliv2-2.1.1-py3-none-any.whl.

File metadata

  • Download URL: awscliv2-2.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.2.0 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for awscliv2-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf41b22bba9849edb17801b015b6bee12d3051a9dc12c70f9dfc2d87cba23c46
MD5 a77bee61e0fd359b0d6704027a832338
BLAKE2b-256 138f5f5a8bf25b86d233adecafdb340ff4b6aa3e703796dd8e45634b004ec873

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page