This module is used to create a single uptime check along with an alert policy and new and/or existing notification channel(s) to notify if the uptime check fails.
This module does not support multiple alert policies or multiple conditions for a single alert policy. For alert policies, conditions does not support condition_absent
, condition_monitoring_query_language
or condition_matched_log
blocks.
Name | Description | Type | Default | Required |
---|---|---|---|---|
accepted_response_status_classes | Check will only pass if the HTTP response status code is in this set of status classes (combined with the set of status values). Possible values: STATUS_CLASS_1XX, STATUS_CLASS_2XX, STATUS_CLASS_3XX, STATUS_CLASS_4XX, STATUS_CLASS_5XX, STATUS_CLASS_ANY | set(string) |
[] |
no |
accepted_response_status_values | Check will only pass if the HTTP response status code is in this set of status values (combined with the set of status classes). | set(number) |
[] |
no |
aggregations | Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together. | object({ |
{ |
no |
alert_policy_combiner | Determines how to combine multiple conditions. One of: AND, OR, or AND_WITH_MATCHING_RESOURCE. | string |
"OR" |
no |
alert_policy_display_name | Display name for the alert policy. Defaults to "var.uptime_check_display_name Uptime Failure Alert Policy" if left empty. | string |
"" |
no |
alert_policy_user_labels | This field is intended to be used for organizing and identifying the AlertPolicy objects. | map(string) |
{} |
no |
auth_info | Optional username and password to authenticate. | object({ |
null |
no |
auto_close | Open incidents will close if an alert policy that was active has no data for this long (in seconds, must be at least 30 minutes). For example "18000s". | string |
null |
no |
body | The request body associated with the HTTP POST request. | string |
null |
no |
checker_type | One of: STATIC_IP_CHECKERS, VPC_CHECKERS | string |
"STATIC_IP_CHECKERS" |
no |
condition_display_name | A unique name to identify condition in dashboards, notifications, and incidents. If left empty, defaults to Failure of uptime check_id | string |
"" |
no |
condition_threshold_comparison | The comparison to apply between the time series (indicated by filter and aggregation) and the threshold (indicated by threshold_value). | string |
"COMPARISON_GT" |
no |
condition_threshold_duration | The amount of time that a time series must violate the threshold to be considered failing, in seconds. Must be a multiple of 60 seconds. | string |
"60s" |
no |
condition_threshold_filter | A filter that identifies which time series should be compared with the threshold. Defaults to uptime check failure filter if left as empty string. | string |
"" |
no |
condition_threshold_trigger | Defines the percent and number of time series that must fail the predicate for the condition to be triggered | object({ |
{ |
no |
condition_threshold_value | A value against which to compare the time series. | number |
1 |
no |
content | String or regex content to match. | string |
null |
no |
content_type | Content type to use for the http(s) check. Can be one of: TYPE_UNSPECIFIED, URL_ENCODED | string |
null |
no |
enabled | Whether or not the policy is enabled (defaults to true) | bool |
true |
no |
existing_notification_channels | List of existing notification channel IDs to use for alerting if the uptime check fails. | list(string) |
[] |
no |
headers | The list of headers to send as part of the uptime check request. | map(string) |
{} |
no |
json_path_matcher | If matcher is MATCHES_JSON_PATH or NOT_MATCHES_JSON_PATH, the json matcher and path to use. The json matcher must be either EXACT_MATCH or REGEX_MATCH. | object({ |
null |
no |
mask_headers | Whether to encrypt the header information. | bool |
false |
no |
matcher | Type of content matcher. One of: CONTAINS_STRING, NOT_CONTAINS_STRING, MATCHES_REGEX, NOT_MATCHES_REGEX, MATCHES_JSON_PATH, NOT_MATCHES_JSON_PATH | string |
"CONTAINS_STRING" |
no |
monitored_resource | Monitored resource type and labels. One of: uptime_url, gce_instance, gae_app, aws_ec2_instance, aws_elb_load_balancer, k8s_service, servicedirectory_service. See https://cloud.google.com/monitoring/api/resources for a list of labels. | object({ |
null |
no |
notification_channel_strategy | Control over how the notification channels in notification_channels are notified when this alert fires, on a per-channel basis. | object({ |
null |
no |
notification_channels | List of all the notification channels to create for alerting if the uptime check fails. See https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.notificationChannelDescriptors/list for a list of types and labels. | list(object({ |
[] |
no |
notification_rate_limit_period | Not more than one notification per specified period (in seconds), for example "30s". | string |
null |
no |
path | Path to the page to run the check against. The path to the page to run the check against. Will be combined with the host in monitored_resource block to construct the entire URL. | string |
"/" |
no |
period | How frequently uptime check is run. Must be one of the following: 60s, 300s, 600s, 900s | string |
"60s" |
no |
port | The port to the page to run the check against. If left null, defaults to 443 for HTTPS and 80 for HTTP. | number |
null |
no |
project_id | The project ID to host the uptime check in (required). | string |
n/a | yes |
protocol | Protocol for uptime check. One of: HTTPS, HTTP, or TCP (required). | string |
n/a | yes |
request_method | HTTP request method to use for the check. One of: METHOD_UNSPECIFIED, GET, POST | string |
"GET" |
no |
resource_group | Group resource associated with configuration. Resource types must be one of: RESOURCE_TYPE_UNSPECIFIED, INSTANCE, AWS_ELB_LOAD_BALANCER | object({ |
null |
no |
selected_regions | Regions from which to run the uptime check from. Defaults to all regions. | list(string) |
[] |
no |
timeout | The maximum amount of time to wait for the request to complete. | string |
"10s" |
no |
uptime_check_display_name | The display name for the uptime check (required). | string |
n/a | yes |
validate_ssl | If https, whether to validate SSL certificates. | string |
true |
no |
Name | Description |
---|---|
alert_policy_id | The id of the alert policy. |
notification_channel_ids | The ids of the notification channels |
uptime_check_id | The id of the uptime check. |