I need to run a specific gcloud
SDK command. And I need to do it remotely on my express
server. Is this possible?
The command is related to the Cloud CDN service, which doesn't seem to have an npm package
to access its API in an easy way. I've noticed on a cloudbuild.yaml
that you can actually run a gcloud
command on a build process, like:
cloudbuild.yaml
- name: "gcr.io/google.com/cloudsdktool/cloud-sdk"
entrypoint: gcloud
args:
- "run"
- "deploy"
- "server"
And then I thought, if it's possible to run a gcloud
command through Cloud Build
, isn't there some way to create basically a "Cloud Script" where I could access and trigger a gcloud
command, like that?
This is my environment and what I'd like to run:
- Express server hosted on Cloud Run
I would like to run a command to clear the Cloud CDN cache, like this:
gcloud compute url-maps invalidate-cdn-cache URL_MAP_NAME \
--path "/images/*"
There doesn't seem to be a Node.js client API to access the Cloud CDN service.