gcloud projects list
gcloud config set compute/zone europe-west4-b
gcloud compute images list
gcloud compute zones list
gcloud machine-types list
latest_image () {
gcloud compute images list --sort-by ~NAME --format json --filter "$1" \
| jq -r '.[0].name'
}
gcloud compute instances create $INSTANCE_NAME \
--image "$(latest_image cos-stable)" \
--image-project cos-cloud \
--zone europe-west4-b \
--machine-type f1-micro \
--tags http-server,https-server \
--metadata-from-file user-data=cloud-config.yaml
gcloud compute ssh $INSTANCE_NAME \
--project $PROJECT_ID \
--zone $ZONE