Skip to content

Commit 4d4ec04

Browse files
authored
Expose some internal structures for Crossplane provider (elastic#949)
* Expose some internal structures for Crossplane provider * add CHANGELOG entry
1 parent 32af63a commit 4d4ec04

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- Prevent spurious recreation of `elasticstack_fleet_agent_policy` resources due to 'changing' policy ids ([#885](https://github.com/elastic/terraform-provider-elasticstack/pull/885))
1414
- 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))
1515
- 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))
16+
- Exposes internal objects needed to build a Crossplane Elasticstack provider ([#949](https://github.com/elastic/terraform-provider-elasticstack/pull/949))
1617

1718
## [0.11.11] - 2024-10-25
1819

xpprovider/xpprovider.go

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package xpprovider
2+
3+
import (
4+
"context"
5+
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
6+
"github.com/elastic/terraform-provider-elasticstack/internal/clients/config"
7+
fwdiags "github.com/hashicorp/terraform-plugin-framework/diag"
8+
)
9+
10+
// Package xpprovider exports needed internal types and functions used by Crossplane for instantiating, interacting and
11+
// configuring the underlying Terraform Elasticstack providers.
12+
13+
// XPApiClient exports the internal type clients.ApiClient of the Terraform provider
14+
type XPApiClient = clients.ApiClient
15+
16+
// XPProviderConfiguration exports the internal type config.ProviderConfiguration of the Terraform provider
17+
type XPProviderConfiguration = config.ProviderConfiguration
18+
19+
// XPElasticsearchConnection exports the internal type config.ElasticsearchConnection of the Terraform provider
20+
type XPElasticsearchConnection = config.ElasticsearchConnection
21+
22+
// XPKibanaConnection exports the internal type config.KibanaConnection of the Terraform provider
23+
type XPKibanaConnection = config.KibanaConnection
24+
25+
// XPFleetConnection exports the internal type config.FleetConnection of the Terraform provider
26+
type XPFleetConnection = config.FleetConnection
27+
28+
func NewApiClientFromFramework(ctx context.Context, config XPProviderConfiguration, version string) (*XPApiClient, fwdiags.Diagnostics) {
29+
return clients.NewApiClientFromFramework(ctx, config, version)
30+
}

0 commit comments

Comments
 (0)