Hello,
Currently I am using the old schema for provider development so I don’t know if this is the good place to ask my question.
I have defined a parameter for my resource:
"templates": {
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Optional: true,
},
Then in my add function I put this:
if hostTemplates, ok := d.GetOk("templates"); ok && len(hostTemplates.([]interface{})) > 0 {
for _, template := range hostTemplates.([]string) {
if err := client.Hosts().AddTemplate(hostName, template); err != nil {
return err
}
}
d.SetPartial("templates")
}
When I execute terraform, it is crashing and I don’t understand why ?
Regards,