-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Initial Pagerduty set up (#13)
- Loading branch information
Showing
13 changed files
with
109 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ jobs: | |
aad_credentials: ${{ secrets.AZUREAD_CREDENTIALS_LAB }} | ||
terraform_token: ${{ secrets.TERRAFORM_CLOUD_TOKEN }} | ||
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
pagerduty_api_token: ${{ secrets.PAGERDUTY_API_TOKEN_LAB }} | ||
sops_age_key: ${{ secrets.SOPS_AGE_PRIVATE_KEY }} | ||
|
||
plan_prod: | ||
|
@@ -51,6 +52,7 @@ jobs: | |
env: | ||
SOPS_AGE_KEY: ${{ secrets.SOPS_AGE_PRIVATE_KEY }} | ||
TF_VAR_cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
TF_VAR_pagerduty_api_token: ${{ secrets.PAGERDUTY_API_TOKEN_PROD }} | ||
|
||
- name: Update Pull Request | ||
uses: actions/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
resource "pagerduty_service" "idrac" { | ||
name = "Dell iDRAC${var.display_name_environment_suffix}" | ||
auto_resolve_timeout = 14400 | ||
acknowledgement_timeout = 600 | ||
escalation_policy = pagerduty_escalation_policy.default.id | ||
alert_creation = "create_alerts_and_incidents" | ||
|
||
alert_grouping_parameters { | ||
type = "intelligent" | ||
} | ||
} | ||
|
||
resource "pagerduty_service_integration" "idrac_pve1" { | ||
name = "iDRAC PVE1 E-mail Alerts" | ||
type = "generic_email_inbound_integration" | ||
integration_email = "idrac-pve1@${sensitive(data.sops_file.secrets.data["pagerduty_email_domain"])}" | ||
|
||
service = pagerduty_service.idrac.id | ||
} | ||
|
||
resource "pagerduty_service_integration" "idrac_pve2" { | ||
name = "iDRAC PVE2 E-mail Alerts" | ||
type = "generic_email_inbound_integration" | ||
integration_email = "idrac-pve2@${sensitive(data.sops_file.secrets.data["pagerduty_email_domain"])}" | ||
|
||
service = pagerduty_service.idrac.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
resource "pagerduty_service" "proxmox" { | ||
name = "Proxmox VE${var.display_name_environment_suffix}" | ||
auto_resolve_timeout = 14400 | ||
acknowledgement_timeout = 600 | ||
escalation_policy = pagerduty_escalation_policy.default.id | ||
alert_creation = "create_alerts_and_incidents" | ||
|
||
alert_grouping_parameters { | ||
type = "intelligent" | ||
} | ||
} | ||
|
||
resource "pagerduty_service_integration" "proxmox" { | ||
name = "Proxmox E-mail Alerts" | ||
type = "generic_email_inbound_integration" | ||
integration_email = "proxmox@${sensitive(data.sops_file.secrets.data["pagerduty_email_domain"])}" | ||
|
||
service = pagerduty_service.proxmox.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
resource "pagerduty_escalation_policy" "default" { | ||
name = "Default" | ||
description = "Default escalation policy for all services" | ||
|
||
teams = [ | ||
pagerduty_team.default.id | ||
] | ||
|
||
rule { | ||
escalation_delay_in_minutes = 3 | ||
|
||
target { | ||
type = "user_reference" | ||
id = data.pagerduty_user.me.id | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource "pagerduty_team" "default" { | ||
name = "Homecentr Support" | ||
description = "Homecentr Support" | ||
} | ||
|
||
resource "pagerduty_team_membership" "me" { | ||
user_id = data.pagerduty_user.me.id | ||
team_id = pagerduty_team.default.id | ||
|
||
role = "manager" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data "pagerduty_user" "me" { | ||
email = sensitive(data.sops_file.secrets.data["pagerduty_user_email"]) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters