Table of contents generated with markdown-toc
export MY_VARIABLE=<your_VARIABLE>
echo $MY_VARIABLE
gcloud config set compute/zone $ZONE
gcloud config set compute/region $REGION
gcloud compute instances create $INSTANCE_NAME --machine-type $MACHINE_TYPE --image-family $IMAGE
If you would like to run a set of commands to say install something as soon as the instance is running you can add a startup script:
gcloud compute instances create $INSTANCE_NAME --machine-type $MACHINE_TYPE --image-family $IMAGE --metadata-from-file startup-script=startup.sh
A bucket must have a globally unique name. A simple way is to define the bucket name is basing it off your Project ID which must also be globally unqiue:
export BUCKET=<project_id-bucket_name>
gsutil mb -p $PROJECT gs://$BUCKET
From the cloud shell:
gsutil cp $FILENAME gs://$BUCKET
From the cloud shell:
gsutil rm gs://$BUCKET/$FILENAME
From the cloud shell:
gsutil cp gs://$BUCKET/$FILENAME gs://$BUCKET/$FOLDER_NAME/
From the cloud shell:
gsutil ls gs://$BUCKET
From the cloud shell:
gsutil acl ch -u AllUsers:R gs://$BUCKET/$FILENAME
From the cloud shell:
gsutil acl ch -d AllUsers gs://$BUCKET/$FILENAME