Skip to content

Commit

Permalink
fix(DMVP-6005): Added basic auth feature to uptime checks
Browse files Browse the repository at this point in the history
  • Loading branch information
viktoryathegreat committed Nov 8, 2024
1 parent 20699f5 commit 8a7ebb7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions modules/uptime-check/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_aggregations"></a> [aggregations](#input\_aggregations) | Specifies the alignment of data points in individual time series as well as how to combine the retrieved time series together. | <pre>object({<br> alignment_period = optional(string, "300s") # The alignment period for per-time series alignment. If present, alignmentPeriod must be at least 60 seconds.<br> group_by_fields = optional(list(string), []) # The set of fields to preserve when crossSeriesReducer is specified.<br> cross_series_reducer = optional(string, "") # The approach to be used to combine time series.<br> per_series_aligner = optional(string, "ALIGN_COUNT_TRUE") # The approach to be used to align individual time series.<br> })</pre> | <pre>{<br> "alignment_period": "60s",<br> "cross_series_reducer": "",<br> "group_by_fields": [],<br> "per_series_aligner": "ALIGN_COUNT"<br>}</pre> | no |
| <a name="input_alert_policy_filter"></a> [alert\_policy\_filter](#input\_alert\_policy\_filter) | A filter that identifies which time series should be compared with the threshold. | `string` | `""` | no |
| <a name="input_auth_info"></a> [auth\_info](#input\_auth\_info) | The authentication information using username and password. | <pre>object({<br> username = string # The username to authenticate.<br> password = string # The password to authenticate.<br> })</pre> | <pre>{<br> "password": "",<br> "username": ""<br>}</pre> | no |
| <a name="input_auth_token"></a> [auth\_token](#input\_auth\_token) | Slack app bot's token used to integrate GCP notifications with slack channel | `string` | `null` | no |
| <a name="input_channel_name"></a> [channel\_name](#input\_channel\_name) | Slack channel name to which notifications will be sent. | `string` | `null` | no |
| <a name="input_checker_location"></a> [checker\_location](#input\_checker\_location) | Checker location filter for uptime check metric. If specified, this filter will be added to the alert policy config. Can be one of: apac-singapore, eur-belgium, sa-brazil-sao\_paulo, usa-iowa, usa-oregon, usa-virginia. | `string` | `""` | no |
Expand Down
5 changes: 4 additions & 1 deletion modules/uptime-check/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ resource "google_monitoring_uptime_check_config" "https" {
port = var.http_check.port
use_ssl = var.http_check.use_ssl
validate_ssl = var.http_check.validate_ssl

auth_info {
username = var.auth_info.username
password = var.auth_info.password
}
accepted_response_status_codes {
status_class = var.http_check.status_class
status_value = var.http_check.status_value
Expand Down
12 changes: 12 additions & 0 deletions modules/uptime-check/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,15 @@ variable "documentation_content" {
description = "The text of the alert documentation."
default = ""
}

variable "auth_info" {
type = object({
username = string # The username to authenticate.
password = string # The password to authenticate.
})
description = "The authentication information using username and password."
default = {
username = ""
password = ""
}
}

0 comments on commit 8a7ebb7

Please sign in to comment.