ddelnano / terraform-provider-mikrotik

MIT License
130 stars 28 forks source link

Extra client api call is necessary when updating a resource whose tf state id is not Mikrotik `.id` #37

Open jdelnano opened 3 years ago

jdelnano commented 3 years ago

Many, but not all, resources for this provider are configured in such a way that their .id field is used as the terraform Id field in state. However, others use a different, unique field (e.g. name), but this causes a situation when updating a resource: The .id field will be needed by the client code, but since it isn't embedded in terraform state, an additional Find client call is needed to fetch the .id before updating. An example of each is shown below:

Resource using .id as tf Id Resource using name as tf Id

Solution: to promote uniformity + reduce additional client API calls, adjust resources to use their .id field in terraform state.

maksym-nazarenko commented 1 year ago

this one might be closed after migrating all resources to new terraform-plugin-framework (see #134)