Created
February 6, 2024 14:57
-
-
Save dzogrim/743ec28deb597886700f0d4ee9e8cb94 to your computer and use it in GitHub Desktop.
Basic GCP Resource listing on project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Set your GCP project ID | |
PROJECT_ID="graphite-victor-413210" | |
gcloud config set project $PROJECT_ID | |
# Compute Engine: List VM instances | |
echo "Listing Compute Engine VM instances..." | |
gcloud compute instances list --format="table(name,zone,status)" | |
# Compute Engine: List Disks | |
echo "Listing Compute Engine Disks..." | |
gcloud compute disks list --format="table(name,zone,sizeGb)" | |
# Kubernetes Engine: List Clusters | |
echo "Listing Kubernetes Engine Clusters (GKE clusters)..." | |
gcloud container clusters list --format="table(name,location,status)" | |
# Cloud Storage: List Buckets | |
echo "Listing Cloud Storage Buckets (GCS buckets)..." | |
gsutil ls | |
# Cloud SQL: List instances | |
echo "Listing Cloud SQL instances..." | |
gcloud sql instances list --format="table(name,region,settings.tier)" | |
# BigQuery: List datasets (Note: This lists datasets, not tables) | |
echo "Listing BigQuery datasets..." | |
bq ls --format=pretty | |
# VPC Networks: List Networks | |
echo "Listing VPC Networks..." | |
gcloud compute networks list --format="table(name,autoCreateSubnetworks)" | |
# Cloud Functions: List functions | |
echo "Listing Cloud Functions..." | |
gcloud functions list --format="table(name,region,status)" | |
# Pub/Sub: List Topics | |
echo "Listing Pub/Sub topics..." | |
gcloud pubsub topics list --format="table(name)" | |
echo "Resource listing completed." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment