mirror of
https://github.com/letic/terraform-provider-google.git
synced 2024-10-01 16:21:06 +00:00
Add support for content-based load balancing to google_compute_health_check (#2550)
<!-- This change is generated by MagicModules. --> /cc @rileykarson
This commit is contained in:
parent
717300e974
commit
e73a45ffbb
@ -89,6 +89,10 @@ func resourceComputeHealthCheck() *schema.Resource {
|
||||
Optional: true,
|
||||
Default: "/",
|
||||
},
|
||||
"response": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
ConflictsWith: []string{"https_health_check", "tcp_health_check", "ssl_health_check"},
|
||||
@ -119,6 +123,10 @@ func resourceComputeHealthCheck() *schema.Resource {
|
||||
Optional: true,
|
||||
Default: "/",
|
||||
},
|
||||
"response": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
ConflictsWith: []string{"http_health_check", "tcp_health_check", "ssl_health_check"},
|
||||
@ -610,6 +618,8 @@ func flattenComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceD
|
||||
flattenComputeHealthCheckHttpHealthCheckHost(original["host"], d)
|
||||
transformed["request_path"] =
|
||||
flattenComputeHealthCheckHttpHealthCheckRequestPath(original["requestPath"], d)
|
||||
transformed["response"] =
|
||||
flattenComputeHealthCheckHttpHealthCheckResponse(original["response"], d)
|
||||
transformed["port"] =
|
||||
flattenComputeHealthCheckHttpHealthCheckPort(original["port"], d)
|
||||
transformed["proxy_header"] =
|
||||
@ -624,6 +634,10 @@ func flattenComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schem
|
||||
return v
|
||||
}
|
||||
|
||||
func flattenComputeHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} {
|
||||
return v
|
||||
}
|
||||
|
||||
func flattenComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} {
|
||||
// Handles the string fixed64 format
|
||||
if strVal, ok := v.(string); ok {
|
||||
@ -651,6 +665,8 @@ func flattenComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.Resource
|
||||
flattenComputeHealthCheckHttpsHealthCheckHost(original["host"], d)
|
||||
transformed["request_path"] =
|
||||
flattenComputeHealthCheckHttpsHealthCheckRequestPath(original["requestPath"], d)
|
||||
transformed["response"] =
|
||||
flattenComputeHealthCheckHttpsHealthCheckResponse(original["response"], d)
|
||||
transformed["port"] =
|
||||
flattenComputeHealthCheckHttpsHealthCheckPort(original["port"], d)
|
||||
transformed["proxy_header"] =
|
||||
@ -665,6 +681,10 @@ func flattenComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *sche
|
||||
return v
|
||||
}
|
||||
|
||||
func flattenComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData) interface{} {
|
||||
return v
|
||||
}
|
||||
|
||||
func flattenComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData) interface{} {
|
||||
// Handles the string fixed64 format
|
||||
if strVal, ok := v.(string); ok {
|
||||
@ -808,6 +828,13 @@ func expandComputeHealthCheckHttpHealthCheck(v interface{}, d *schema.ResourceDa
|
||||
transformed["requestPath"] = transformedRequestPath
|
||||
}
|
||||
|
||||
transformedResponse, err := expandComputeHealthCheckHttpHealthCheckResponse(original["response"], d, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if val := reflect.ValueOf(transformedResponse); val.IsValid() && !isEmptyValue(val) {
|
||||
transformed["response"] = transformedResponse
|
||||
}
|
||||
|
||||
transformedPort, err := expandComputeHealthCheckHttpHealthCheckPort(original["port"], d, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -833,6 +860,10 @@ func expandComputeHealthCheckHttpHealthCheckRequestPath(v interface{}, d *schema
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func expandComputeHealthCheckHttpHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func expandComputeHealthCheckHttpHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
return v, nil
|
||||
}
|
||||
@ -864,6 +895,13 @@ func expandComputeHealthCheckHttpsHealthCheck(v interface{}, d *schema.ResourceD
|
||||
transformed["requestPath"] = transformedRequestPath
|
||||
}
|
||||
|
||||
transformedResponse, err := expandComputeHealthCheckHttpsHealthCheckResponse(original["response"], d, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else if val := reflect.ValueOf(transformedResponse); val.IsValid() && !isEmptyValue(val) {
|
||||
transformed["response"] = transformedResponse
|
||||
}
|
||||
|
||||
transformedPort, err := expandComputeHealthCheckHttpsHealthCheckPort(original["port"], d, config)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -889,6 +927,10 @@ func expandComputeHealthCheckHttpsHealthCheckRequestPath(v interface{}, d *schem
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func expandComputeHealthCheckHttpsHealthCheckResponse(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
||||
func expandComputeHealthCheckHttpsHealthCheckPort(v interface{}, d *schema.ResourceData, config *Config) (interface{}, error) {
|
||||
return v, nil
|
||||
}
|
||||
|
@ -138,6 +138,12 @@ The `http_health_check` block supports:
|
||||
The request path of the HTTP health check request.
|
||||
The default value is /.
|
||||
|
||||
* `response` -
|
||||
(Optional)
|
||||
The bytes to match against the beginning of the response data. If left empty
|
||||
(the default value), any response will indicate health. The response data
|
||||
can only be ASCII.
|
||||
|
||||
* `port` -
|
||||
(Optional)
|
||||
The TCP port number for the HTTP health check request.
|
||||
@ -161,6 +167,12 @@ The `https_health_check` block supports:
|
||||
The request path of the HTTPS health check request.
|
||||
The default value is /.
|
||||
|
||||
* `response` -
|
||||
(Optional)
|
||||
The bytes to match against the beginning of the response data. If left empty
|
||||
(the default value), any response will indicate health. The response data
|
||||
can only be ASCII.
|
||||
|
||||
* `port` -
|
||||
(Optional)
|
||||
The TCP port number for the HTTPS health check request.
|
||||
|
Loading…
Reference in New Issue
Block a user