-
Create an instance named
instance-1in theus-central1-azonegcloud compute instances create instance-1 --zone us-central1-a -
Create an
f1-microinstance namedinstance-1in theus-central1-azonegcloud compute instances create instance-1 --zone us-central1-a --machine-type f1-micro -
Create an instance named
instance-1in theus-central1-azone running Ubuntu 14.04gcloud compute instances create instance-1 --zone us-central1-a --image ubuntu-14-04 -
Create an instance named
instance-1in theus-central1-azone in the networkdefaultgcloud compute instances create instance-1 --zone us-central1-a --network default -
Create an instance named
instance-1in theus-central1-azone in the projectprojectgcloud compute instances create instance-1 --zone us-central1-a --project project -
Create an instance named
instance-1with all the fix-ins.gcloud compute instances create instance-1 --zone us-central1-a --machine-type f1-micro --image ubuntu-14-04 --network default --project project -
Create an instance with startup script
startup.sh.gcloud compute instances create instance-1 --zone us-central-1a --metadata-from-file startup-script=startup.sh -
Create a new firewall rule allowing inbound tcp traffic on all ports in the
defaultnetwork for machines tagged with tag ``alibaba`gcloud compute firewall-rules create default-allow-all --allow tcp:1-65535 --network default --target-tags alibaba -
Tag
instance-1with tagalibabagcloud compute instances add-tags instance-1 --zone us-central1-a --tags alibaba -
Untag 'instance-1' with tag 'alibaba'
gcloud compute instances remove-tags instance-1 --zone us-central1-a --tags alibaba -
List instances
gcloud compute instances list -
List external ip address of
instance-1gcloud compute instances list instance-1 --format yaml | grep natIP | awk '{print $2}' -
List current project
gcloud config list -
Set current project to example
gcloud config set project example -
Make
gs://dir/filepublicly readable.gsutil acl set public-read gs://dir/file
Last active
March 14, 2020 18:12
-
-
Save mwhittaker/8a0d2481cabc7f59dbf9 to your computer and use it in GitHub Desktop.
Google Cloud Platform
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment