3

I'm trying to learn terraform, how do i change image name in the terraform script?

For example, in the below script the default linux image given is debian-cloud/debian-9, how to change the image, say something from marketplace https://console.cloud.google.com/marketplace/details/click-to-deploy-images/deeplearning?q=deep%20learning%20vm&id=8857b4a3-f60f-40b2-9b32-22b4428fd256

gcp terraform link - https://www.terraform.io/docs/providers/google/r/compute_instance_template.html

3 Answers 3

8

if you are looking for standard images available from GCP run following command and grep the type of image.

gcloud compute images list | grep ubuntu

it will list something like following. First column is NAME second is PROJECT and third is FAMILY. In script you can mention the Project/Family (ubuntu-os-cloud/ubuntu-1804-lts)

ubuntu-1604-xenial-v20210329a      ubuntu-os-cloud      ubuntu-1604-lts        
ubuntu-1804-bionic-v20210325       ubuntu-os-cloud      ubuntu-1804-lts      
Sign up to request clarification or add additional context in comments.

Comments

1

Here you are referring to a marketplace image. You can change it in the main.tf

initialize_params {
  image = "debian-cloud/debian-9"

You can list images using #gcloud compute images list redhat It will list all the image references to redhat releases.

1 Comment

Hi Sandeep, I want to deploy the below image from gcp marketplace - how do i get the image name ? console.cloud.google.com/marketplace/details/…
1

As you want to deploy the image, it seems the framework is TensorFlow Enterprise 2.1 (CUDA 10.1).

As the documentation, we have listed the most recent versions of image families, organized by framework type. Creating an instance by referencing an image family with the “latest” in the name ensures that you always get the most recent version of that image. So from the documentation, we could have the image name as required.

I hope documentation and this other one also informative for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.