Open utterances-bot opened 1 year ago
Nice post!
I'm not able to find the "timeout" parameter though. Which terraform module version are you using?
Ok, this is weird.... You are right, there is no support currently for the timeout in the official http provider (from Hashicorp), however it's available from another one.
terraform {
required_version = ">= 0.13.1"
required_providers {
http = {
source = "terraform-aws-modules/http"
version = ">= 2.4.1"
}
}
}
data "http" "example" {
url = "https://checkpoint-api.hashicorp.com/v1/check/terraform"
timeout = 3000
# Optional request headers
request_headers = {
Accept = "application/json"
}
}
Also as a good news, the https://github.com/hashicorp/terraform-provider-http/issues/149 has been merged, so you should expect native support for request timeout and retry in hashicorp http starting with version 3.3.0
Thanks a lot! You can close this one :D
Use terraform http data source to wait for cluster coming up - Alekc's Blog
Neat example of how we can use terraform http data source to wait for our kubernetes cluster to come up with a healthy state (shamelessly taken from some github repo)
https://blog.alekc.org/posts/use-terraform-http-data-source-for-cluster-health-check/