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

MS Teams alert support in terraform provider is missing #827

Closed
AdilHoumadi opened this issue Sep 8, 2022 · 9 comments
Closed

MS Teams alert support in terraform provider is missing #827

AdilHoumadi opened this issue Sep 8, 2022 · 9 comments

Comments

@AdilHoumadi
Copy link

AdilHoumadi commented Sep 8, 2022

Terraform CLI and Terraform MongoDB Atlas Provider Version

terraform --version
Terraform v0.14.11

mongodbatlas = {
  source  = "mongodb/mongodbatlas"
  version = "1.4.5"
}

Terraform Configuration File

resource "mongodbatlas_third_party_integration" "microsoft_teams" {
  project_id = mongodbatlas_project.project.id
  type = "MICROSOFT_TEAMS"
  microsoft_teams_webhook_url  = "https://xxx.webhook.office.com/webhookb/yyy"
}

resource "mongodbatlas_alert_configuration" "alerts" {
  project_id = mongodbatlas_project.project.id
  enabled    = true
  notification {
    type_name     = "MICROSOFT_TEAMS"
    interval_min  = "15"
    delay_min     = "0"
  }
  depends_on = [mongodbatlas_third_party_integration.microsoft_teams]
}

Steps to Reproduce

$ terraform init
$ terraform apply

Expected Behavior

According to these discussions we should be able to send alarms to MS teams:
Correct me if I am missing something!
https://feedback.mongodb.com/forums/924145-atlas/suggestions/45194335-ms-teams-alert-support-in-terraform-provider
https://feedback.mongodb.com/forums/924145-atlas/suggestions/40505692-integration-with-microsoft-teams

Actual Behavior

Error: expected notification.0.type_name to be one of [EMAIL SMS PAGER_DUTY SLACK FLOWDOCK DATADOG OPS_GENIE VICTOR_OPS WEBHOOK USER TEAM GROUP ORG], got MICROSOFT_TEAMS

https://github.com/mongodb/terraform-provider-mongodbatlas/blob/master/mongodbatlas/resource_mongodbatlas_alert_configuration.go#L277-L283

Additional Context

According to this doc: https://www.mongodb.com/docs/cloud-manager/reference/api/alert-configurations-create-config/
We do need the type_name=MICROSOFT_TEAMS to be added to the list.
And we should include this param in the notifications list: microsoftTeamsWebhookUrl

notifications.microsoftTeamsWebhookUrl
Microsoft Teams channel incoming webhook URL. if "notifications.typeName" : "MICROSOFT_TEAMS".
@martinstibbe
Copy link
Contributor

Will try to replicate issue using v1.4.5

@martinstibbe
Copy link
Contributor

@AdilHoumadi Internal engineering ticket to correct this issue https://jira.mongodb.org/browse/INTMDB-394

@AdilHoumadi
Copy link
Author

@martinstibbe Thanks for the feedback! looking forward to the test the fix and get rid of my workaround.

@martinstibbe
Copy link
Contributor

@AdilHoumadi https://github.com/mongodb/terraform-provider-mongodbatlas/tree/INTMDB-394 this branch has the changes if you would like to compile a binary to test in the meantime

@AdilHoumadi
Copy link
Author

@martinstibbe Thanks for the test, I will test it and share a feedback!

@martinstibbe
Copy link
Contributor

@AdilHoumadi Added SDK library support for microsoftTeamsWebhookUrl and a few others

@martinstibbe
Copy link
Contributor

martinstibbe commented Oct 19, 2022

@AdilHoumadi I have combined this in another fix for this upcoming release v1.5.0 INTMDB-373 Branch has Webhook and MS Teams configuration parameters

@martinstibbe martinstibbe added the not_stale Not stale issue or PR label Oct 26, 2022
@Zuhairahmed
Copy link
Collaborator

@AdilHoumadi we have just released v1.5.0, can you let us know if this resolves issue?

@Zuhairahmed Zuhairahmed removed the not_stale Not stale issue or PR label Nov 30, 2022
@AdilHoumadi
Copy link
Author

@Zuhairahmed, Tested and it's working, Thanks!

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

3 participants