GithubHelp home page GithubHelp logo

awscliv2's Introduction

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.

awscliv2's People

Contributors

github-actions[bot] avatar vemel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.