Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health Check Logging #3346

Merged
merged 3 commits into from
Apr 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions products/compute/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4759,6 +4759,17 @@ objects:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::NestedObject
name: 'logConfig'
description: |
Configure logging on this health check.
min_version: beta
properties:
- !ruby/object:Api::Type::Boolean
name: 'enable'
description: |
Indicates whether or not to export logs. This is false by default,
which means no health check logging will be done.
- !ruby/object:Api::Resource
name: 'InstanceTemplate'
kind: 'compute#instanceTemplate'
Expand Down Expand Up @@ -10507,6 +10518,17 @@ objects:
- :USE_FIXED_PORT
- :USE_NAMED_PORT
- :USE_SERVING_PORT
- !ruby/object:Api::Type::NestedObject
name: 'logConfig'
description: |
Configure logging on this health check.
min_version: beta
properties:
- !ruby/object:Api::Type::Boolean
name: 'enable'
description: |
Indicates whether or not to export logs. This is false by default,
which means no health check logging will be done.
- !ruby/object:Api::Resource
name: 'ResourcePolicy'
kind: 'compute#resourcePolicy'
Expand Down
12 changes: 12 additions & 0 deletions products/compute/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,12 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "http2-health-check"
vars:
health_check_name: "http2-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "health_check_with_logging"
primary_resource_id: "health-check-with-logging"
min_version: beta
vars:
health_check_name: "tcp-health-check"
custom_code: !ruby/object:Provider::Terraform::CustomCode
encoder: templates/terraform/encoders/health_check_type.erb
constants: templates/terraform/constants/health_check.erb
Expand Down Expand Up @@ -1348,6 +1354,12 @@ overrides: !ruby/object:Overrides::ResourceOverrides
primary_resource_id: "http-region-health-check"
vars:
health_check_name: "http-region-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "region_health_check_http_logs"
primary_resource_id: "http-region-health-check"
min_version: beta
vars:
health_check_name: "http-region-health-check"
- !ruby/object:Provider::Terraform::Examples
name: "region_health_check_http_full"
primary_resource_id: "http-region-health-check"
Expand Down
16 changes: 16 additions & 0 deletions templates/terraform/examples/health_check_with_logging.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "google_compute_health_check" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

tcp_health_check {
port = "22"
}

log_config {
enable = true
}
}
16 changes: 16 additions & 0 deletions templates/terraform/examples/region_health_check_http_logs.tf.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource "google_compute_region_health_check" "<%= ctx[:primary_resource_id] %>" {
provider = google-beta

name = "<%= ctx[:vars]['health_check_name'] %>"

timeout_sec = 1
check_interval_sec = 1

http_health_check {
port = "80"
}

log_config {
enable = true
}
}