Creating a Custom Machine Type with Terraform

Open Google Console

Caution: When you are in the console, do not deviate from the lab instructions. Doing so may cause your account to be blocked. Learn more.

Creating a Custom Machine Type with Terraform

1 hour 12 Credits


Google Cloud Self-Paced Labs


A machine type specifies a particular collection of virtualized hardware resources available to a virtual machine (VM) instance, including the memory size, virtual CPU count, and maximum persistent disk capability.

Machine types are classified into two categories:

  • Predefined machine types: Machines that are managed by Google Compute Engine and have a fixed collection of resources.

You can get a list of those by entering in Cloud Shell:

gcloud compute machine-types list
  • Custom machine types: Machines with custom virtualized hardware settings. You can create an instance with a custom number of vCPUs and amount of memory.

In this lab you'll create an instance with a custom machine type (6 vCPU i.e. 6 cores and 64 GB memory with attached GPU), a bastion host, and a NAT gateway using Terraform.

Google Compute Engine provides graphics processing units (GPUs) that you can add to your virtual machine instances. You can use these GPUs to accelerate specific workloads on your instances such as machine learning and data processing. In this lab you are going to attach a GPU to the instance with a custom machine type.



  • Familiarity with Terraform

Join Qwiklabs to read the rest of this lab...and more!

  • Get temporary access to the Google Cloud Console.
  • Over 200 labs from beginner to advanced levels.
  • Bite-sized so you can learn at your own pace.
Join to Start This Lab


Create an instance with custom machine type using terraform.

Run Step

/ 5