terraform-provider-opsgenie icon indicating copy to clipboard operation
terraform-provider-opsgenie copied to clipboard

Maintain Slack Integrations in Terraform

Open Homulvas opened this issue 1 year ago • 0 comments

Affected Resource(s)

  • opsgenie_api_integration
  • opsgenie_integration_action

Terraform Configuration Files

import {
  to = opsgenie_api_integration.monitoring_dev_integration
  id = "<someGuid>"
}

resource "opsgenie_api_integration" "monitoring_dev_integration" {
  name    = "Slack (#monitoring-dev)"
  type    = "SlackApp"
  enabled = true
}

According to https://github.com/opsgenie/terraform-provider-opsgenie/issues/102 Slack Integrations cannot be managed with Terraform as creation requires user input. However, you can import existing SlackApp integration as a opsgenie_api_integration . The question is if it's possible to do anything useful with that. opsgenie_api_integration itself doesn't allow specifying a filter block which appears to be a property of a Slack Integration in the UI. It is possible to add opsgenie_integration_action to the imported Slack integration.

resource "opsgenie_integration_action" "monitoring_dev_action" {
  integration_id = opsgenie_api_integration.monitoring_dev_integration.id
...

But it appears that it just breaks the UI and does nothing useful. Screenshot 2023-12-12 at 12 29 30

Of course none of this is documented nor officially supported but my question is can we get at least some support for Slack Integration definitions in Terraform? Even if Integrations themselves are created via UI and have to be imported can they be made configurable and removable in Terraform?

Homulvas avatar Dec 12 '23 10:12 Homulvas