@@ -41,6 +41,8 @@ func TestAccSumologicDashboard_create(t *testing.T) {
4141 description := "Test dashboard description"
4242 theme := "Dark"
4343 refreshInterval := 30
44+ topologyLabel := "service"
45+ topologyLabelValue := "collection-proxy"
4446 literalRangeName := "today"
4547 textPanel := TextPanel {
4648 Key : "text-panel-001" ,
@@ -74,8 +76,8 @@ func TestAccSumologicDashboard_create(t *testing.T) {
7476 CheckDestroy : testAccCheckDashboardDestroy (dashboard ),
7577 Steps : []resource.TestStep {
7678 {
77- Config : dashboardCreateConfig (title , description , theme , refreshInterval , literalRangeName ,
78- textPanel , layout , variable ),
79+ Config : dashboardCreateConfig (title , description , theme , refreshInterval ,
80+ topologyLabel , topologyLabelValue , literalRangeName , textPanel , layout , variable ),
7981 Check : resource .ComposeTestCheckFunc (
8082 testAccCheckDashboardExists ("sumologic_dashboard.tf_crud_test" , & dashboard , t ),
8183 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
@@ -86,6 +88,10 @@ func TestAccSumologicDashboard_create(t *testing.T) {
8688 "refresh_interval" , strconv .FormatInt (int64 (refreshInterval ), 10 )),
8789 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
8890 "theme" , theme ),
91+ resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
92+ "topology_label_map.0.data.0.label" , topologyLabel ),
93+ resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
94+ "topology_label_map.0.data.0.values.0" , topologyLabelValue ),
8995 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
9096 "time_range.#" , "1" ),
9197 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
@@ -118,6 +124,8 @@ func TestAccSumologicDashboard_update(t *testing.T) {
118124 description := "Test dashboard description"
119125 theme := "Dark"
120126 refreshInterval := 30
127+ topologyLabel := "service"
128+ topologyLabelValue := "collection-proxy"
121129 literalRangeName := "today"
122130 textPanel := TextPanel {
123131 Key : "text-panel-001" ,
@@ -147,6 +155,7 @@ func TestAccSumologicDashboard_update(t *testing.T) {
147155 // updated config
148156 newTheme := "Light"
149157 newRefreshInterval := 60
158+ newTopologyLabelValue := "collection-cluster"
150159 newLiteralRangeName := "week"
151160 searchPanel := SumoSearchPanel {
152161 Key : "search-panel-001" ,
@@ -197,8 +206,8 @@ func TestAccSumologicDashboard_update(t *testing.T) {
197206 CheckDestroy : testAccCheckDashboardDestroy (dashboard ),
198207 Steps : []resource.TestStep {
199208 {
200- Config : dashboardCreateConfig (title , description , theme , refreshInterval , literalRangeName ,
201- textPanel , layout , csvVariable ),
209+ Config : dashboardCreateConfig (title , description , theme , refreshInterval ,
210+ topologyLabel , topologyLabelValue , literalRangeName , textPanel , layout , csvVariable ),
202211 Check : resource .ComposeTestCheckFunc (
203212 testAccCheckDashboardExists ("sumologic_dashboard.tf_crud_test" , & dashboard , t ),
204213 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
@@ -207,6 +216,8 @@ func TestAccSumologicDashboard_update(t *testing.T) {
207216 "refresh_interval" , strconv .FormatInt (int64 (refreshInterval ), 10 )),
208217 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
209218 "theme" , theme ),
219+ resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
220+ "topology_label_map.0.data.0.values.0" , topologyLabelValue ),
210221 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
211222 "time_range.0.begin_bounded_time_range.0.from.0.literal_time_range.0.range_name" ,
212223 literalRangeName ),
@@ -225,8 +236,9 @@ func TestAccSumologicDashboard_update(t *testing.T) {
225236 ),
226237 },
227238 {
228- Config : dashboardUpdateConfig (title , description , newTheme , newRefreshInterval , newLiteralRangeName ,
229- textPanel , searchPanel , newLayout , newVariables ),
239+ Config : dashboardUpdateConfig (title , description , newTheme , newRefreshInterval ,
240+ topologyLabel , newTopologyLabelValue , newLiteralRangeName , textPanel , searchPanel ,
241+ newLayout , newVariables ),
230242 Check : resource .ComposeTestCheckFunc (
231243 testAccCheckDashboardExists ("sumologic_dashboard.tf_crud_test" , & dashboard , t ),
232244 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
@@ -235,6 +247,8 @@ func TestAccSumologicDashboard_update(t *testing.T) {
235247 "refresh_interval" , strconv .FormatInt (int64 (newRefreshInterval ), 10 )),
236248 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
237249 "theme" , newTheme ),
250+ resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
251+ "topology_label_map.0.data.0.values.0" , newTopologyLabelValue ),
238252 resource .TestCheckResourceAttr ("sumologic_dashboard.tf_crud_test" ,
239253 "time_range.0.begin_bounded_time_range.0.from.0.literal_time_range.0.range_name" ,
240254 newLiteralRangeName ),
@@ -377,7 +391,8 @@ func dashboardImportConfig(title string) string {
377391}
378392
379393func dashboardCreateConfig (title string , description string , theme string , refreshInterval int ,
380- rangeName string , textPanel TextPanel , layout GridLayout , variable Variable ) string {
394+ topologyLabel string , topologyLabelValue string , rangeName string , textPanel TextPanel ,
395+ layout GridLayout , variable Variable ) string {
381396
382397 return fmt .Sprintf (`
383398 data "sumologic_personal_folder" "personalFolder" {}
@@ -387,6 +402,12 @@ func dashboardCreateConfig(title string, description string, theme string, refre
387402 folder_id = data.sumologic_personal_folder.personalFolder.id
388403 refresh_interval = %d
389404 theme = "%s"
405+ topology_label_map {
406+ data {
407+ label = "%s"
408+ values = ["%s"]
409+ }
410+ }
390411 time_range {
391412 begin_bounded_time_range {
392413 from {
@@ -427,15 +448,16 @@ func dashboardCreateConfig(title string, description string, theme string, refre
427448 hide_from_ui = false
428449 }
429450 }` ,
430- title , description , refreshInterval , theme , rangeName , textPanel .Key , textPanel .Title , textPanel .Text ,
451+ title , description , refreshInterval , theme , topologyLabel , topologyLabelValue , rangeName ,
452+ textPanel .Key , textPanel .Title , textPanel .Text ,
431453 layout .LayoutStructures [0 ].Key , variable .Name , variable .DisplayName , variable .DefaultValue ,
432454 variable .SourceDefinition .(CsvVariableSourceDefinition ).Values ,
433455 )
434456}
435457
436458func dashboardUpdateConfig (title string , description string , theme string , refreshInterval int ,
437- rangeName string , textPanel TextPanel , searchPanel SumoSearchPanel , layout GridLayout ,
438- variables []Variable ) string {
459+ topologyLabel string , topologyLabelValue string , rangeName string , textPanel TextPanel ,
460+ searchPanel SumoSearchPanel , layout GridLayout , variables []Variable ) string {
439461
440462 loqQuerySourceDef := variables [1 ].SourceDefinition .(LogQueryVariableSourceDefinition )
441463 csvSourceDef := variables [0 ].SourceDefinition .(CsvVariableSourceDefinition )
@@ -448,6 +470,12 @@ func dashboardUpdateConfig(title string, description string, theme string, refre
448470 folder_id = data.sumologic_personal_folder.personalFolder.id
449471 refresh_interval = %d
450472 theme = "%s"
473+ topology_label_map {
474+ data {
475+ label = "%s"
476+ values = ["%s"]
477+ }
478+ }
451479 time_range {
452480 begin_bounded_time_range {
453481 from {
@@ -530,7 +558,7 @@ func dashboardUpdateConfig(title string, description string, theme string, refre
530558 hide_from_ui = false
531559 }
532560 }` ,
533- title , description , refreshInterval , theme , rangeName ,
561+ title , description , refreshInterval , theme , topologyLabel , topologyLabelValue , rangeName ,
534562 textPanel .Key , textPanel .Title , textPanel .Text ,
535563 searchPanel .Key , searchPanel .Title , searchPanel .Description , searchPanel .Queries [0 ].QueryString ,
536564 searchPanel .Queries [0 ].QueryKey ,
0 commit comments