-
Create an instance named
instance-1
in theus-central1-a
zonegcloud compute instances create instance-1 --zone us-central1-a
-
Create an
f1-micro
instance namedinstance-1
in theus-central1-a
zonegcloud compute instances create instance-1 --zone us-central1-a --machine-type f1-micro
-
Create an instance named
instance-1
in theus-central1-a
zone running Ubuntu 14.04gcloud compute instances create instance-1 --zone us-central1-a --image ubuntu-14-04
-
Create an instance named
instance-1
in theus-central1-a
zone in the networkdefault
gcloud compute instances create instance-1 --zone us-central1-a --network default
-
Create an instance named
instance-1
in theus-central1-a
zone in the projectproject
gcloud compute instances create instance-1 --zone us-central1-a --project project
-
Create an instance named
instance-1
with 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
default
network 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-1
with tagalibaba
gcloud 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-1
gcloud 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/file
publicly 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