List instances with external IP

Custom table of running VMs and public IPs via --format/--filter projections

gcloud compute instances list --format="table(name,status,EXTERNAL_IP)" --filter="status=RUNNING"

tool
gcloud8 commands
tags
gcloudnetworkcloud

More gcloud commands

  • gcloud projects get-iam-policy <id> --flatten="bindings[].members" --format="table(bindings.role,bindings.members)"

    Audit who has which role; --flatten explodes nested bindings into rows

  • gcloud logging read 'severity>=ERROR' --limit 20 --freshness=1h --format='value(timestamp,resource.type,textPayload)'

    Pull last hour of errors across project; --freshness avoids full scan

  • gcloud compute ssh <name> --zone <id> --tunnel-through-iap

    Reach a VM with no public IP through Identity-Aware Proxy; no bastion needed

  • gcloud secrets versions access latest --secret=<name> --project <id>

    Print latest Secret Manager version to stdout; pin a version in CI for repeatability

  • gcloud storage rsync -r -d ./build gs://<name>/site

    Mirror dir to GCS; -d deletes extras, modern replacement for gsutil rsync

all 8 gcloud commands