terraform-provider-http
terraform-provider-http copied to clipboard
Provide retry option on http datasource
Following this issue https://github.com/hashicorp/terraform-provider-http/issues/49, I wanted to implement the retry by leveraging hashicorp's go-retryablehttp library (as proposed in the issue comments).
Usage:
data "http" "example" {
url = "https://localhost:9090"
retry {
attempts = 3
delay = 10
}
}
I added a basic test as minimum coverage but I did not achieve to test a more complex scenario (tried to postpone mock server start, tried to create a route that would alternate between returning a 5XX or a 200). How would you write such a test ?
Waiting for feedback :slightly_smiling_face:
@jackofallops please expedite the PR and merge , the feature is much needed..
The retry option is interesting to use http provider as a waiter. When this will be merge? Who should review and merge?
The retry option for the http data source is good to have, when will it be merged. can anyone please review and approve the feature.
@detro apologies for atting you... I see you've contributed to this repo in the past and wondered whether you know if this PR can be progresses? I'm currently working on something that requires local exec to perform basic http health check before continuing and think that having retries in the official module would also help a lot of folks.
Will this be merged any time soon? It's a pretty important feature
Hello here, I updated my PR to match the updates done in the repo. I've been strugling with tfsdk and I had to convert the retry block to classic attributes. I'm still not sure about the test part if you have better ideas don't hesitate to propose them.
Hi @Vince-Chenal 👋 Thank you for this submission. This appears to have been covered by https://github.com/hashicorp/terraform-provider-http/pull/151 which has recently been merged and will release with version 3.3.0 in the near future. I'm going to close this out as there does not appear to be anything actionable left to do with this pull request.
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.