Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to enable notification with resource opsgenie_api_integration and type Mattermost #424

Open
dneven opened this issue Feb 2, 2024 · 1 comment

Comments

@dneven
Copy link

dneven commented Feb 2, 2024

Dear opsgenie-team.

I am not able to enable notifications to mattermost via opsgenie_api_integration resource.
Maybe i am holding it wrongly. Then i would love to see a working example in the Docs.

Terraform Version

Terraform v1.5.7
on darwin_arm64
+ provider registry.terraform.io/opsgenie/opsgenie v0.6.35

Affected Resource(s)

  • opsgenie_api_integration

Terraform Configuration Files

resource "opsgenie_api_integration" "mattermost" {
  name = "Mattermost"
  type = "Mattermost"

  webhook_url             = "https://mattermost.myexample.com/hooks/w77C7xOZffiv57b8irBApAxMJCQA6XMb"
  enabled                 = true
  allow_write_access      = false
  suppress_notifications  = false
  owner_team_id           = data.terraform_remote_state.state_200.outputs.team.id
}

On first run the integration in set up, but not fully.

Terraform will perform the following actions:

  # opsgenie_api_integration.mattermost will be created
  + resource "opsgenie_api_integration" "mattermost" {
      + allow_write_access     = false
      + api_key                = (sensitive value)
      + enabled                = true
      + id                     = (known after apply)
      + name                   = "Mattermost"
      + owner_team_id          = "ID-OF-TEAM"
      + suppress_notifications = false
      + type                   = "Mattermost"
      + webhook_url            = "https://mattermost.myexample.com/hooks/w77C7xOZffiv57b8irBApAxMJCQA6XMb"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

...

opsgenie_api_integration.sre_mattermost: Creating...
opsgenie_api_integration.sre_mattermost: Creation complete after 1s [id=541d89c8-e14f-424a-bc3f-bdf9e67951e3]

Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

On second run terraform is updating the webhook_url again.
After this it is show by the opsgenie web ui.
Normally i would expect this to set up on the first run too. (maybe a second bug)

Terraform will perform the following actions:

  # opsgenie_api_integration.sre_mattermost will be updated in-place
  ~ resource "opsgenie_api_integration" "mattermost" {
        id                     = "ID-OF-INTEGRATION"
        name                   = "Mattermost"
      + webhook_url            = "https://mattermost.myexample.com/hooks/w77C7xOZffiv57b8irBApAxMJCQA6XMb"
        # (6 unchanged attributes hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

...

opsgenie_api_integration.sre_mattermost: Modifying... [id=541d89c8-e14f-424a-bc3f-bdf9e67951e3]
opsgenie_api_integration.sre_mattermost: Modifications complete after 1s [id=541d89c8-e14f-424a-bc3f-bdf9e67951e3]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
@dneven
Copy link
Author

dneven commented Feb 7, 2024

I am not really firm with go, but get a working patch for me.
Would like that someone with more go experience is interested in brings it back into main.

working.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant