awsudo

A sudo-like tool to configure AWS environment variables and call programs
This script is useful for programs like Terraform, which doesn't support MFA when assuming roles.
Installation
python3 -m pip install awsudo-py
Usage
$ awsudo -p administrator@staging terraform apply
$ awsudo -p administrator@staging env | grep AWS
AWS_ACCESS_KEY_ID=AKIAIXMBKCITA257EHIQ
AWS_SECRET_ACCESS_KEY=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
usage: awsudo [-h] [-p PROFILE] PROG [ARG [ARG ...]]
Set environment variables using profile
positional arguments:
PROG executable to run
ARG args to run with program
optional arguments:
-h, --help show this help message and exit
-p PROFILE, --profile PROFILE
AWS Profile to assume
Development
Poetry is necessary to install this project for development.
# install dependencies
make install
# linting
make typecheck
make fmt
# error on bad formatting
make fmt-check
make lint
# testing
make test
# runs fmt, typecheck, build
make all
# building/publishing
make clean
make build
make publish
# build and install program directly
make install-program
make uninstall-program
# run program (we can't pass args to Make)
poetry run awsudo
Prior Art
There are a lot of similar programs to this one. I believe makethunder/awsudo and electronicarts/awsudo are the best alternatives. The only problems with makethunder/awsudo are that it isn't published on pypi and that it doesn't use the newest api for caching sessions. electronicarts/awsudo has all of the features, but it uses an internal session cache, instead of sharing with awscli. If you need SAML support though, the internal cache is a necessary compromise, so this package is great in that case.
| project | awscli profiles | session caching | SAML | language | published |
|---|---|---|---|---|---|
| this project | yes | yes | no | python3.6 | pypi |
| makethunder/awsudo | yes | yes* | no | python | github |
| electronicarts/awsudo | yes | yes⦿ | yes | ruby | rubygems |
| pmuller/awsudo | yes | no | no | python2.7, python3.5 | pypi |
| ingenieux/awsudo | no | no | no | golang | no |
| meltwater/awsudo | yes | yes | no | bash, node | npm, dockerhub |
* supports session caching through older technique using awscli as a dependency
⦿ uses a daemon to cache sessions internally
Metadata
Release files for awsudo-py 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| awsudo-py-0.1.2.tar.gz | 16.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| awsudo_py-0.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 57.4 kB
Release files / awsudo-py-0.1.2.tar.gz
| Download URL | awsudo-py-0.1.2.tar.gz |
|---|---|
| Size | 16.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdcc2e63d7f694a6528f91d367a4d4c45b67b0127c380e7f7eee30e92bf511ac
|
|
BLAKE2b-256 checksum How to use checksums |
50c1b701396a70029ac46e94039322cb971a689062b47fd09014de47f7f7db4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.11 CPython/3.7.1 Darwin/17.7.0
|
Release files / awsudo_py-0.1.2-py3-none-any.whl
| Download URL | awsudo_py-0.1.2-py3-none-any.whl |
|---|---|
| Size | 41.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ea9e0387ea1caefe49be0b0c3afa128186c102c1ddccb57f6ca1f94f0c4ecf2
|
|
BLAKE2b-256 checksum How to use checksums |
0239ee1466ab63106c4bc93ed9fd021a16ddf9f01a2ae2a548df636b8e3c32b6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/0.12.11 CPython/3.7.1 Darwin/17.7.0
|