https://github.com/awslabs/resource-lister

https://github.com/awslabs/resource-lister

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.3%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Basic Info
  • Host: GitHub
  • Owner: awslabs
  • License: apache-2.0
  • Language: Python
  • Default Branch: main
  • Size: 9.71 MB
Statistics
  • Stars: 18
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 0
Created about 3 years ago · Last pushed over 1 year ago
Metadata Files
Readme Contributing License Code of conduct

README.md

Resource Lister (Multi Accounts)

Resource Lister is an open source, NO CODE, interactive, python-based command line utility. Resource Lister can generate centralizedlist of AWS resources (for supported 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 essentially simplifies accessing 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 usecase

  • Resource Lister is handy utility for Developers, Solution Architect, Account Owners, Cloud Ops team or anyone who simply wants to generate list of AWS Resources (for supported 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_lister

1 . 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 ec2

2 . 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 regions

5 . 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.

Output

Note : You can also run the utility in batch mode across all the services in selected AWS Account by going to help --> option # 6

Prerequisite

  1. Python
  2. AWS CLI

Installation

You can install and run Resource lister using pipx

On 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-lister On Windows, install via pip (requires pip 19.0 or later)

If you installed python using the app-store, replace python with python3 in the next line. python -m pip install pipx python -m pip install boto3 python -m pipx install resource-lister

Run the Resource Lister Utility using pipx

On macOS, Linux, install via pip (requires pip 19.0 or later) python3 -m pipx run resource_lister On Windows, install via pip (requires pip 19.0 or later)

python -m pipx run resource_lister

Resource lister utility will open in command prompt

Setup

Express setup for single account using default credentials. You will use default IAM credentials for this setup. Ensure your current default credentials should have read only permissions Step1 : Navigate to "Add Master Account" Type help-->1 [Manage AWS Account]-->1 [Add Master Account.]

Step2 : Configure Master account with dummy values Since express setup we are using default credentials. Use dummy values for Master Account ARN like **arn:aws:iam:::role/dummy_role** and for child account role name enter **dummy_role**

Congratulations! AWS Account is successfully configured. Step3: Navigate back to main search Type 0 to exit 0-->0

Step4 : Test Utility by generating list of s3 buckets .csv file Enter AWS service for help (help) for Exit (0) :-->s3 Please select any of following options: 1. [List of S3 buckets] 2. [List of the objects in a S3 Bucket] Please enter option HERE-->1 Please enter comma separated account id(s) or ALL HERE-->ALL

Utility will create output folder and generate the .csv file with list of s3 buckets in your account.

Multi Account configurations. - [Cloud9 setup](https://github.com/awslabs/resource-lister/blob/main/docs/cloud_9_setup.md) - [Cloudshell setup](https://github.com/awslabs/resource-lister/blob/main/docs/cloudshell_setup.md)

Help

General help

Supported Services and Functionality

Supported Services and Functionality

Service Functions
accessanalyzer
  • 1.listanalyzers
  • 2.listfindings
  • 3.listfindingsv2
account
  • 4.listregions
acm
  • 5.listcertificates
amp
  • 6.listscrapers
  • 7.listworkspaces
apigateway
  • 8.getrestapis
appflow
  • 9.listconnectors
budgets
  • 10.describebudgets
cleanrooms
  • 11.listcollaborations
cloudformation
  • 12.liststacks
  • 13.liststacksets
cloudfront
  • 14.listdistributions
  • 15.listfunctions
cloudtrail
  • 16.listtrails
cloudwatch
  • 17.listdashboards
  • 18.listmetrics
codecommit
  • 19.listrepositories
dynamodb
  • 20.listtables
ec2
  • 21.describeaddresses
  • 22.describeflowlogs
  • 23.describeinstances
  • 24.describenetworkacls
  • 25.describeroutetables
  • 26.describesecuritygroups
  • 27.describesecuritygrouprules
  • 28.describesnapshots
  • 29.describesubnets
  • 30.describetransitgateways
  • 31.describevolumes
  • 32.describevpcs
  • 33.describevpcendpoints
  • 34.describevpcpeeringconnections
  • 35.describevpnconnections
ecs
  • 36.listclusters
  • 37.listservices
  • 38.listtasks
efs
  • 39.describefilesystems
eks
  • 40.describecluster
  • 41.listclusters
  • 42.listfargateprofiles
elasticache
  • 43.describecacheclusters
elbv2
  • 44.describeloadbalancers
emr
  • 45.listclusters
  • 46.listinstancefleets
  • 47.listnotebookexecutions
  • 48.liststudios
emr-serverless
  • 49.listapplications
  • 50.listjobruns
iam
  • 51.listusers
  • 52.listaccesskeys
  • 53.listaccountaliases
  • 54.listattachedgrouppolicies
  • 55.listattachedrolepolicies
  • 56.listattacheduserpolicies
  • 57.listgrouppolicies
  • 58.listgroups
  • 59.listpolicies
  • 60.listroles
kms
  • 61.listkeys
lambda
  • 62.listfunctions
  • 63.listlayers
organizations
  • 64.listaccounts
  • 65.listpolicies
rds
  • 66.describedbclusters
  • 67.describedbinstances
  • 68.describedbsecuritygroups
  • 69.describedbsnapshots
  • 70.describeglobalclusters
redshift
  • 71.describeclusters
redshift-serverless
  • 72.listnamespaces
  • 73.listworkgroups
resourcegroupstaggingapi
  • 74.getresources
route53
  • 75.listcidrblocks
  • 76.listhostedzones
  • 77.listhostedzonesbyvpc
  • 78.listvpcassociationauthorizations
route53domains
  • 79.listdomains
  • 80.listprices
s3
  • 81.listbuckets
  • 82.listbucketanalyticsconfigurations
  • 83.listbucketintelligenttieringconfigurations
  • 84.listbucketinventoryconfigurations
  • 85.listbucketmetricsconfigurations
  • 86.listdirectorybuckets
  • 87.listmultipartuploads
  • 88.listobjectsv2
sagemaker
  • 89.listdomains
  • 90.listimages
  • 91.listmodels
  • 92.listprojects
  • 93.listuserprofiles
sns
  • 94.listsubscriptions
  • 95.listtopics
sqs
  • 96.listqueues
ssm
  • 97.describeinstanceinformation

Expanding Resource Lister Capabilities: Adding Support for Additional AWS Services and Functions

Resource Lister currently supports listing and describing resources for 38 common AWS services, with approximately 100 related functions. However, Boto3 provides access to over 350 AWS services with more than 3,500 functions just for listing and describing resources. This article demonstrates how Resource Lister can be easily extended to support additional AWS services beyond the 38 currently enabled. By creating a one-time configuration file per service Resource Lister will automatically detect, any of the 350+ services and 3,500+ describe/list functions in Boto3 can be added with minimal effort. This configuration file approach allows Resource Lister's capabilities to be expanded as needed to leverage all AWS services Boto3 supports.

How to Expand the Capabilities of the Resource Lister

License

This library is licensed under the Apache-2.0. See the LICENSE file.

Considerations

  • Resource-Lister makes list API calls using AWS SDK for Python(Boto3).These list API calls will be applied to your AWS 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 create ReadonlyAccess IAM role in master account .Child account cloudformation template will create ReadOnlyAccess IAM 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 avoid memory 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 : formattype, outputtype)]-->5.[Modify Seperate file for each AWS Account]-->change to yes

  • Utility 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 items

  • Improvements in error handling messages
  • Help section is work in progress

Owner

  • Name: Amazon Web Services - Labs
  • Login: awslabs
  • Kind: organization
  • Location: Seattle, WA

AWS Labs

GitHub Events

Total
  • Watch event: 2
  • Push event: 14
  • Pull request event: 2
  • Create event: 1
Last Year
  • Watch event: 2
  • Push event: 14
  • Pull request event: 2
  • Create event: 1

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 0
  • Total pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: less than a minute
  • Total issue authors: 0
  • Total pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
  • rajeabh (2)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 24 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 5
  • Total maintainers: 1
pypi.org: resource-lister

Resource Lister

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 24 Last month
Rankings
Dependent packages count: 7.1%
Average: 18.7%
Dependent repos count: 30.3%
Maintainers (1)
Last synced: 10 months ago