opensearch-project / terraform-provider-opensearch

https://registry.terraform.io/providers/opensearch-project/opensearch
Apache License 2.0
74 stars 58 forks source link

[FEATURE] retries implemented, or max_retries configable if retry already implemented #199

Open FireballDWF opened 3 months ago

FireballDWF commented 3 months ago

Is your feature request related to a problem?

"elastic: Error 503 (Service Unavailable)" is sometimes returned when the access policy creation which allows usage has not achieved eventually consistency before invocation of resource creation like opensearch_index which actually depends on the policy.

What solution would you like?

retries on 503 errors, and other transient failures.

What alternatives have you considered?

could add sleep between the two calls

Do you have any additional context?

Implement retries similar to the AWS provider behavior - https://registry.terraform.io/providers/hashicorp/aws/latest/docs#max_retries

rblcoder commented 3 months ago

In aws.Config, MaxRetries is currently set to 1 https://github.com/opensearch-project/terraform-provider-opensearch/blob/3e845644d46f3c6f290b2a571635f7cfa195f355/provider/provider.go#L458