Skip to content

Scripts to simplify interacting with Google's GCP in a prescribed manner.

License

Notifications You must be signed in to change notification settings

canonical-labs/gcp-tools

Repository files navigation

Introduction

The following sections assume you have signed up for google cloud. If you haven't done this step, please visit the gcp signup page. You can start for free.

GCP Setup Instructions

You can run these instructions from your own terminal, or using the GCP shell. The GCP shell is accessed through your browser, from the GCP dashboard, as described below.

  1. Please create a project
  2. You'll use this project id for the commands in this directory
  3. If using a local terminal / shell:
  4. Please install gcloud: 1. Visit the interactive install page 2. Ensure you run gcloud init
  5. Otherwise, you can use the gcp shell in your browser.
  6. Navigate to the gcp dashboard
  7. Select the >_ image in the upper right part of the top level tool bar
  8. NB: you get do a git clone of this project inside the cloud shell

Creating a VM

From this directory, you should run the following commands to create the initial VM and ssh in. It is important that you set the project id first, there are sensible defaults for everything else:

export GCP_PROJECT=<the Project Id of the project you created>

# This creates a firewall rule that allows any IP address to access certain ports
./network_create.sh

# This will create a VM instance, with the firewall rule applied
./compute_create.sh

# This will log you into the VM, once it is up and running.
./compute_ssh.sh

Stop / Delete / Start

For ongoing use, you can stop and start anytime. When you are completely done, please delete the VM.

You don't pay money for the VM when it is stopped, but you do pay for the attached disk (for what has been used).

# If you haven't already, create GCP_PROJECT ..
export GCP_PROJECT=<the Project Id of the project you created>

# To stop a running VM
./compute_stop.sh

# To start a stopped VM
./compute_start.sh

# To delete a VM (in any state)
./compute_delete.sh

About

Scripts to simplify interacting with Google's GCP in a prescribed manner.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages