I too ran into this problem:
$ gcloud compute addresses list
NAME ADDRESS/RANGE TYPE PURPOSE NETWORK REGION SUBNET STATUS
google-managed-services-test 10.21.96.0/20 INTERNAL VPC_PEERING test RESERVED
But the CLI would select the wrong region when deleting:
$ gcloud compute addresses delete google-managed-services-test
The following addresses will be deleted:
- [google-managed-services-test] in [us-central1]
Do you want to continue (Y/n)? Y
ERROR: (gcloud.compute.addresses.delete) Could not fetch resource:
- The resource 'projects/magic-test/regions/us-central1/addresses/google-managed-services-test' was not found
The solution was to add the --global
flag to the delete
command:
$ gcloud compute addresses delete --global google-managed-services-test
The following global addresses will be deleted:
- [google-managed-services-test]
Do you want to continue (Y/n)? Y
Deleted [https://www.googleapis.com/compute/v1/projects/magic-test/global/addresses/google-managed-services-test].