Skip to content

Commit

Permalink
Merge pull request #36 from useparagon/fix/PARA-10673/uptime-escalation
Browse files Browse the repository at this point in the history
fix(monitoring): set uptime escalation policy
  • Loading branch information
tedparagon authored Jul 25, 2024
2 parents 1b41a7f + 9c18d99 commit 47caaa7
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 82 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@useparagon/aws-on-prem",
"version": "2.3.0",
"version": "2.4.0",
"description": "Deploy Paragon to your own AWS cloud.",
"repository": "[email protected]:useparagon/aws-on-prem.git",
"author": "Paragon Engineering",
Expand Down
123 changes: 62 additions & 61 deletions terraform/workspaces/paragon/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 0 additions & 10 deletions terraform/workspaces/paragon/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,3 @@ output "uptime_webhook" {
value = module.uptime.webhook
sensitive = true
}

output "uptime_monitors" {
description = "Uptime monitor names"
value = module.uptime.monitors
}

output "uptime_microservices" {
description = "Uptime enabled microservices"
value = module.uptime.microservices
}
16 changes: 15 additions & 1 deletion terraform/workspaces/paragon/uptime/monitors.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ resource "betteruptime_monitor_group" "group" {
count = local.enabled ? 1 : 0

name = var.uptime_company

# start paused to avoid alarms during initial provisioning
paused = true
lifecycle {
ignore_changes = [paused]
}
}

data "betteruptime_policy" "escalation" {
count = local.enabled ? 1 : 0

name = var.uptime_policy
}

resource "betteruptime_monitor" "monitor" {
Expand All @@ -16,7 +28,9 @@ resource "betteruptime_monitor" "monitor" {
maintenance_timezone = "Pacific Time (US & Canada)"
monitor_group_id = betteruptime_monitor_group.group[0].id
monitor_type = "expected_status_code"
recovery_period = 60 # seconds
policy_id = data.betteruptime_policy.escalation[0].id
recovery_period = 60 # seconds
regions = var.uptime_regions
request_timeout = 15 # seconds
ssl_expiration = 14 # days
team_wait = 180 # seconds
Expand Down
8 changes: 0 additions & 8 deletions terraform/workspaces/paragon/uptime/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,3 @@ output "webhook" {
value = local.enabled ? betteruptime_grafana_integration.webhook[0].webhook_url : ""
sensitive = true
}

output "monitors" {
value = keys(betteruptime_monitor.monitor)
}

output "microservices" {
value = keys(var.microservices)
}
3 changes: 2 additions & 1 deletion terraform/workspaces/paragon/uptime/provider.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
terraform {
required_providers {
betteruptime = {
source = "BetterStackHQ/better-uptime"
source = "BetterStackHQ/better-uptime"
version = "~> 0.11.5"
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions terraform/workspaces/paragon/uptime/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ variable "uptime_company" {
type = string
}

variable "uptime_policy" {
description = "The name of the escalation policy to associate with BetterStack Uptime monitors."
type = string
default = "Standard Escalation Policy"
}

variable "uptime_regions" {
description = "The regions to enable on the BetterStack Uptime monitors."
type = list(string)
default = ["as", "au", "eu", "us"]
}

variable "microservices" {
description = "The microservices to create monitors for."
type = map(any)
Expand Down

0 comments on commit 47caaa7

Please sign in to comment.