I'm using a private VM instance in GCP along with Cloud NAT to allow internet access for this instance. Recently I've been trying to access the Google Places API service via this instance, using an API key. The recommended approach is to restrict the use of this API key by IP address in this scenario. Unfortunately I'm getting a REQUEST_DENIED
error, stating "This IP, site or mobile application is not authorized to use this API key. Request received from IP address {IPv6 address removed}, with empty referer" when I try to do this - despite GCP not supporting IPv6 addresses in VPCs.
My suspicion is that because enabling Cloud NAT automatically activates Private Google Access there's actually some internal GCP private IPv4 to IPv6 NAT happening before the request hits the API - but obviously I'm unable to confirm this.
My question then is, is anyone aware of a way of enabling IP-based restriction on Google Places API keys in this environment (private VM instance + Cloud NAT/Private Google Access)?
Thanks!