Giter VIP home page Giter VIP logo

aws-tools's People

Contributors

bartekj avatar karolisl avatar kornik avatar modax avatar pangorgo avatar snieg avatar uridium avatar yveshwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aws-tools's Issues

AccessKeysPerUser quota

If you created more than one Access key ID and want to roll your keys, python throws the exception:

Traceback (most recent call last):
  File "/home/radar/.local/bin/aws-roll-keys.py", line 212, in <module>
    main()
  File "/home/radar/.local/bin/aws-roll-keys.py", line 156, in main
    resp = client.create_access_key()
  File "/home/radar/.local/lib/python2.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/home/radar/.local/lib/python2.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.errorfactory.LimitExceededException: An error occurred (LimitExceeded) when calling the CreateAccessKey operation: Cannot exceed quota for AccessKeysPerUser: 2

ZSH - command not found

Hi Bart :)
I have an issue with the tool when using zsh shell.
After installing with pip I'm getting:

zsh: command not found: awsenv

Any ideas to get your tool working on ZSH ? OSX should running now on zsh so it would be nice to have the tool compatible with this shell.

[aws-roll-keys.py] encryption fails while using a special characters

Encryption of rolled keys with fails if you have a special character in your GPG key:

DEBUG:gnupg:Âniegocki <[email protected]>: skipped: No public key DEBUG:gnupg:[GNUPG:] INV_RECP 1 Piotr à DEBUG:gnupg:Âniegocki <[email protected]> DEBUG:gnupg:[GNUPG:] FAILURE encrypt 9 DEBUG:gnupg:gpg: [stdin]: encryption failed: No public key

Adding gpg.encoding = 'utf-8' resolves the issue.

gpg.list_keys output without gpg.encoding = 'utf-8':

#!/usr/bin/python3
import gnupg

gpg = gnupg.GPG(use_agent=True)

private_keys = gpg.list_keys(True)
print(private_keys[0]["uids"][1])
$ ./gpg.py 
Piotr Åniegocki <[email protected]>

Fixed gpg.list_keys output:

import gnupg

gpg = gnupg.GPG(use_agent=True)

gpg.encoding = 'utf-8'

private_keys = gpg.list_keys(True)
print(private_keys[0]["uids"][1])
$ ./gpg.py 
Piotr Śniegocki <[email protected]>

aws-roll-keys.py not rolling keys correctly

Strange situation. I've rolled keys for one of my aws accounts and they where rolled in AWS but not saved in the encrypted file.

[1.91] barjak@x1:~$ aws-roll-keys.py -e test
Please enter passphrase for decrypting env files: 
Rolled key for env test: AccessKeyId=****************TH2XA; CreateDate=2017-01-25 13:19:54.978000+00:00

-rw-r--r-- 1 barjak barjak 0 Jan 25 14:19 env.test.conf.asc

After some debug we found a problem with gnupg in python.
Having both packets installed with pip

gnupg==2.2.0
python-gnupg==0.3.9

Its setting different gnupg home dir:

Initialised settings:
binary: /usr/local/bin/gpg
binary version: 2.1.11
homedir: /home/barjak/.config/python-gnupg
ignore_homedir_permissions: False
keyring: /home/barjak/.config/python-gnupg/pubring.gpg
secring: /home/barjak/.config/python-gnupg/secring.gpg

Printing detailed view for instances without ARN

When using aws-list-ec2.py -i ID, some instances return:

Traceback (most recent call last):
  File "/home/radar/.local/bin/aws-list-ec2.py", line 123, in <module>
    main()
  File "/home/radar/.local/bin/aws-list-ec2.py", line 119, in main
    get_ec2()
  File "/home/radar/.local/bin/aws-list-ec2.py", line 83, in get_ec2
    ('ARN profile', instance.iam_instance_profile['Arn']),
TypeError: 'NoneType' object has no attribute '__getitem__'

autocompletion

Switching between environments should autocomplete basing on names of encrypted files.
Kind of:

function envs() {
    local word=${COMP_WORDS[COMP_CWORD]}
    local files=$(ls ~/.aws/env*asc | cut -d "." -f 3)
    COMPREPLY=( $(compgen -W "$files" -- "$word") )
}

complete -F envs awsenv

aws-list-ec2.py - TypeError: 'NoneType' object is not iterable

Not sure what exactly is causing the problem but after printing out a larger list of instances it ending like this:

Traceback (most recent call last):
  File "/usr/local/bin/aws-list-ec2.py", line 116, in <module>
    main()
  File "/usr/local/bin/aws-list-ec2.py", line 112, in main
    get_ec2()
  File "/usr/local/bin/aws-list-ec2.py", line 100, in get_ec2
    for tag in instance.tags:
TypeError: 'NoneType' object is not iterable

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.