The goal of this project is to count assets in various cloud environments, handling rate limits and permissions effectively. This project includes scripts for both Azure and Google Cloud Platform (GCP).
This script counts assets across all subscriptions and resource groups in Azure, leveraging Azure CLI commands and Python's concurrency features.
-
Create a file containing the asset types to be checked. Each line in the file should represent a different asset type.
Example
assets.txt
:Microsoft.Compute/virtualMachines Microsoft.Storage/storageAccounts
-
Run the script with the following command:
python azure_asset_counter.py assets.txt
-
To enable debug output for more verbose information, use the
--debug
flag:python azure_asset_counter.py assets.txt --debug
For more information, refer to the Azure Asset Counter README.
This script counts assets across all projects within a specified Google Cloud Platform (GCP) organization, handling API limits and permissions.
-
Create a file containing the asset types to be checked. Each line in the file should represent a different asset type.
Example
assets.txt
:compute.googleapis.com/Instance storage.googleapis.com/Bucket
-
Run the script with the following command:
python gcp_asset_counter.py <org_id> assets.txt
-
To enable debug output for more verbose information, use the
--debug
flag:python gcp_asset_counter.py <org_id> assets.txt --debug
For more information, refer to the GCP Asset Counter README.