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

Add statuscake heartbeat check #115

Merged
merged 1 commit into from
Aug 27, 2024
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
12 changes: 12 additions & 0 deletions monitoring/statuscake/resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ resource "statuscake_uptime_check" "main" {
}
}

resource "statuscake_heartbeat_check" "main" {
for_each = toset(var.heartbeat_names)

name = each.value
period = var.heartbeat_period
contact_groups = var.contact_groups
}

output "heartbeat_check_urls" {
value = { for name in var.heartbeat_names : name => statuscake_heartbeat_check.main[name].check_url }
}

resource "statuscake_ssl_check" "main" {
for_each = toset(var.ssl_urls)

Expand Down
7 changes: 6 additions & 1 deletion monitoring/statuscake/tfdocs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ No modules.

| Name | Type |
|------|------|
| [statuscake_heartbeat_check.main](https://registry.terraform.io/providers/StatusCakeDev/statuscake/latest/docs/resources/heartbeat_check) | resource |
| [statuscake_ssl_check.main](https://registry.terraform.io/providers/StatusCakeDev/statuscake/latest/docs/resources/ssl_check) | resource |
| [statuscake_uptime_check.main](https://registry.terraform.io/providers/StatusCakeDev/statuscake/latest/docs/resources/uptime_check) | resource |

Expand All @@ -25,9 +26,13 @@ No modules.
|------|-------------|------|---------|:--------:|
| <a name="input_confirmation"></a> [confirmation](#input\_confirmation) | Retry the check when an error is detected to avoid false positives and micro downtimes | `number` | `2` | no |
| <a name="input_contact_groups"></a> [contact\_groups](#input\_contact\_groups) | Contact groups for the alerts | `list(string)` | `[]` | no |
| <a name="input_heartbeat_names"></a> [heartbeat\_names](#input\_heartbeat\_names) | List of names for the heartbeat checks | `list(string)` | `[]` | no |
| <a name="input_heartbeat_period"></a> [heartbeat\_period](#input\_heartbeat\_period) | The period in seconds within which a heartbeat must be received | `number` | `600` | no |
| <a name="input_ssl_urls"></a> [ssl\_urls](#input\_ssl\_urls) | Set of URLs to perform SSL checks on | `list(string)` | `[]` | no |
| <a name="input_uptime_urls"></a> [uptime\_urls](#input\_uptime\_urls) | Set of URLs to perform uptime checks on | `list(string)` | `[]` | no |

## Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_heartbeat_check_urls"></a> [heartbeat\_check\_urls](#output\_heartbeat\_check\_urls) | n/a |
14 changes: 14 additions & 0 deletions monitoring/statuscake/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,17 @@ variable "confirmation" {
description = "Retry the check when an error is detected to avoid false positives and micro downtimes"
default = 2
}

# Heartbeat check variables
variable "heartbeat_names" {
type = list(string)
nullable = false
description = "List of names for the heartbeat checks"
default = []
}

variable "heartbeat_period" {
description = "The period in seconds within which a heartbeat must be received"
type = number
default = 600
}
Loading