hashicorp / terraform-provider-http

Utility provider for interacting with generic HTTP servers as part of a Terraform configuration.
https://registry.terraform.io/providers/hashicorp/http/latest
Mozilla Public License 2.0
206 stars 116 forks source link

Add support for rate limiting #334

Closed tobiasbp closed 12 months ago

tobiasbp commented 1 year ago

Terraform CLI and Provider Versions

Terraform: 1.6.1 Provider: 3.4.0

Use Cases or Problem Statement

To many requests to an API within a window of time, results in new requests being rejected.

Proposal

Add a _'ratelimit' setting which holds a number representing the number of requests per second the provider is allowed to perform.

How much impact is this issue causing?

High

Additional Information

The use case here is to get lots of organizations and users from an API and deploying those users and groups on another system using a dedicated Terraform provider for that platform. This is currently not possible because requests to the API holding the orgs and users are rejected after a certain number of requests have been made. If the rate of the requests could be controlled, it should be possible to find a rate at which the rejection issue would not occur.

Code of Conduct

tobiasbp commented 1 year ago

Would a PR for this be welcomed?

bendbennett commented 1 year ago

Hi @tobiasbp 👋

Thank you for opening this issue. Prior to opening a PR, it might be worth seeing how many up-votes that this issue receives so that we have an indication of the level of community interest.

bflad commented 1 year ago

One thing to potentially consider when evaluating this feature request is whether this form of complexity is warranted in this generic HTTP request provider. Rate limiting tends to have varied solutions across APIs, whether it be header-based or undetectable. APIs with rate limiting requirements should likely have those sorts of behaviors encoded in their own provider, so practitioners needing to interface with the API do not need to implement specific configuration.

tobiasbp commented 12 months ago

I think the problem I am trying to solve by adding rate limiting, will be solved if the connection making the HTTP requests could be reused. There is an issue for that here. I'll close this feature request.

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.