philips-software / terraform-provider-hsdp

Terraform provider to orchestrate various HSDP resources like IAM, CDL, CDR, MDM, Container Host, Edge, etc
https://registry.terraform.io/providers/philips-software/hsdp/latest
MIT License
33 stars 13 forks source link

Support backoff retry for 429 rate limit errors #369

Open akodhawan opened 11 months ago

akodhawan commented 11 months ago

Provider should be extended to do backoff retry for rate limited resources.

Example: │ Error: DELETE /authorize/scim/v2/Applications/fc527f11-900f-48f9-a81b-038e8cb96cae: StatusCode 429, Body: {"issue":[{"details":{"coding":{"userSelected":false},"text":"Rate limit exceeded"},"diagnostics":"Rate limit exceeded"}]}

Also in few cases see inconsistency where IAM throws 429 but still processes the request thus creating a state drift. A way to handle this might be to do a GET check on resource in case of error before retrying request.

akodhawan commented 11 months ago

Need to validate further, but i guess inconsistency was caused by multiple retries. If after rate limit error leave the system for cool-off seems eventual consistency plays & resources are deleted.