Terraform module to manage PagerDuty service resource (batteries included).
Warning
Technical PagerDuty service can't be created without a reference to an escalation policy. Make sure to create an escalation policy before creating a service.
module "example" {
source = "Tensho/service/pagerduty"
version = "1.3.0"
name = "Example"
description = "Example service managed by Terraform"
escalation_policy_id = pagerduty_escalation_policy.example.id
auto_resolve_timeout = 3600
acknowledgement_timeout = 600
auto_pause_notifications_parameters = {
enabled = true
timeout = 120
}
alert_grouping_setting = {
type = "content_based"
config = {
time_window = 300
aggregate = "all"
fields = ["summary"]
}
}
support_hours = {
type = "fixed_time_per_day"
time_zone = "Europe/London"
start_time = "09:00:00"
end_time = "17:00:00"
days_of_week = [1, 2, 3, 4, 5]
}
incident_urgency_rule = {
type = "use_support_hours"
during_support_hours = {
type = "constant"
urgency = "high"
}
outside_support_hours = {
type = "constant"
urgency = "low"
}
}
scheduled_actions = {
type = "urgency_change"
to_urgency = "high"
at = {
type = "named_time"
name = "support_hours_start"
}
}
}
Check out comprehensive examples in examples
folder.
- PagerDuty business service
- PagerDuty service alert grouping (AIOps add-on)
- PagerDuty service graph
- PagerDuty service Slack integration
Name | Version |
---|---|
terraform | >= 1.7.0 |
pagerduty | >= 3.18 |
Name | Version |
---|---|
pagerduty | 3.18.1 |
No modules.
Name | Type |
---|---|
pagerduty_alert_grouping_setting.default | resource |
pagerduty_business_service.default | resource |
pagerduty_service.default | resource |
pagerduty_service_dependency.dependent | resource |
pagerduty_service_dependency.supporting | resource |
pagerduty_service_integration.cloudwatch | resource |
pagerduty_service_integration.datadog | resource |
pagerduty_service_integration.newrelic | resource |
pagerduty_slack_connection.default | resource |
pagerduty_vendor.cloudwatch | data source |
pagerduty_vendor.datadog | data source |
pagerduty_vendor.newrelic | data source |
Name | Description | Type | Default | Required |
---|---|---|---|---|
acknowledgement_timeout | PagerDuty service incident acknowledged-to-triggered state change time in seconds. | string |
"null" |
no |
alert_grouping_setting | PagerDuty service alert grouping configuration. | object({ |
null |
no |
auto_pause_notifications_parameters | PagerDuty service transient incident auto pause before triggering (AIOps add-on). | object({ |
{ |
no |
auto_resolve_timeout | PagerDuty service incident auto resolution time in seconds. | string |
"null" |
no |
business | PagerDuty business service vs technical service switch. | bool |
false |
no |
cloudwatch_integration_enabled | PagerDuty service AWS CloudWatch integration switch. | bool |
false |
no |
datadog_integration_enabled | PagerDuty service DataDog integration switch. | bool |
false |
no |
description | PagerDuty service description. | string |
"Managed by Terraform" |
no |
escalation_policy_id | PagerDuty service escalation policy ID. | string |
null |
no |
incident_urgency_rule | PagerDuty service incident urgency rule. | object({ |
null |
no |
name | PagerDuty service name | string |
n/a | yes |
newrelic_integration_enabled | PagerDuty service NewRelic integration switch. | bool |
false |
no |
point_of_contact | PagerDuty business service point fo contact. | string |
null |
no |
scheduled_actions | PagerDuty service incident escalation actions related within support hours. | object({ |
null |
no |
service_graph | PagerDuty service graph components. | object({ |
{ |
no |
slack_connection | PagerDuty service Slack connection configuration. | object({ |
null |
no |
support_hours | PagerDuty service support hours. | object({ |
null |
no |
team_id | PagerDuty business service owner team ID (Business/Enterprise plan). | string |
null |
no |
Name | Description |
---|---|
cloudwatch_integration_key | PagerDuty service CloudWatch integration key. |
datadog_integration_key | PagerDuty service DataDog integration key. |
newrelic_integration_key | PagerDuty service NewRelic integration key. |
pagerduty_service | PagerDuty service. |
This project uses conventional commits.
brew install pre-commit tfswitch terraform-docs tflint
pre-commit install --install-hooks
export PAGERDUTY_SERVICE_REGION=eu
export PAGERDUTY_TOKEN=<REDACTED>
export PAGERDUTY_USER_TOKEN=$PAGERDUTY_TOKEN
cd examples/business-service
terraform init
terraform apply
terraform destroy
cd examples/technical-service
terraform init
terraform apply
terraform destroy
terraform test -verbose
- Update "Usage" section in
README.md
- Update examples in
examples
folder