terraform-provider-google/website/docs/r/monitoring_uptime_check_config.html.markdown
The Magician bc91f6be60 Add a computed field for uptime check id (#3138)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-03-01 09:22:16 -08:00

11 KiB

layout page_title sidebar_current description
google Google: google_monitoring_uptime_check_config docs-google-monitoring-uptime-check-config This message configures which resources and services to monitor for availability.

google_monitoring_uptime_check_config

This message configures which resources and services to monitor for availability.

To get more information about UptimeCheckConfig, see:

## Example Usage - Uptime Check Config Http
resource "google_monitoring_uptime_check_config" "http" {
  display_name = "http-uptime-check"
  timeout = "60s"

  http_check {
    path = "/some-path"
    port = "8010"
  }

  monitored_resource {
    type = "uptime_url"
    labels = {
      project_id = "example"
      host = "192.168.1.1"
    }
  }

  content_matchers {
    content = "example"
  }
}
## Example Usage - Uptime Check Tcp
resource "google_monitoring_uptime_check_config" "tcp_group" {
  display_name = "tcp-uptime-check"
  timeout = "60s"

  tcp_check {
    port = 888
  }

  resource_group {
    resource_type = "INSTANCE"
    group_id = "${google_monitoring_group.check.name}"
  }
}


resource "google_monitoring_group" "check" {
  display_name = "uptime-check-group"
  filter = "resource.metadata.name=has_substring(\"foo\")"
}

Argument Reference

The following arguments are supported:


  • period - (Optional) How often, in seconds, the uptime check is performed. Currently, the only supported values are 60s (1 minute), 300s (5 minutes), 600s (10 minutes), and 900s (15 minutes). Optional, defaults to 300s.

  • content_matchers - (Optional) The expected content on the page the check is run against. Currently, only the first entry in the list is supported, and other entries will be ignored. The server will look for an exact match of the string in the page response's content. This field is optional and should only be specified if a content match is required. Structure is documented below.

  • selected_regions - (Optional) The list of regions from which the check will be run. Some regions contain one location, and others contain more than one. If this field is specified, enough regions to include a minimum of 3 locations must be provided, or an error message is returned. Not specifying this field will result in uptime checks running from all regions.

  • is_internal - (Optional) If this is true, then checks are made only from the 'internal_checkers'. If it is false, then checks are made only from the 'selected_regions'. It is an error to provide 'selected_regions' when is_internal is true, or to provide 'internal_checkers' when is_internal is false.

  • internal_checkers - (Optional) The internal checkers that this check will egress from. If is_internal is true and this list is empty, the check will egress from all the InternalCheckers configured for the project that owns this CheckConfig. Structure is documented below.

  • http_check - (Optional) Contains information needed to make an HTTP or HTTPS check. Structure is documented below.

  • tcp_check - (Optional) Contains information needed to make a TCP check. Structure is documented below.

  • resource_group - (Optional) The group resource associated with the configuration. Structure is documented below.

  • monitored_resource - (Optional) The monitored resource (https://cloud.google.com/monitoring/api/resources) associated with the configuration. The following monitored resource types are supported for uptime checks: uptime_url gce_instance gae_app aws_ec2_instance aws_elb_load_balancer Structure is documented below.

  • project - (Optional) The ID of the project in which the resource belongs. If it is not provided, the provider project is used.

The content_matchers block supports:

  • content - (Optional) String or regex content to match (max 1024 bytes)

The internal_checkers block supports:

  • gcp_zone - (Optional) The GCP zone the uptime check should egress from. Only respected for internal uptime checks, where internal_network is specified.

  • peer_project_id - (Optional) The GCP project_id where the internal checker lives. Not necessary the same as the workspace project.

  • name - (Optional) A unique resource name for this InternalChecker. The format is projects/[PROJECT_ID]/internalCheckers/[INTERNAL_CHECKER_ID]. PROJECT_ID is the stackdriver workspace project for the uptime check config associated with the internal checker.

  • network - (Optional) The GCP VPC network (https://cloud.google.com/vpc/docs/vpc) where the internal resource lives (ex: "default").

  • display_name - (Optional) The checker's human-readable name. The display name should be unique within a Stackdriver Workspace in order to make it easier to identify; however, uniqueness is not enforced.

The http_check block supports:

  • auth_info - (Optional) The authentication information. Optional when creating an HTTP check; defaults to empty. Structure is documented below.

  • port - (Optional) The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) and path to construct the full URL. Optional (defaults to 80 without SSL, or 443 with SSL).

  • headers - (Optional) The list of headers to send as part of the uptime check request. If two headers have the same key and different values, they should be entered as a single header, with the value being a comma-separated list of all the desired values as described at https://www.w3.org/Protocols/rfc2616/rfc2616.txt (page 31). Entering two separate headers with the same key in a Create call will cause the first to be overwritten by the second. The maximum number of headers allowed is 100.

  • path - (Optional) The path to the page to run the check against. Will be combined with the host (specified within the MonitoredResource) and port to construct the full URL. Optional (defaults to "/").

  • use_ssl - (Optional) If true, use HTTPS instead of HTTP to run the check.

  • mask_headers - (Optional) Boolean specifiying whether to encrypt the header information. Encryption should be specified for any headers related to authentication that you do not wish to be seen when retrieving the configuration. The server will be responsible for encrypting the headers. On Get/List calls, if mask_headers is set to True then the headers will be obscured with ******.

The auth_info block supports:

  • password - (Optional) The password to authenticate.

  • username - (Optional) The username to authenticate.

The tcp_check block supports:

  • port - (Required) The port to the page to run the check against. Will be combined with host (specified within the MonitoredResource) to construct the full URL.

The resource_group block supports:

  • resource_type - (Optional) The resource type of the group members.

  • group_id - (Optional) The group of resources being monitored. Should be the name of a group

The monitored_resource block supports:

Attributes Reference

In addition to the arguments listed above, the following computed attributes are exported:

  • name - A unique resource name for this UptimeCheckConfig. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID].

  • uptime_check_id - The id of the uptime check

Timeouts

This resource provides the following Timeouts configuration options:

  • create - Default is 4 minutes.
  • update - Default is 4 minutes.
  • delete - Default is 4 minutes.

Import

UptimeCheckConfig can be imported using any of these accepted formats:

$ terraform import google_monitoring_uptime_check_config.default {{name}}

-> If you're importing a resource with beta features, make sure to include -provider=google-beta as an argument so that Terraform uses the correct provider to import your resource.