Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using aws-list-all as a library #54

Open
fygure opened this issue Nov 11, 2022 · 2 comments
Open

Using aws-list-all as a library #54

fygure opened this issue Nov 11, 2022 · 2 comments

Comments

@fygure
Copy link

fygure commented Nov 11, 2022

Hi I am new as well, thank you for creating this!

I am trying to use your module but am having trouble using it inside my python script... I need to list all services for each of my aws accounts but I don't know how I can use this module to do so.. I understand that it says it creates a json of data when running query/commands in the terminal but I cannot find any json produced. Please help/redirect thank you!

@JohannesEbke JohannesEbke changed the title question regarding my script Using aws-list-all as a library Nov 11, 2022
@JohannesEbke
Copy link
Owner

Currently, aws-list-all is a command line tool first, and a library second. However, I am open to pull requests that increase its utility in that respect!

If you want to use it from a script, you'd probably create and change to a new temporary directory yourself, and then call do_query from aws_list_all.query:

from aws_list_all.query import do_query
do_query(services=["ec2"], selected_regions=["us-east-1"])

This works for me, as in it drops a list of json files into the current directory.

@fygure
Copy link
Author

fygure commented Nov 12, 2022

Thanks so much! I found this to work as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants