I’m migrating to the new terraform framework and I have two resources that are basically the same and so I have two separate structs, and each resource will do something like…
// Resource A
var plan *models.A
req.Plan.Get(ctx, &plan)
// Resource B
var plan *models.B
req.Plan.Get(ctx, &plan)
I’d ideally like to have a wrapper struct that contains the common fields and to embed an A/B struct within it but I don’t know how to make that work when it comes to using methods like Plan.Get
to write data into the structs (as the embedded structs don’t have a tfsdk
struct tag assigned and so the method call fails to say it can’t find one).
Does anyone have any ideas on how I could do this?
Thanks.