Skip to content

Commit 8b195c9

Browse files
authored
[Exporter] Handle new attributes for Slack and MS Teams in databricks_notification_destination (#5008)
## 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` - [ ] using Go SDK - [ ] using TF Plugin Framework - [x] has entry in `NEXT_CHANGELOG.md` file
1 parent d84bc6f commit 8b195c9

File tree

2 files changed

+31
-6
lines changed

2 files changed

+31
-6
lines changed

NEXT_CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
### Exporter
2020

2121
* Improve handling of dependencies for vector search index ([#4989](https://github.com/databricks/terraform-provider-databricks/pull/4989)).
22+
* Handle new attributes for Slack and MS Teams in `databricks_notification_destination` ([#5008](https://github.com/databricks/terraform-provider-databricks/pull/5008)).
2223

2324
### Internal Changes

exporter/importables.go

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,29 +2584,53 @@ var resourcesMap map[string]importable = map[string]importable{
25842584
}
25852585
}
25862586
case "SLACK":
2587-
if notificationDestination.Config.Slack != nil && pathString == "config.0.slack.0.url" {
2588-
return !notificationDestination.Config.Slack.UrlSet
2587+
if notificationDestination.Config.Slack != nil {
2588+
switch pathString {
2589+
case "config.0.slack.0.url":
2590+
return !notificationDestination.Config.Slack.UrlSet
2591+
case "config.0.slack.0.channel_id":
2592+
return !notificationDestination.Config.Slack.ChannelIdSet
2593+
case "config.0.slack.0.oauth_token":
2594+
return !notificationDestination.Config.Slack.OauthTokenSet
2595+
}
25892596
}
25902597
case "PAGERDUTY":
25912598
if notificationDestination.Config.Pagerduty != nil && pathString == "config.0.pagerduty.0.integration_key" {
25922599
return !notificationDestination.Config.Pagerduty.IntegrationKeySet
25932600
}
25942601
case "MICROSOFT_TEAMS":
2595-
if notificationDestination.Config.MicrosoftTeams != nil && pathString == "config.0.microsoft_teams.0.url" {
2596-
return !notificationDestination.Config.MicrosoftTeams.UrlSet
2602+
if notificationDestination.Config.MicrosoftTeams != nil {
2603+
switch pathString {
2604+
case "config.0.microsoft_teams.0.url":
2605+
return !notificationDestination.Config.MicrosoftTeams.UrlSet
2606+
case "config.0.microsoft_teams.0.channel_url":
2607+
return !notificationDestination.Config.MicrosoftTeams.ChannelUrlSet
2608+
case "config.0.microsoft_teams.0.auth_secret":
2609+
return !notificationDestination.Config.MicrosoftTeams.AuthSecretSet
2610+
case "config.0.microsoft_teams.0.tenant_id":
2611+
return !notificationDestination.Config.MicrosoftTeams.TenantIdSet
2612+
case "config.0.microsoft_teams.0.app_id":
2613+
return !notificationDestination.Config.MicrosoftTeams.AppIdSet
2614+
}
25972615
}
25982616
}
25992617
}
26002618
return defaultShouldOmitFieldFunc(ic, pathString, as, d, r)
26012619
},
26022620
Depends: []reference{
2603-
{Path: "config.email.addresses", Resource: "databricks_user", Match: "user_name", MatchType: MatchCaseInsensitive},
2604-
{Path: "config.microsoft_teams.url", Variable: true},
26052621
{Path: "config.pagerduty.integration_key", Variable: true},
26062622
{Path: "config.generic_webhook.url", Variable: true},
26072623
{Path: "config.generic_webhook.username", Variable: true},
26082624
{Path: "config.generic_webhook.password", Variable: true},
26092625
{Path: "config.slack.url", Variable: true},
2626+
{Path: "config.slack.channel_id", Variable: true},
2627+
{Path: "config.slack.oauth_token", Variable: true},
2628+
{Path: "config.microsoft_teams.url", Variable: true},
2629+
{Path: "config.microsoft_teams.channel_url", Variable: true},
2630+
{Path: "config.microsoft_teams.auth_secret", Variable: true},
2631+
{Path: "config.microsoft_teams.tenant_id", Variable: true},
2632+
{Path: "config.microsoft_teams.app_id", Variable: true},
2633+
{Path: "config.email.addresses", Resource: "databricks_user", Match: "user_name", MatchType: MatchCaseInsensitive},
26102634
},
26112635
},
26122636
"databricks_online_table": {

0 commit comments

Comments
 (0)