I don’t think I fully understand when I’m supposed to use types.List vs a slice and when I should be using ListAttribute{ElementType:} vs ListNestedAttribute{NestedObject: … }
Take for example:
type Child struct {
Name types.String `tfsdk:"name"`
// assume other fields
}
type Parent struct {
Children types.List `tfsdk:"children"`
}
It looked like the most-correct way was ListNestedAttribute, but then it looks like I need to define the object three times?
- as a struct with
tfsdk:"...
tags, - as a schema.NestedAttributeObject
- as a map with attr.Type to call ObjectValueFrom
Did I miss something somewhere? When do I use which things, and how do I convert into/out of my API structs to/from these Terraform model structs?
JAmes