Closed mholtby closed 8 years ago
It looks like your loop at the top is working, it's just that the string representation of these objects is a little misleading IIRC. Have you tried printing an attribute of the obj rather than the obj as a whole? The block below works for me:
>>> import skew
>>> arn = skew.scan('arn:aws:ec2:::instance/')
>>> for i in arn:
... print(i.data)
...
{u'Monitoring': {u'State': 'disabled'}, u'PublicDnsName': '', u'State': {u'Code': 16, u'Name': 'running'}, u'EbsOptimized': False, u'LaunchTime': datetime.datetime(2016, 5, 30, 14, 30, 6, tzinfo=tzutc()), ...
Your loop does not look correct. Perhaps it's just a typo but this should work for you:
import skew
arn = skew.scan('arn:aws:ec2:::instance/*')
for i in arn:
print(i.arn)
When I use resource.data and explicitly choose an individual ARN it works fine and I get the results -
My end goal is to pull ARNs for all AWS resources within an AWS Account. Trying to get the script at the bottom of the stackoverflow (http://stackoverflow.com/questions/30674938/how-to-progammatically-list-all-aws-resources-and-tags) working but that's not either.
Any help gratefully received!