Closed DrishaS23 closed 1 year ago
I'm not sure I understand what you are pasting above: can you just paste the configuration you used that triggered the error?
This is the config i used:
name = "test-vm" project_id = "cft-prj" zone = "us-central1-a" network_interfaces = [{ network = "vnet-1" subnetwork = "subnet-1" } ]
The code is incomplete. But more importantly, the network and subnetwork fields are supposed to be self links.
We have a few complete examples in the docs and multiple blueprints showing how to deploy a simple vm. Here's one that can help you get started
Working code is
in main.tf:
in variables.tf:
in terraform.tfvars:
Earlier we were getting the error:
google_compute_instance.default[0]: Creating... ╷ │ Error: Error creating network interfaces: cannot determine self_link for subnetwork "subnet-1": network_interface.0.subnetwork_project: required field is not set │ │ with google_compute_instance.default[0], │ on main.tf line 119, in resource "google_compute_instance" "default": │ 119: resource "google_compute_instance" "default" { │