opsgenie / terraform-provider-opsgenie

Terraform OpsGenie provider
https://registry.terraform.io/providers/opsgenie/opsgenie/latest/docs
Mozilla Public License 2.0
106 stars 137 forks source link

Maintain Slack Integrations in Terraform #417

Open Homulvas opened 11 months ago

Homulvas commented 11 months ago

Affected Resource(s)

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?

cecalero commented 1 week ago

Hi @Homulvas , Did you find a way to fix it? I have the same issue to Teams V2 integration. Thanks in advanced