scopely-devops / skew

Apache License 2.0
242 stars 70 forks source link

route53 and iam don't execute #115

Closed bkruger99 closed 6 years ago

bkruger99 commented 7 years ago

Fresh install w/ Vagrant xenial64 (also on osx). Using pip install for release.

When trying to scan IAM or route53 (aka no region services), code just returns.

ubuntu@ubuntu-xenial:~/.local/lib/python2.7/site-packages/skew$ find . -name "*.pyc" -print
./exception.pyc
./config.pyc
./resources/__init__.pyc
./__init__.pyc
./arn/__init__.pyc

sample code:

import skew
arn = skew.scan('arn:aws:route53:us-west-2:xxxxxxxxxxxxxx:*/*')                                                                          
for resource in arn:
    print(resource)
    print(resource.data)
bkruger99 commented 7 years ago

I think the issue is currently that if I am looking at IAM or route53 for instance and I specify a specific region, it'll never be found because regex will just skip by it (it doesn't match our search string, right?).

I have seen cases where there is some hostname construction (osx) and there's a complaint that the host doesn't exist, because of a name ends up being 'iam..amazonaws.com' (for instance).

This should all probably be gutted and favor using the json that ships with botocore - botocore/data/endpoints.json. The schema could get changed from under us (unlikely), but it takes us out of the business trying to maintain regions, endpoints, etc.

Short term, i'll try to figure out a fix, but figure things like IAM, Route53, etc. to pop up multiple times if you do multiple regions.

bkruger99 commented 7 years ago

One fix might be to just remove the "no region needed" components out of the list and let boto3 deal with it. It'll make multiple calls, but it solves the issue for now.

faridnsh commented 7 years ago

This is already fixed in the latest develop. Just not released yet.

avram commented 6 years ago

Fixed https://pypi.org/project/skew/0.17.0/