Support of managing multiple similar resources dynamically - depending on the specs of the primary resource.
To be able to discriminate which dependent resource we are managing the desired should receive the index of the resource:
protected R desired(P primary, Context<P> context, int index) or inside the Context object. (This would require an extended Context for the dependent resources.
Questions to clarify/discuss
Should be this on top level. Thus directly the DependentResource interface should support this?. And have a wrapper dependent resource over that, that supports count? (basically agree on class level design)
Notes
Support of managing multiple similar resources dynamically - depending on the specs of the primary resource.
To be able to discriminate which dependent resource we are managing the desired should receive the index of the resource:
protected R desired(P primary, Context<P> context, int index)or inside theContextobject. (This would require an extendedContextfor the dependent resources.Questions to clarify/discuss
Should be this on top level. Thus directly the
DependentResourceinterface should support this?. And have a wrapper dependent resource over that, that supports count? (basically agree on class level design)Notes
countin terraform, see: https://www.terraform.io/language/meta-arguments/countDependentResourcesupport for event sources where multiple resources of same type are handled for single primary #1175