Skip to content

Commit c827bb4

Browse files
authored
route: add health check support (#49)
Adds support for route health checks. Fix: https://linear.app/pomerium/issue/ENG-1761/routesresource-expose-all-fields
1 parent d5599cc commit c827bb4

File tree

9 files changed

+1229
-0
lines changed

9 files changed

+1229
-0
lines changed

docs/data-sources/route.md

+84
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Route data source
3333
- `description` (String) Description of the route.
3434
- `enable_google_cloud_serverless_authentication` (Boolean) Enable Google Cloud serverless authentication.
3535
- `from` (String) From URL.
36+
- `health_checks` (Attributes Set) Health checks for the route. (see [below for nested schema](#nestedatt--health_checks))
3637
- `host_path_regex_rewrite_pattern` (String) Host path regex rewrite pattern.
3738
- `host_path_regex_rewrite_substitution` (String) Host path regex rewrite substitution.
3839
- `host_rewrite` (String) Host rewrite.
@@ -80,6 +81,89 @@ Optional:
8081
- `infer_from_ppl` (Boolean)
8182

8283

84+
<a id="nestedatt--health_checks"></a>
85+
### Nested Schema for `health_checks`
86+
87+
Read-Only:
88+
89+
- `grpc_health_check` (Attributes) gRPC health check settings. (see [below for nested schema](#nestedatt--health_checks--grpc_health_check))
90+
- `healthy_threshold` (Number) Number of successes before marking healthy.
91+
- `http_health_check` (Attributes) HTTP health check settings. (see [below for nested schema](#nestedatt--health_checks--http_health_check))
92+
- `initial_jitter` (String) An optional jitter amount for the first health check.
93+
- `interval` (String) The interval between health checks.
94+
- `interval_jitter` (String) An optional jitter amount for every interval.
95+
- `interval_jitter_percent` (Number) An optional jitter percentage.
96+
- `tcp_health_check` (Attributes) TCP health check settings. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check))
97+
- `timeout` (String) The time to wait for a health check response.
98+
- `unhealthy_threshold` (Number) Number of failures before marking unhealthy.
99+
100+
<a id="nestedatt--health_checks--grpc_health_check"></a>
101+
### Nested Schema for `health_checks.grpc_health_check`
102+
103+
Read-Only:
104+
105+
- `authority` (String) Authority header value.
106+
- `service_name` (String) Service name to check.
107+
108+
109+
<a id="nestedatt--health_checks--http_health_check"></a>
110+
### Nested Schema for `health_checks.http_health_check`
111+
112+
Read-Only:
113+
114+
- `codec_client_type` (String) Application protocol for health checks.
115+
- `expected_statuses` (Attributes Set) Expected status code ranges. (see [below for nested schema](#nestedatt--health_checks--http_health_check--expected_statuses))
116+
- `host` (String) The host header value.
117+
- `path` (String) The request path.
118+
- `retriable_statuses` (Attributes Set) Retriable status code ranges. (see [below for nested schema](#nestedatt--health_checks--http_health_check--retriable_statuses))
119+
120+
<a id="nestedatt--health_checks--http_health_check--expected_statuses"></a>
121+
### Nested Schema for `health_checks.http_health_check.expected_statuses`
122+
123+
Read-Only:
124+
125+
- `end` (Number) End of status code range.
126+
- `start` (Number) Start of status code range.
127+
128+
129+
<a id="nestedatt--health_checks--http_health_check--retriable_statuses"></a>
130+
### Nested Schema for `health_checks.http_health_check.retriable_statuses`
131+
132+
Read-Only:
133+
134+
- `end` (Number) End of status code range.
135+
- `start` (Number) Start of status code range.
136+
137+
138+
139+
<a id="nestedatt--health_checks--tcp_health_check"></a>
140+
### Nested Schema for `health_checks.tcp_health_check`
141+
142+
Read-Only:
143+
144+
- `receive` (Attributes Set) Expected response payloads. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check--receive))
145+
- `send` (Attributes) Payload to send. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check--send))
146+
147+
<a id="nestedatt--health_checks--tcp_health_check--receive"></a>
148+
### Nested Schema for `health_checks.tcp_health_check.receive`
149+
150+
Read-Only:
151+
152+
- `binary_b64` (String) Base64 encoded binary payload.
153+
- `text` (String) Hex encoded payload.
154+
155+
156+
<a id="nestedatt--health_checks--tcp_health_check--send"></a>
157+
### Nested Schema for `health_checks.tcp_health_check.send`
158+
159+
Read-Only:
160+
161+
- `binary_b64` (String) Base64 encoded binary payload.
162+
- `text` (String) Hex encoded payload.
163+
164+
165+
166+
83167
<a id="nestedatt--rewrite_response_headers"></a>
84168
### Nested Schema for `rewrite_response_headers`
85169

docs/data-sources/routes.md

+84
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Read-Only:
4545
- `description` (String) Description of the route.
4646
- `enable_google_cloud_serverless_authentication` (Boolean) Enable Google Cloud serverless authentication.
4747
- `from` (String) From URL.
48+
- `health_checks` (Attributes Set) Health checks for the route. (see [below for nested schema](#nestedatt--routes--health_checks))
4849
- `host_path_regex_rewrite_pattern` (String) Host path regex rewrite pattern.
4950
- `host_path_regex_rewrite_substitution` (String) Host path regex rewrite substitution.
5051
- `host_rewrite` (String) Host rewrite.
@@ -93,6 +94,89 @@ Optional:
9394
- `infer_from_ppl` (Boolean)
9495

9596

97+
<a id="nestedatt--routes--health_checks"></a>
98+
### Nested Schema for `routes.health_checks`
99+
100+
Read-Only:
101+
102+
- `grpc_health_check` (Attributes) gRPC health check settings. (see [below for nested schema](#nestedatt--routes--health_checks--grpc_health_check))
103+
- `healthy_threshold` (Number) Number of successes before marking healthy.
104+
- `http_health_check` (Attributes) HTTP health check settings. (see [below for nested schema](#nestedatt--routes--health_checks--http_health_check))
105+
- `initial_jitter` (String) An optional jitter amount for the first health check.
106+
- `interval` (String) The interval between health checks.
107+
- `interval_jitter` (String) An optional jitter amount for every interval.
108+
- `interval_jitter_percent` (Number) An optional jitter percentage.
109+
- `tcp_health_check` (Attributes) TCP health check settings. (see [below for nested schema](#nestedatt--routes--health_checks--tcp_health_check))
110+
- `timeout` (String) The time to wait for a health check response.
111+
- `unhealthy_threshold` (Number) Number of failures before marking unhealthy.
112+
113+
<a id="nestedatt--routes--health_checks--grpc_health_check"></a>
114+
### Nested Schema for `routes.health_checks.grpc_health_check`
115+
116+
Read-Only:
117+
118+
- `authority` (String) Authority header value.
119+
- `service_name` (String) Service name to check.
120+
121+
122+
<a id="nestedatt--routes--health_checks--http_health_check"></a>
123+
### Nested Schema for `routes.health_checks.http_health_check`
124+
125+
Read-Only:
126+
127+
- `codec_client_type` (String) Application protocol for health checks.
128+
- `expected_statuses` (Attributes Set) Expected status code ranges. (see [below for nested schema](#nestedatt--routes--health_checks--http_health_check--expected_statuses))
129+
- `host` (String) The host header value.
130+
- `path` (String) The request path.
131+
- `retriable_statuses` (Attributes Set) Retriable status code ranges. (see [below for nested schema](#nestedatt--routes--health_checks--http_health_check--retriable_statuses))
132+
133+
<a id="nestedatt--routes--health_checks--http_health_check--expected_statuses"></a>
134+
### Nested Schema for `routes.health_checks.http_health_check.expected_statuses`
135+
136+
Read-Only:
137+
138+
- `end` (Number) End of status code range.
139+
- `start` (Number) Start of status code range.
140+
141+
142+
<a id="nestedatt--routes--health_checks--http_health_check--retriable_statuses"></a>
143+
### Nested Schema for `routes.health_checks.http_health_check.retriable_statuses`
144+
145+
Read-Only:
146+
147+
- `end` (Number) End of status code range.
148+
- `start` (Number) Start of status code range.
149+
150+
151+
152+
<a id="nestedatt--routes--health_checks--tcp_health_check"></a>
153+
### Nested Schema for `routes.health_checks.tcp_health_check`
154+
155+
Read-Only:
156+
157+
- `receive` (Attributes Set) Expected response payloads. (see [below for nested schema](#nestedatt--routes--health_checks--tcp_health_check--receive))
158+
- `send` (Attributes) Payload to send. (see [below for nested schema](#nestedatt--routes--health_checks--tcp_health_check--send))
159+
160+
<a id="nestedatt--routes--health_checks--tcp_health_check--receive"></a>
161+
### Nested Schema for `routes.health_checks.tcp_health_check.receive`
162+
163+
Read-Only:
164+
165+
- `binary_b64` (String) Base64 encoded binary payload.
166+
- `text` (String) Hex encoded payload.
167+
168+
169+
<a id="nestedatt--routes--health_checks--tcp_health_check--send"></a>
170+
### Nested Schema for `routes.health_checks.tcp_health_check.send`
171+
172+
Read-Only:
173+
174+
- `binary_b64` (String) Base64 encoded binary payload.
175+
- `text` (String) Hex encoded payload.
176+
177+
178+
179+
96180
<a id="nestedatt--routes--rewrite_response_headers"></a>
97181
### Nested Schema for `routes.rewrite_response_headers`
98182

docs/resources/route.md

+84
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Route for Pomerium.
2929
- `bearer_token_format` (String) Bearer token format.
3030
- `description` (String) Description of the route.
3131
- `enable_google_cloud_serverless_authentication` (Boolean) Enable Google Cloud serverless authentication.
32+
- `health_checks` (Attributes Set) Health checks for the route. (see [below for nested schema](#nestedatt--health_checks))
3233
- `host_path_regex_rewrite_pattern` (String) Rewrites the Host header according to a regular expression matching the path.
3334
- `host_path_regex_rewrite_substitution` (String) Rewrites the Host header according to a regular expression matching the substitution.
3435
- `host_rewrite` (String) Rewrites the Host header to a new literal value.
@@ -77,6 +78,89 @@ Route for Pomerium.
7778

7879
- `id` (String) Unique identifier for the route.
7980

81+
<a id="nestedatt--health_checks"></a>
82+
### Nested Schema for `health_checks`
83+
84+
Optional:
85+
86+
- `grpc_health_check` (Attributes) gRPC health check settings. (see [below for nested schema](#nestedatt--health_checks--grpc_health_check))
87+
- `healthy_threshold` (Number) The number of healthy health checks required before a host is marked healthy.
88+
- `http_health_check` (Attributes) HTTP health check settings. (see [below for nested schema](#nestedatt--health_checks--http_health_check))
89+
- `initial_jitter` (String) An optional jitter amount in milliseconds. If specified, Envoy will start health checking after for a random time in ms between 0 and initial_jitter.
90+
- `interval` (String) The interval between health checks.
91+
- `interval_jitter` (String) An optional jitter amount in milliseconds. If specified, during every interval Envoy will add interval_jitter to the wait time.
92+
- `interval_jitter_percent` (Number) An optional jitter amount as a percentage of interval_ms. If specified, during every interval Envoy will add interval_ms * interval_jitter_percent / 100 to the wait time.
93+
- `tcp_health_check` (Attributes) TCP health check settings. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check))
94+
- `timeout` (String) The time to wait for a health check response. If the timeout is reached the health check attempt will be considered a failure.
95+
- `unhealthy_threshold` (Number) The number of unhealthy health checks required before a host is marked unhealthy.
96+
97+
<a id="nestedatt--health_checks--grpc_health_check"></a>
98+
### Nested Schema for `health_checks.grpc_health_check`
99+
100+
Optional:
101+
102+
- `authority` (String) The value of the :authority header in the gRPC health check request.
103+
- `service_name` (String) An optional service name parameter which will be sent to gRPC service.
104+
105+
106+
<a id="nestedatt--health_checks--http_health_check"></a>
107+
### Nested Schema for `health_checks.http_health_check`
108+
109+
Optional:
110+
111+
- `codec_client_type` (String) Use specified application protocol for health checks.
112+
- `expected_statuses` (Attributes Set) Specifies a list of HTTP response statuses considered healthy. (see [below for nested schema](#nestedatt--health_checks--http_health_check--expected_statuses))
113+
- `host` (String) The value of the host header in the HTTP health check request.
114+
- `path` (String) Specifies the HTTP path that will be requested during health checking.
115+
- `retriable_statuses` (Attributes Set) Specifies a list of HTTP response statuses considered retriable. (see [below for nested schema](#nestedatt--health_checks--http_health_check--retriable_statuses))
116+
117+
<a id="nestedatt--health_checks--http_health_check--expected_statuses"></a>
118+
### Nested Schema for `health_checks.http_health_check.expected_statuses`
119+
120+
Required:
121+
122+
- `end` (Number) End of status code range.
123+
- `start` (Number) Start of status code range.
124+
125+
126+
<a id="nestedatt--health_checks--http_health_check--retriable_statuses"></a>
127+
### Nested Schema for `health_checks.http_health_check.retriable_statuses`
128+
129+
Required:
130+
131+
- `end` (Number) End of status code range.
132+
- `start` (Number) Start of status code range.
133+
134+
135+
136+
<a id="nestedatt--health_checks--tcp_health_check"></a>
137+
### Nested Schema for `health_checks.tcp_health_check`
138+
139+
Optional:
140+
141+
- `receive` (Attributes Set) When checking the response, 'fuzzy' matching is performed such that each payload block must be found, and in the order specified, but not necessarily contiguous. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check--receive))
142+
- `send` (Attributes) Empty payloads imply a connect-only health check. (see [below for nested schema](#nestedatt--health_checks--tcp_health_check--send))
143+
144+
<a id="nestedatt--health_checks--tcp_health_check--receive"></a>
145+
### Nested Schema for `health_checks.tcp_health_check.receive`
146+
147+
Optional:
148+
149+
- `binary_b64` (String) Base64 encoded binary payload.
150+
- `text` (String) Hex encoded payload. E.g., '000000FF'.
151+
152+
153+
<a id="nestedatt--health_checks--tcp_health_check--send"></a>
154+
### Nested Schema for `health_checks.tcp_health_check.send`
155+
156+
Optional:
157+
158+
- `binary_b64` (String) Base64 encoded binary payload.
159+
- `text` (String) Hex encoded payload. E.g., '000000FF'.
160+
161+
162+
163+
80164
<a id="nestedatt--jwt_groups_filter"></a>
81165
### Nested Schema for `jwt_groups_filter`
82166

0 commit comments

Comments
 (0)