digitalocean / terraform-provider-digitalocean

Terraform DigitalOcean provider
https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs
Mozilla Public License 2.0
509 stars 278 forks source link

opensearch_config: follow PATCH semantics #1273

Closed andrewsomething closed 1 hour ago

andrewsomething commented 17 hours ago

This change makes it so that we only send attributes that have changes for Opensearch configurations. The one exception is for the ISM-related settings. The API seems to require that they are sent together, e.g.:

 Error: Error updating Opensearch configuration: PATCH https://api.digitalocean.com/v2/databases/f3587545-9002-415b-9593-8473bc770a98/config: 422 (request "41520d54-cf5e-408d-ae19-e4fd45c310fa") invalid 'user_config': invalid input for opensearch: 'ism_history_enabled' is a required property

We may want to consider making similar changes for the other database engines. Though that is less pressing. The main motivator here is working around the bug triggered by sending override_main_response_version.

Fixes: https://github.com/digitalocean/terraform-provider-digitalocean/issues/1272