Skip to content

Commit 21ef72f

Browse files
authored
Document and handle additional Microsoft Teams options in databricks_notification_destination (#4990)
## Changes <!-- Summary of your changes that are easy to understand --> ## Tests <!-- How is this tested? Please see the checklist below and also describe any other relevant tests --> - [x] `make test` run locally - [ ] relevant change in `docs/` folder - [ ] covered with integration tests in `internal/acceptance` - [x] using Go SDK - [ ] using TF Plugin Framework - [x] has entry in `NEXT_CHANGELOG.md` file
1 parent 1bd7974 commit 21ef72f

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

NEXT_CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### New Features and Improvements
88

9+
* Document and handle additional Microsoft Teams options in `databricks_notification_destination` ([#4990](https://github.com/databricks/terraform-provider-databricks/pull/4990))
10+
911
### Bug Fixes
1012

1113
### Documentation

docs/resources/notification_destination.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ The following arguments are supported:
8282
* `email` - The email configuration of the Notification Destination. It must contain the following:
8383
* `addresses` - (Required) The list of email addresses to send notifications to.
8484
* `slack` - The Slack configuration of the Notification Destination. It must contain the following:
85-
* `url` - (Required) The Slack webhook URL.
85+
* `url` - (Optional) The Slack webhook URL.
8686
* `channel_id` - (Optional) Slack channel ID for notifications.
8787
* `oauth_token` - (Optional) OAuth token for Slack authentication.
8888
* `pagerduty` - The PagerDuty configuration of the Notification Destination. It must contain the following:
8989
* `integration_key` - (Required) The PagerDuty integration key.
9090
* `microsoft_teams` - The Microsoft Teams configuration of the Notification Destination. It must contain the following:
91-
* `url` - (Required) The Microsoft Teams webhook URL.
91+
* `url` - (Optional) The Microsoft Teams webhook URL.
92+
* `app_id` - (Optional) App ID for Microsoft Teams App.
93+
* `auth_secret` - (Optional) Secret for Microsoft Teams App authentication.
94+
* `channel_url` - (Optional) Channel URL for Microsoft Teams App.
95+
* `tenant_id` - (Optional) Tenant ID for Microsoft Teams App.
9296
* `generic_webhook` - The Generic Webhook configuration of the Notification Destination. It must contain the following:
9397
* `url` - (Required) The Generic Webhook URL.
9498
* `username` - (Optional) The username for basic authentication.

settings/resource_notification_destination.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ func setStruct(s *settings.NotificationDestination, readND *settings.Notificatio
3535
if readND.Config.MicrosoftTeams.UrlSet {
3636
readND.Config.MicrosoftTeams.Url = s.Config.MicrosoftTeams.Url
3737
}
38+
if readND.Config.MicrosoftTeams.ChannelUrlSet {
39+
readND.Config.MicrosoftTeams.ChannelUrl = s.Config.MicrosoftTeams.ChannelUrl
40+
}
41+
if readND.Config.MicrosoftTeams.AuthSecretSet {
42+
readND.Config.MicrosoftTeams.AuthSecret = s.Config.MicrosoftTeams.AuthSecret
43+
}
44+
if readND.Config.MicrosoftTeams.TenantIdSet {
45+
readND.Config.MicrosoftTeams.TenantId = s.Config.MicrosoftTeams.TenantId
46+
}
47+
if readND.Config.MicrosoftTeams.AppIdSet {
48+
readND.Config.MicrosoftTeams.AppId = s.Config.MicrosoftTeams.AppId
49+
}
3850
}
3951
case settings.DestinationTypeWebhook:
4052
if readND.Config.GenericWebhook != nil && s.Config.GenericWebhook != nil {
@@ -137,6 +149,10 @@ func (NDStruct) CustomizeSchema(s *common.CustomizableSchema) *common.Customizab
137149
s.SchemaPath("config", "generic_webhook", "username").SetSensitive()
138150
s.SchemaPath("config", "generic_webhook", "url").SetSensitive()
139151
s.SchemaPath("config", "microsoft_teams", "url").SetSensitive()
152+
s.SchemaPath("config", "microsoft_teams", "channel_url").SetSensitive()
153+
s.SchemaPath("config", "microsoft_teams", "auth_secret").SetSensitive()
154+
s.SchemaPath("config", "microsoft_teams", "tenant_id").SetSensitive()
155+
s.SchemaPath("config", "microsoft_teams", "app_id").SetSensitive()
140156
s.SchemaPath("config", "pagerduty", "integration_key").SetSensitive()
141157
s.SchemaPath("config", "slack", "url").SetSensitive()
142158
s.SchemaPath("config", "slack", "oauth_token").SetSensitive()

0 commit comments

Comments
 (0)