Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 905 Bytes

README.md

File metadata and controls

27 lines (18 loc) · 905 Bytes

gcp-ips

Motivation

Currently (November 2018), there is no easy way to list all IPs in-use (or reserved but not in-use) in a particular subnet in a shared VPC. IP addresses are attached to resources (e.g. an instance or a forwarding rule) which are listed in service projects. This means that one has to scan through all service projects exhaustively, collect all IPs in-use or reserved, and then organize them by subnets

Setup

Follow the recommended authentication method described here

Basically:

export GOOGLE_APPLICATION_CREDENTIALS=<path to service account key>

Run

go run main.go <host-project>

Todo

  • command line arguments
    • options for console output and/or markdown files
  • calculate statistics (number of available and used IPs)
  • better feedback for permission issues accessing projects