Skip to main content

Resource Lister

Project description

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::<Your 12 Digit Account>: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.

Help

General help

Supported Services and Functionality

Supported Services and Functionality
Service Functions
accessanalyzer
  • 1.list_analyzers
  • 2.list_findings
  • 3.list_findings_v2
account
  • 4.list_regions
acm
  • 5.list_certificates
amp
  • 6.list_scrapers
  • 7.list_workspaces
apigateway
  • 8.get_rest_apis
appflow
  • 9.list_connectors
budgets
  • 10.describe_budgets
cleanrooms
  • 11.list_collaborations
cloudformation
  • 12.list_stacks
  • 13.list_stack_sets
cloudfront
  • 14.list_distributions
  • 15.list_functions
cloudtrail
  • 16.list_trails
cloudwatch
  • 17.list_dashboards
  • 18.list_metrics
codecommit
  • 19.list_repositories
dynamodb
  • 20.list_tables
ec2
  • 21.describe_addresses
  • 22.describe_flow_logs
  • 23.describe_instances
  • 24.describe_network_acls
  • 25.describe_route_tables
  • 26.describe_security_groups
  • 27.describe_security_group_rules
  • 28.describe_snapshots
  • 29.describe_subnets
  • 30.describe_transit_gateways
  • 31.describe_volumes
  • 32.describe_vpcs
  • 33.describe_vpc_endpoints
  • 34.describe_vpc_peering_connections
  • 35.describe_vpn_connections
ecs
  • 36.list_clusters
  • 37.list_services
  • 38.list_tasks
efs
  • 39.describe_file_systems
eks
  • 40.describe_cluster
  • 41.list_clusters
  • 42.list_fargate_profiles
elasticache
  • 43.describe_cache_clusters
elbv2
  • 44.describe_load_balancers
emr
  • 45.list_clusters
  • 46.list_instance_fleets
  • 47.list_notebook_executions
  • 48.list_studios
emr-serverless
  • 49.list_applications
  • 50.list_job_runs
iam
  • 51.list_users
  • 52.list_access_keys
  • 53.list_account_aliases
  • 54.list_attached_group_policies
  • 55.list_attached_role_policies
  • 56.list_attached_user_policies
  • 57.list_group_policies
  • 58.list_groups
  • 59.list_policies
  • 60.list_roles
kms
  • 61.list_keys
lambda
  • 62.list_functions
  • 63.list_layers
organizations
  • 64.list_accounts
  • 65.list_policies
rds
  • 66.describe_db_clusters
  • 67.describe_db_instances
  • 68.describe_db_security_groups
  • 69.describe_db_snapshots
  • 70.describe_global_clusters
redshift
  • 71.describe_clusters
redshift-serverless
  • 72.list_namespaces
  • 73.list_workgroups
resourcegroupstaggingapi
  • 74.get_resources
route53
  • 75.list_cidr_blocks
  • 76.list_hosted_zones
  • 77.list_hosted_zones_by_vpc
  • 78.list_vpc_association_authorizations
route53domains
  • 79.list_domains
  • 80.list_prices
s3
  • 81.list_buckets
  • 82.list_bucket_analytics_configurations
  • 83.list_bucket_intelligent_tiering_configurations
  • 84.list_bucket_inventory_configurations
  • 85.list_bucket_metrics_configurations
  • 86.list_directory_buckets
  • 87.list_multipart_uploads
  • 88.list_objects_v2
sagemaker
  • 89.list_domains
  • 90.list_images
  • 91.list_models
  • 92.list_projects
  • 93.list_user_profiles
sns
  • 94.list_subscriptions
  • 95.list_topics
sqs
  • 96.list_queues
ssm
  • 97.describe_instance_information

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 : format_type, output_type)]-->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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

resource_lister-2.2.0.tar.gz (86.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

resource_lister-2.2.0-py3-none-any.whl (90.1 kB view details)

Uploaded Python 3

File details

Details for the file resource_lister-2.2.0.tar.gz.

File metadata

  • Download URL: resource_lister-2.2.0.tar.gz
  • Upload date:
  • Size: 86.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.3

File hashes

Hashes for resource_lister-2.2.0.tar.gz
Algorithm Hash digest
SHA256 e06d59b4a745543ac85e8fa10ccec007b4f09a845c8db5cbb1770fe7b820789d
MD5 d33993cde7c1ca8818564e22d6492463
BLAKE2b-256 78886c78b78bfa7fbc3c6fba7aec87f68f555bf497204591cf350646d3583b41

See more details on using hashes here.

File details

Details for the file resource_lister-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for resource_lister-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bda6793f1c5a90cade003bf0c02768030bfff1c47f34155f447c53ee6f4f6890
MD5 e6057c769943264762fd095ad932d18f
BLAKE2b-256 96375e8c709474e6c4931114879fafb38bfc2721b38945e0db1fa01bb0dde039

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page