sanderknape / assume Goto Github PK
View Code? Open in Web Editor NEWA simple CLI utility that makes it easier to switch between different AWS roles
License: MIT License
A simple CLI utility that makes it easier to switch between different AWS roles
License: MIT License
Using 0.4.0, I tried:
assume add myrole --role-arn arn:aws:iam::xxxx:role/mywonderfulpath/myrole
and it failed:
usage: assume add [-h] --role-arn ROLE_ARN [--profile PROFILE] name
assume add: error: argument --role-arn: invalid iam_role_type value: 'arn:aws:iam::xxxx:role/mywonderfulpath/myrole'
Hi Sander,
My team and I have been developing a framework for electricity market modelling which we have named assume. We have noticed that you also have a package on pip with the same name. As we are planning to target a large audience with our framework, we were wondering if it would be possible for you to consider renaming your package to avoid any confusion for users. We understand that this may be an inconvenience, but we would greatly appreciate your help in this matter.
Thank you for your time and consideration.
assume fails if you don't have a default
profile in ~/.aws/credentials
file. Even worse than that assume will wipe out the contents of the credentials file in this scenario.
steps to repro:
~/.aws/credentials
and ~/.aws/config
files. Make sure [default]
section is NOT in the credentials file.assume add
command.Error no section default
and now the credentials file is empty.➜ python -V
Python 3.7.9
➜ assume --version
0.4.0
➜ assume add myrole --profile testitorgmgnt-servicerole --role-arn arn:aws:iam::XXXXXXXXX:role/MyAccountAccessRole
Added role 'myrole' to the configuration. You can now assume this role with:
assume switch myrole
➜ assume list
myrole:
profile: testitorgmgnt-servicerole
role_arn: arn:aws:iam::XXXXXXXXX:role/MyAccountAccessRole
➜ assume switch myrole
Traceback (most recent call last):
File "/Users/zaro0508/.virtualenvs/py37-default/bin/assume", line 8, in <module>
sys.exit(main())
File "/Users/zaro0508/.virtualenvs/py37-default/lib/python3.7/site-packages/aws_assume_role_helper/__main__.py", line 23, in main
print(commands.switch(arguments.name))
File "/Users/zaro0508/.virtualenvs/py37-default/lib/python3.7/site-packages/aws_assume_role_helper/commands.py", line 91, in switch
for key in config_credentials.options('default'):
File "/usr/local/var/pyenv/versions/3.7.9/lib/python3.7/configparser.py", line 674, in options
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'default'
After clearing the session, the aws_session_token
property remains under the [default]
section.
Any plans to upgrade compatibility to Python 3.10? We get such errors when run with Python 3.10
Traceback (most recent call last): File "/opt/homebrew/bin/assume", line 8, in <module> sys.exit(main()) File "/opt/homebrew/lib/python3.10/site-packages/aws_assume_role_helper/__main__.py", line 14, in main commands = AWSAssumeRoleHelper() File "/opt/homebrew/lib/python3.10/site-packages/aws_assume_role_helper/commands.py", line 28, in __init__ self.config = yaml.load(stream) File "/opt/homebrew/lib/python3.10/site-packages/yaml/__init__.py", line 72, in load return loader.get_single_data() File "/opt/homebrew/lib/python3.10/site-packages/yaml/constructor.py", line 37, in get_single_data return self.construct_document(node) File "/opt/homebrew/lib/python3.10/site-packages/yaml/constructor.py", line 46, in construct_document for dummy in generator: File "/opt/homebrew/lib/python3.10/site-packages/yaml/constructor.py", line 398, in construct_yaml_map value = self.construct_mapping(node) File "/opt/homebrew/lib/python3.10/site-packages/yaml/constructor.py", line 204, in construct_mapping return super().construct_mapping(node, deep=deep) File "/opt/homebrew/lib/python3.10/site-packages/yaml/constructor.py", line 126, in construct_mapping if not isinstance(key, collections.Hashable): AttributeError: module 'collections' has no attribute 'Hashable'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.