Skip to main content

Is it possible to set the the Communication Channel for a Service via Terraform? I’ve already got the pagerduty_service and pagerduty_slack_connection working together, but a new service will have the Communication Channel blank in the UI, and I don’t see any listed options in the TF resource.

Hi @chris elion to configure an specific Slack channel to receive updates regarding a service using you can use a Terraform configuration similar to the following…


resource "pagerduty_team" "foo" {
name = "Team Foo"
}

data "pagerduty_priority" "p1" {
name = "P1"
}

data "pagerduty_service" "app_service" {
name = "App Service"
}

resource "pagerduty_slack_connection" "app_service_slack_integration" {
source_id = pagerduty_service.app_service.id
source_type = "service_reference"
workspace_id = "T02A123LV1A"
channel_id = "C02CABCDAC9"
notification_type = "responder"
config {
events = =
"incident.triggered",
"incident.acknowledged",
"incident.escalated",
"incident.resolved",
"incident.reassigned",
"incident.annotated",
"incident.unacknowledged",
"incident.delegated",
"incident.priority_updated",
"incident.responder.added",
"incident.responder.replied",
"incident.status_update_published",
"incident.reopened"
]
priorities = =data.pagerduty_priority.p1.id]

}
}

However, despite being correctly configured, unfortunately this is not the same PagerDuty object configuration used to track a Service’s Communication Channel, that’s why You are not able to see this setup reflected on the UI.


Up to this point, I’m sorry to say that PagerDuty’s Terraform Provider doesn’t support managing a Service’s Communication Channel.


Hi @jose antonio rey! 🙂


Is there any open FR for the communication channel to start being managed by the PagerDuty provider? It would be great to start seeing Slack channels in the UI as it would enhance clarity to everyone.


Also, functionality wise, I don’t see any problem: I’m using pagerduty_slack_connection for all of my services and I can confirm that even for those where the communication channel does not show up in the UI, I do get the alert messages forwarded to Slack as intended. Is this expected?


Thank you.


Reply