terraform-provider-mongodbatlas
terraform-provider-mongodbatlas copied to clipboard
MS Teams alert support in terraform provider is missing
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".
Will try to replicate issue using v1.4.5
@AdilHoumadi Internal engineering ticket to correct this issue https://jira.mongodb.org/browse/INTMDB-394
@martinstibbe Thanks for the feedback! looking forward to the test the fix and get rid of my workaround.
@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
@martinstibbe Thanks for the test, I will test it and share a feedback!
@AdilHoumadi Added SDK library support for microsoftTeamsWebhookUrl and a few others
@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
@AdilHoumadi we have just released v1.5.0, can you let us know if this resolves issue?
@Zuhairahmed, Tested and it's working, Thanks!