Giter Site home page Giter Site logo

aws_list_all's Introduction

aws_list_all

List all resources in an AWS account, all regions, all services(*). Writes JSON files for further processing.

(*) No guarantees for completeness. Use billing alerts if you are worried about costs.

PyPI

https://travis-ci.org/JohannesEbke/aws_list_all.svg?branch=master

Usage

You need to have python (both 2 or 3 work) as well as AWS credentials set up as usual.

Quick Start with virtualenv:

mkvirtualenv -p $(which python3) aws
pip install aws-list-all
aws-list-all query --region eu-west-1 --service ec2 --directory ./data/

Quick Start Output:

---------------8<--(snip)--8<-------------------
--- ec2 eu-west-1 DescribeVolumes Volumes
--- ec2 eu-west-1 DescribeVolumesModifications VolumesModifications
--- ec2 eu-west-1 DescribeVpcEndpointConnectionNotifications ConnectionNotificationSet
--- ec2 eu-west-1 DescribeVpcEndpointConnections VpcEndpointConnections
--- ec2 eu-west-1 DescribeVpcEndpointServiceConfigurations ServiceConfigurations
--- ec2 eu-west-1 DescribeVpcEndpoints VpcEndpoints
--- ec2 eu-west-1 DescribeVpcPeeringConnections VpcPeeringConnections
--- ec2 eu-west-1 DescribeVpcs Vpcs
--- ec2 eu-west-1 DescribeVpnConnections VpnConnections
--- ec2 eu-west-1 DescribeVpnGateways VpnGateways
+++ ec2 eu-west-1 DescribeKeyPairs KeyPairs
+++ ec2 eu-west-1 DescribeSecurityGroups SecurityGroups
+++ ec2 eu-west-1 DescribeTags Tags
!!! ec2 eu-west-1 DescribeClientVpnEndpoints ClientError('An error occurred (InternalError) when calling the DescribeClientVpnEndpoints operation (reached max retries: 4): An internal error has occurred')

Lines start with "---" if no resources of this type have been found, and start with "+++" if at least one resource has been found. ">:|" denotes an error due to missing permissions, other errors are prefixed with "!!!",

Currently, some default resources are still considered "user-created" and thus listed, this may change in the future.

Details about found resources are saved in json files named after the service, region, and operation used to find them. They can be dumped with:

aws-list-all show data/ec2_*
aws-list-all show --verbose data/ec2_DescribeSecurityGroups_eu-west-1.json

Special treatment and removal of default resources which are performed by default during data handling can be omitted with --unfilter and following arguments: - cloudfront - medialive - ssmListCommands - snsListSubscriptions - athenaWorkGroups - listEventBuses - xRayGroups - route53Resolver - kmsListAliases - appstreamImages - cloudsearch - cloudTrail - cloudWatch - iamPolicies - s3Owner - ecsClustersFailure - pinpointGetApps - ssmBaselines - dbSecurityGroups - dbParameterGroups - dbClusterParameterGroups - dbOptionGroups - ec2VPC - ec2Subnets - ec2SecurityGroups - ec2RouteTables - ec2NetworkAcls - ec2FpgaImages - workmailDeletedOrganizations - elasticacheSubnetGroups

How do I really list everything?

Warning: As AWS has over 1024 API endpoints, you may have to increase your allowed number of open files See JohannesEbke#6

Restricting the region and service is optional, a simple query without arguments lists everything. It uses a thread pool to parallelize queries and randomizes the order to avoid hitting one endpoint in close succession. One run takes around two minutes for me.

More Examples

Add immediate, more verbose output to a query with --verbose. Use twice for even more verbosity:

aws-list-all query --region eu-west-1 --service ec2 --operation DescribeVpcs --directory data --verbose

Show resources for all returned queries:

aws-list-all show --verbose data/*

Show resources for all ec2 returned queries:

aws-list-all show --verbose data/ec2*

List available services to query:

aws-list-all introspect list-services

List available operations for a given service, do:

aws-list-all introspect list-operations --service ec2

List all resources in sequence to avoid throttling:

aws-list-all query --parallel 1

aws_list_all's People

Contributors

johannesebke avatar kntrain avatar tylerpinson avatar afeld avatar felixhuttmann avatar gliptak avatar martinhoefling avatar tkalus avatar arel avatar pwaller avatar tjmcewan avatar wamonite avatar

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.