Search code examples
google-cloud-platformterraformterraform-provider-gcp

Create instance using terrafrom from GCP marketplace


I m trying to create terraform script to launch the fastai instance from the marketplace.

I m adding image name as,

boot_disk {
    initialize_params {
      image = "<image name>"
    }
  }

When I add

click-to-deploy-images/deeplearning

from url

https://console.cloud.google.com/marketplace/details/click-to-deploy-images/deeplearning

is giving error,


Error: Error resolving image name 'click-to-deploy-images/deeplearning': Could not find image or family click-to-deploy-images/deeplearning

  on fastai.tf line 13, in resource "google_compute_instance" "default":
  13: resource "google_compute_instance" "default" {

If I use

debian-cloud/debian-9

from url

https://console.cloud.google.com/marketplace/details/debian-cloud/debian-stretch?project=<>

is working.

Can we deploy fastai image through terraform?


Solution

  • In this particular case, the name was "deeplearning-platform-release/pytorch-latest-gpu",

    boot_disk {
        initialize_params {
          image = "deeplearning-platform-release/pytorch-latest-gpu"
          ...
        }
      }
    

    Now I m able to create the instance.