Package: resource-lister
Resource Lister (Multi Accounts)Resource Lister is an open source,NO CODE, interactive, python-based command line utility. Resource Lister can generatecentralizedlist of AWS resources (forsupported services) in single or multiple accounts in consumable CSV, or flatten JSON format. Resource Lister uses AWS SDK for Python(Boto3) sessions and underlying Boto3 List APIs to connect multiple configured child accounts and generate the  resource list. It essentiallysimplifiesaccessing of Boto3 list APIs. Resource Lister also provides an option to send generated list to  file,  s3, or print on command line.
Resource Lister can be configured to run from Cloud9, Cloudshell, EC2 or from your machine.Usage:Resource Lister Utility can be helpful to addresses following usecaseResource Lister is handy utility for Developers, Solution Architect, Account Owners, Cloud Ops team or anyone who simply wants to generate list of AWS Resources (forsupported services) across accounts and across regions without writing any custom code.Utility can help generate list of inventory of AWS resources across region and across accounts in near real time. For example, operation team wants to verify there is no lambda function created in restricted regions in near real time. You can also run the utility in batch mode across all the configured AWS services and create inventory.Utility can help enforce budgetary constraints. For example, utility can help Account owners to identify which AWS accounts doesn't have AWS budget setup.Utility can help identify particular type of list of resources.
for example, you can generate list of lambda function and filter lambda function using python 2.6 version.Utility flattens the response in consumable csv format.How it works?After you install and configure the Resource Lister you can run the Resource lister utility using pipx run.pipx run resource_lister1.Select AWS Service: Resource Lister Utility will prompt you to select the AWS Service: You can select any of 27 services example S3, lambda or ec22.Select Function: Resource Lister Utility will display number of supported functions for selected AWS service: Example List of S3 buckets or List of Aurora DB clusters or List of Lambda functions depending upon service you selected.3.Select Account(s): Resource Lister Utility will prompt you to select AWS Account for which you want to generate list of AWS resources:  You can enter ALL to select all the accounts or you can enter single account or comma separated list of accounts. If you don’t know the account number you just press ENTER and utility will prompt you with list of configured accounts.4.Select Region(s) for Regional services: If it's regional resource (example Lambda) you will prompt to select AWS Region; you can select ALL for all the regions or specify comma separated list of regions5.Result: Resource lister utility will then generates the list of AWS Resources for selected accounts and regions send the output to file or S3 Bucket or print on command prompt depending upon your configuration.OutputNote: You can also run the utility in batch mode across all the services in selected AWS Account by going to help --> option # 6PrerequisitePythonAWS CLIInstallationYou can install and runResource listerusingpipxOn macOS, Linux, install via pip (requires pip 19.0 or later)python3 -m pip install  pipx
python3 -m pip install  boto3
python3 -m pipx install resource-listerOn Windows, install via pip (requires pip 19.0 or later)If you installed python using the app-store, replacepythonwithpython3in the next line.python -m pip install pipx
python -m pip install boto3
python -m pipx install resource-listerRun the Resource Lister Utility using pipxOn macOS, Linux, install via pip (requires pip 19.0 or later)python3 -m pipx run resource_listerOn Windows, install via pip (requires pip 19.0 or later)python -m pipx run resource_listerResource lister utility will open in command promptSetupExpress setup for single account using default credentials.You will use default IAM credentials for this setup. Ensure your current default credentials should haveread only permissionsStep1 : Navigate to  "Add Master Account"Typehelp-->1[Manage AWS Account]-->1[Add Master Account.]Step2 : Configure Master account with dummy valuesSince express setup we are using default credentials. Use dummy values for Master Account ARN likearn:aws:iam::<Your 12 Digit Account>:role/dummy_roleand for child account role name enterdummy_roleCongratulations! AWS Account is successfully configured.Step3: Navigate back to main searchType 0 to exit0-->0Step4 : Test Utility by generating list of s3 buckets .csv fileEnter AWS service for help (help) for Exit (0) :-->s3Please select any of following options:[List of S3 buckets][List of the objects in a S3 Bucket]
Please enter option HERE-->1Please enter comma separated account id(s) or ALL  HERE-->ALLUtility will create output folder and generate the .csv file with list of s3 buckets in your account.Multi Account configurations.Cloud9 setupCloudshell setupHelpGeneral helpSupported Services and FunctionalitySupported Services and FunctionalityServiceFunctionsaccessanalyzer1.List of IAM Analyzers2.List of findings for specified  IAM Analyzerbudgets3.List of budgetscloudformation4.List of Cloudformation Stackscloudfront5.List of CloudFront distributions6.List of CloudFront functionscloudtrail7.List of  Cloud Trailscloudwatch8.List of Cloudwatch Dashboards9.List of Cloudwatch Metricscodecommit10.List of Code commit Repositoriesdynamodb11.List of DynamoDB tablesec212.List of EC2 instances13.Describes the specified Elastic IP addresses14.List of VPCs15.List of EBS volumes16.List of flow logs17.List of Network ACLs18.List of Route tables19.List of Security Groups20.List of Security Group Rules21.List of all the snapshots (self taken)22.List of Subnets23.List of Transit Gateways (TGW)24.List of VPC endpoints25.List of all the VPC Peering connections26.List of VPN connectionsecs27.List of ECS clusters28.List of  ECS Services in specified ECS Cluster29.List ECS Tasks in specified ECS Clusterefs30.List of EFSeks31.Describe details of specified EKS Cluster32.List of EKS Clusters33.List EKS Fargate profiles in specified EKS Clusterelbv234.List of load balancers (Application, Network)emr35.List of Provisioned EMR Clusters36.List of notebook executions.37.List of all the EMR Studios38.List of Instance fleets for specific EMR clusteremr-serverless39.List of EMR Serverless applications40.List of EMR Serverless Job runs for specified EMR serverless applicationiam41.List of IAM Roles42. List of Managed policies (AWS and Your owned)43. List of IAM userskms44.List of KMS keyslambda45.List of Lambda functions46.List of  Lambda layersorganizations47. List of accounts in the organization48. List of Service Control Policies (SCP) in an organizationrds49.List of Aurora DB clusters50.List of provisioned RDS instances51.List  of DB Security Groups52.List of Database Sanpshots53.List of Global aurora clustersredshift54.List of Redshift clustersredshift-serverless55.List of Redshift serverless namespaces56.List of Redshift serverless workgroupsroute5357.List of all the Route53 CIDRs58.List of hosted zones(public and private)59.List of  private hosted zones associated with specified VPCroute53domains60.List of Route53 Domains61.Info of Route53 Domain pricings362.List of S3 buckets63.List of the objects in a S3 Bucketsagemaker64.List of SageMaker Domains65.List of SageMaker Images66.List of SageMaker Models67.List of SageMaker Projects68.List of SageMaker User Profilessns69.List of SNS subscriptions70.List of SNS topicssqs71.List of SQS queuesssm72.Describe Instance Information (OS version)LicenseThis library is licensed under the Apache-2.0. See the LICENSE file.ConsiderationsResource-Lister makes list API calls using AWS SDK for Python(Boto3).These   list API calls will be applied to yourAWS Account List API Quotas.Utiliy provide options to use existing IAM roles or to create new roles using utility provided cloudformation templates. If you decided to use utility provided cloudformation templates.  Master account cloudformation template will createReadonlyAccessIAM role in master account .Child account cloudformation template will createReadOnlyAccessIAM role in child account.Most of the cases list generated by utility will have 99% of the attributes send back by Boto3 .Utility doesn't assure 100% attributes are covered.When running utility more than 5 accounts,to avoidmemory issues,It's recommended to generate Account wise file. Account wise file can be generated by changing configuration settting in help section .
Help --> 6. [Manage Configurations (example : format_type, output_type)]-->5.[Modify  Seperate file for each AWS Account]-->change toyesUtility currently supports only 27 services and 70 functions. Utility is configuration driven so adding new function is easy. If you are interested in additional functions /features, please raise issue.Know issues/Pending itemsImprovements in error handling messagesHelp section is work in progress