Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Terraform on google cloud

I am trying to create resources and services on google cloud using terraform. following up this guide

https://cloud.google.com/docs/terraform/get-started-with-terraform

 

In this guide we create a vpc network and then a subnet and then the vm.

Then we can attach the vm to the subnet we created. But suppose that I don't want to create a new vpc network instead I want to attach the vm with the default network which is already present. I have to change this parameter

network_interface {
  subnetwork = google_compute_subnetwork.default.id
   
  access_config {
  # Include this section to give the VM an external IP address
  }
}  

How would I do it? What should I provide in subnetwork = google_compute_subnetwork.***********

Solved Solved
0 7 3,562
1 ACCEPTED SOLUTION

Hi,

I've checked this code.

DamianS_1-1667228981699.png

DamianS_2-1667228996409.png

DamianS_3-1667229079938.png

 

View solution in original post