diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b106c387..29b84dcad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Prevent spurious recreation of `elasticstack_fleet_agent_policy` resources due to 'changing' policy ids ([#885](https://github.com/elastic/terraform-provider-elasticstack/pull/885)) - Support `elasticstack_kibana_alerting_rule` resources with only one of `kql` or `timeframe` attributes set ([#886](https://github.com/elastic/terraform-provider-elasticstack/pull/886)) - Rename generated/fleet to generated/kibana, add data_view APIs. Keep libs/go-kibana-rest until migration can be completed. Clean and simplify the `elasticstack_kibana_data_view` resource to match the styling of Fleet resources. ([#881](https://github.com/elastic/terraform-provider-elasticstack/issues/881)) +- Exposes internal objects needed to build a Crossplane Elasticstack provider ([#949](https://github.com/elastic/terraform-provider-elasticstack/pull/949)) ## [0.11.11] - 2024-10-25 diff --git a/xpprovider/xpprovider.go b/xpprovider/xpprovider.go new file mode 100644 index 000000000..c7cdfcddc --- /dev/null +++ b/xpprovider/xpprovider.go @@ -0,0 +1,30 @@ +package xpprovider + +import ( + "context" + "github.com/elastic/terraform-provider-elasticstack/internal/clients" + "github.com/elastic/terraform-provider-elasticstack/internal/clients/config" + fwdiags "github.com/hashicorp/terraform-plugin-framework/diag" +) + +// Package xpprovider exports needed internal types and functions used by Crossplane for instantiating, interacting and +// configuring the underlying Terraform Elasticstack providers. + +// XPApiClient exports the internal type clients.ApiClient of the Terraform provider +type XPApiClient = clients.ApiClient + +// XPProviderConfiguration exports the internal type config.ProviderConfiguration of the Terraform provider +type XPProviderConfiguration = config.ProviderConfiguration + +// XPElasticsearchConnection exports the internal type config.ElasticsearchConnection of the Terraform provider +type XPElasticsearchConnection = config.ElasticsearchConnection + +// XPKibanaConnection exports the internal type config.KibanaConnection of the Terraform provider +type XPKibanaConnection = config.KibanaConnection + +// XPFleetConnection exports the internal type config.FleetConnection of the Terraform provider +type XPFleetConnection = config.FleetConnection + +func NewApiClientFromFramework(ctx context.Context, config XPProviderConfiguration, version string) (*XPApiClient, fwdiags.Diagnostics) { + return clients.NewApiClientFromFramework(ctx, config, version) +}