Search code examples
automationgcloud

Auto answer yes for command `gcloud compute instance-templates delete`


To delete a gcloud instance template, we call

gcloud compute instance-templates delete TEMPLATE_NAME

But we have to answer a Y/n question which is not favored for automation bash script. We want auto answer yes, how?

p.s.

My google search for this question results little helpful.

Manual page of the command also has nothing about any other parameter.

gcloud help   compute instance-templates delete

Solution

  • gcloud has a set of global flags including --quiet to disable such prompts:

    https://cloud.google.com/sdk/gcloud/reference/