splunk / terraform-provider-splunk

Terraform Provider for Splunk
Mozilla Public License 2.0
103 stars 75 forks source link

#105 splunk_data_ui_views - Don't read all views #106

Closed micahkemp-splunk closed 2 years ago

micahkemp-splunk commented 2 years ago

Closes #105

This PR attempts to improve the performance of the splunk_data_ui_views resource during the read phase.

The current implementation first reads all views (servicesNS/-/-/data/ui/views) and iterates through the found views for the first view with a name matching the resource's name. This method is flawed for two major reasons:

These issues are addressed in this pull request by:

Output from related acceptance tests:

TF_ACC=1 <redacted> go test ./... -timeout 30s -run TestAccSplunkDashboards -v        
...
=== RUN   TestAccSplunkDashboards
--- PASS: TestAccSplunkDashboards (0.26s)
=== RUN   TestAccSplunkDashboardsWithAcl
--- PASS: TestAccSplunkDashboardsWithAcl (0.25s)
PASS
ok      github.com/splunk/terraform-provider-splunk/splunk      0.919s