splunk / terraform-provider-splunk

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

Swap out internal client for new external client - SAML Groups #123

Open micahkemp-splunk opened 2 years ago

micahkemp-splunk commented 2 years ago

This PR is the start of the migration from the internally-included Splunk client for the newly available external client. The external client is added alongside the legacy client, and can be used by setting either the appropriate provider (use_client_default) or resource (use_client) configuration to external.

The external client handles CRUD operations with standard Create/Read/Update/Delete functions, which deduplicates a lot of code, and provides a single location to implement fixes when issues are discovered. Migrating this Terraform provider to use it should solve a lot of the error handling and drift issues currently present.

The interesting work is found in https://github.com/splunk/terraform-provider-splunk/pull/123/commits/5a3434967ead6d4657abf33dd4a999f644717549, which adds composable CRUD function creation, simplifying logic and reducing repetition.

The remaining commits are in support of this swap.

As this PR adds the ability to use the external client, but by default does not change existing behavior, it can be merged and tagged without a major version bump. After all existing resources permit use of the external client, a new PR can be submitted to make the default behavior to use the external client, which would justify a major version bump.