Closed turkenh closed 2 years ago
We synced on this with @muvaf and agreed on fixing this at provider level for such resources using the existing configuration mechanism.
Example configurator for future reference:
p.AddResourceConfigurator("google_compute_instance_from_template", func(r *config.Resource) {
// Note(turkenh): We have to modify schema of
// "boot_disk.initialize_params.labels", since it is a map where
// elements configured as nil, defaulting to map[string]string:
// https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_instance#nested_initialize_params
r.TerraformResource.
Schema["boot_disk"].Elem.(*schema.Resource).
Schema["initialize_params"].Elem.(*schema.Resource).
Schema["labels"].Elem = schema.TypeString
r.TerraformResource.Schema["metadata"].Elem = schema.TypeString
})
What happened?
I am trying to generate
google_compute_instance
in provider-tf-gcp but Terrajet failed with the following log:Debugger window at that point:
How can we reproduce it?
Try generating google_compute_instance in provider-tf-gcp