Last active
May 16, 2022 16:27
-
-
Save JamesAtIntegratnIO/9069b442ac1b20e359f36264fc35f8fa to your computer and use it in GitHub Desktop.
List gcloud subnetworks with their secondary ranges to csv
This file contains hidden or 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
| gcloud compute networks subnets list-usable --flatten="secondaryIpRanges[]" \ | |
| --format="csv( | |
| ipCidrRange:label=RANGE, | |
| subnetwork.segment(-1):label=SUBNET_NAME, | |
| secondaryIpRanges.ipCidrRange:label=SECONDARY_RANGE, | |
| secondaryIpRanges.rangeName:label=Secondary_RANGE_NAME | |
| )" |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This needs improvements. Currently if a subnet does not have a secondary range, you will get a blank line of commas.