21 lines
420 B
HCL
21 lines
420 B
HCL
terraform {
|
|
required_providers {
|
|
http = { }
|
|
}
|
|
}
|
|
|
|
data "http" "echoip" {
|
|
url = var.http_url
|
|
request_headers = var.http_request_headers
|
|
method = var.http_method
|
|
|
|
insecure = core::startswith(var.http_url, "http://")
|
|
|
|
lifecycle {
|
|
postcondition {
|
|
condition = contains([200,201,204], self.status_code)
|
|
error_message = "Status code ${self.status_code} indicates request failure."
|
|
}
|
|
}
|
|
}
|