terraform-provider-vyos icon indicating copy to clipboard operation
terraform-provider-vyos copied to clipboard

Batching API requests

Open foltik opened this issue 2 years ago • 0 comments

Since the VyOS API is quite slow, we should try to batch together changes as much as possible.

As https://github.com/hashicorp/terraform-plugin-sdk/issues/66 and https://github.com/hashicorp/terraform-plugin-sdk/issues/7 are still unimplemented in the Terraform plugin SDK, there's no clean way (at the provider level) to batch together and create/modify separate resources in a single API call.

One user mentioned in one of the above threads that they settled on having separate *_batch variants for each of their resource types. Building off of this, for our use case I think it would be more ergonomic to decide on a per-resource basis whether we want to accept a single value or a list of values to batch. For example, the vyos_static_host_mapping resource will most often be used several times, so it might make more sense to have a single vyos_static_host_mappings resource instead.

foltik avatar Jun 08 '22 13:06 foltik