Skip to content

Commit 855dddf

Browse files
committed
Use go-elasticsearch v8
1 parent c878dd8 commit 855dddf

File tree

21 files changed

+37
-60
lines changed

21 files changed

+37
-60
lines changed

docs/data-sources/elasticsearch_indices.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ Optional:
6363
- `final_pipeline` (String) Final ingest pipeline for the index. Indexing requests will fail if the final pipeline is set and the pipeline does not exist. The final pipeline always runs after the request pipeline (if specified) and the default pipeline (if it exists). The special pipeline name _none indicates no ingest pipeline will run.
6464
- `gc_deletes` (String) The length of time that a deleted document's version number remains available for further versioned operations.
6565
- `highlight_max_analyzed_offset` (Number) The maximum number of characters that will be analyzed for a highlight request.
66-
- `include_type_name` (Boolean) If true, a mapping type is expected in the body of mappings. Defaults to false. Supported for Elasticsearch 7.x.
6766
- `indexing_slowlog_level` (String) Set which logging level to use for the search slow log, can be: `warn`, `info`, `debug`, `trace`
6867
- `indexing_slowlog_source` (String) Set the number of characters of the `_source` to include in the slowlog lines, `false` or `0` will skip logging the source entirely and setting it to `true` will log the entire source regardless of size. The original `_source` is reformatted by default to make sure that it fits on a single log line.
6968
- `indexing_slowlog_threshold_index_debug` (String) Set the cutoff for shard level slow search logging of slow searches for indexing queries, in time units, e.g. `2s`

docs/resources/elasticsearch_index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ resource "elasticstack_elasticsearch_index" "my_index" {
7979
- `final_pipeline` (String) Final ingest pipeline for the index. Indexing requests will fail if the final pipeline is set and the pipeline does not exist. The final pipeline always runs after the request pipeline (if specified) and the default pipeline (if it exists). The special pipeline name _none indicates no ingest pipeline will run.
8080
- `gc_deletes` (String) The length of time that a deleted document's version number remains available for further versioned operations.
8181
- `highlight_max_analyzed_offset` (Number) The maximum number of characters that will be analyzed for a highlight request.
82-
- `include_type_name` (Boolean) If true, a mapping type is expected in the body of mappings. Defaults to false. Supported for Elasticsearch 7.x.
8382
- `indexing_slowlog_level` (String) Set which logging level to use for the search slow log, can be: `warn`, `info`, `debug`, `trace`
8483
- `indexing_slowlog_source` (String) Set the number of characters of the `_source` to include in the slowlog lines, `false` or `0` will skip logging the source entirely and setting it to `true` will log the entire source regardless of size. The original `_source` is reformatted by default to make sure that it fits on a single log line.
8584
- `indexing_slowlog_threshold_index_debug` (String) Set the cutoff for shard level slow search logging of slow searches for indexing queries, in time units, e.g. `2s`

go.mod

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ toolchain go1.23.1
66

77
require (
88
github.com/disaster37/go-kibana-rest/v8 v8.5.0
9-
github.com/elastic/go-elasticsearch/v7 v7.17.10
9+
github.com/elastic/elastic-transport-go/v8 v8.6.0
10+
github.com/elastic/go-elasticsearch/v8 v8.15.0
1011
github.com/google/gofuzz v1.2.0
1112
github.com/google/uuid v1.6.0
1213
github.com/hashicorp/go-cty v1.4.1-0.20200723130312-85980079f637
@@ -33,6 +34,8 @@ require (
3334
github.com/cloudflare/circl v1.3.9 // indirect
3435
github.com/davecgh/go-spew v1.1.1 // indirect
3536
github.com/fatih/color v1.17.0 // indirect
37+
github.com/go-logr/logr v1.4.1 // indirect
38+
github.com/go-logr/stdr v1.2.2 // indirect
3639
github.com/go-resty/resty/v2 v2.15.3 // indirect
3740
github.com/go-test/deep v1.0.8 // indirect
3841
github.com/golang/protobuf v1.5.4 // indirect
@@ -68,6 +71,9 @@ require (
6871
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
6972
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
7073
github.com/zclconf/go-cty v1.15.0 // indirect
74+
go.opentelemetry.io/otel v1.24.0 // indirect
75+
go.opentelemetry.io/otel/metric v1.24.0 // indirect
76+
go.opentelemetry.io/otel/trace v1.24.0 // indirect
7177
golang.org/x/crypto v0.25.0 // indirect
7278
golang.org/x/mod v0.19.0 // indirect
7379
golang.org/x/net v0.27.0 // indirect

go.sum

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxG
2323
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
2424
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
2525
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
26-
github.com/elastic/go-elasticsearch/v7 v7.17.10 h1:TCQ8i4PmIJuBunvBS6bwT2ybzVFxxUhhltAs3Gyu1yo=
27-
github.com/elastic/go-elasticsearch/v7 v7.17.10/go.mod h1:OJ4wdbtDNk5g503kvlHLyErCgQwwzmDtaFC4XyOxXA4=
26+
github.com/elastic/elastic-transport-go/v8 v8.6.0 h1:Y2S/FBjx1LlCv5m6pWAF2kDJAHoSjSRSJCApolgfthA=
27+
github.com/elastic/elastic-transport-go/v8 v8.6.0/go.mod h1:YLHer5cj0csTzNFXoNQ8qhtGY1GTvSqPnKWKaqQE3Hk=
28+
github.com/elastic/go-elasticsearch/v8 v8.15.0 h1:IZyJhe7t7WI3NEFdcHnf6IJXqpRf+8S8QWLtZYYyBYk=
29+
github.com/elastic/go-elasticsearch/v8 v8.15.0/go.mod h1:HCON3zj4btpqs2N1jjsAy4a/fiAul+YBP00mBH4xik8=
2830
github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc=
2931
github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ=
3032
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
@@ -36,6 +38,11 @@ github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+
3638
github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow=
3739
github.com/go-git/go-git/v5 v5.12.0 h1:7Md+ndsjrzZxbddRDZjF14qK+NN56sy6wkqaVrjZtys=
3840
github.com/go-git/go-git/v5 v5.12.0/go.mod h1:FTM9VKtnI2m65hNI/TenDDDnUf2Q9FHnXYjuz9i5OEY=
41+
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
42+
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
43+
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
44+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
45+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
3946
github.com/go-resty/resty/v2 v2.15.3 h1:bqff+hcqAflpiF591hhJzNdkRsFhlB96CYfBwSFvql8=
4047
github.com/go-resty/resty/v2 v2.15.3/go.mod h1:0fHAoK7JoBy/Ch36N8VFeMsK7xQOHhvWaC3iOktwmIU=
4148
github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM=
@@ -186,6 +193,14 @@ github.com/zclconf/go-cty v1.15.0 h1:tTCRWxsexYUmtt/wVxgDClUe+uQusuI443uL6e+5sXQ
186193
github.com/zclconf/go-cty v1.15.0/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
187194
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6ZMSMNJFMOjqrGHynW3DIBuR2H9j0ug+Mo=
188195
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
196+
go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
197+
go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
198+
go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI=
199+
go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco=
200+
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
201+
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
202+
go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI=
203+
go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU=
189204
go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU=
190205
go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc=
191206
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

internal/clients/api_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010

1111
"github.com/disaster37/go-kibana-rest/v8"
12-
"github.com/elastic/go-elasticsearch/v7"
12+
"github.com/elastic/go-elasticsearch/v8"
1313
"github.com/elastic/terraform-provider-elasticstack/generated/alerting"
1414
"github.com/elastic/terraform-provider-elasticstack/generated/connectors"
1515
"github.com/elastic/terraform-provider-elasticstack/generated/data_views"

internal/clients/config/base.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"net/http"
66
"os"
77

8-
"github.com/elastic/go-elasticsearch/v7"
8+
"github.com/elastic/go-elasticsearch/v8"
99
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1010
)
1111

internal/clients/config/client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package config
22

33
import (
44
"github.com/disaster37/go-kibana-rest/v8"
5-
"github.com/elastic/go-elasticsearch/v7"
5+
"github.com/elastic/go-elasticsearch/v8"
66
"github.com/elastic/terraform-provider-elasticstack/internal/clients/fleet"
77
)
88

internal/clients/config/debug.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"net/http/httputil"
88
"time"
99

10-
"github.com/elastic/go-elasticsearch/v7/estransport"
10+
"github.com/elastic/elastic-transport-go/v8/elastictransport"
1111
"github.com/elastic/terraform-provider-elasticstack/internal/utils"
1212
"github.com/hashicorp/terraform-plugin-log/tflog"
1313
)
@@ -22,7 +22,7 @@ const logRespMsg = `%s API Response for [%s] Details:
2222
%s
2323
-----------------------------------------------------`
2424

25-
var _ estransport.Logger = &debugLogger{}
25+
var _ elastictransport.Logger = &debugLogger{}
2626

2727
type debugLogger struct {
2828
Name string

internal/clients/config/elasticsearch.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strconv"
1010
"strings"
1111

12-
"github.com/elastic/go-elasticsearch/v7"
12+
"github.com/elastic/go-elasticsearch/v8"
1313
fwdiags "github.com/hashicorp/terraform-plugin-framework/diag"
1414
sdkdiags "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1515
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging"

internal/clients/elasticsearch/index.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"net/http"
99
"strings"
1010

11-
"github.com/elastic/go-elasticsearch/v7/esapi"
11+
"github.com/elastic/go-elasticsearch/v8/esapi"
1212
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
1313
"github.com/elastic/terraform-provider-elasticstack/internal/models"
1414
"github.com/elastic/terraform-provider-elasticstack/internal/utils"
@@ -268,9 +268,6 @@ func PutIndex(ctx context.Context, apiClient *clients.ApiClient, index *models.I
268268
esClient.Indices.Create.WithMasterTimeout(params.MasterTimeout),
269269
esClient.Indices.Create.WithTimeout(params.Timeout),
270270
}
271-
if params.IncludeTypeName {
272-
opts = append(opts, esClient.Indices.Create.WithIncludeTypeName(params.IncludeTypeName))
273-
}
274271
res, err := esClient.Indices.Create(
275272
index.Name,
276273
opts...,
@@ -425,8 +422,7 @@ func UpdateIndexMappings(ctx context.Context, apiClient *clients.ApiClient, inde
425422
fwdiags.NewErrorDiagnostic(err.Error(), err.Error()),
426423
}
427424
}
428-
req := esClient.Indices.PutMapping.WithIndex(index)
429-
res, err := esClient.Indices.PutMapping(strings.NewReader(mappings), req, esClient.Indices.PutMapping.WithContext(ctx))
425+
res, err := esClient.Indices.PutMapping([]string{index}, strings.NewReader(mappings), esClient.Indices.PutMapping.WithContext(ctx))
430426
if err != nil {
431427
return fwdiags.Diagnostics{
432428
fwdiags.NewErrorDiagnostic(err.Error(), err.Error()),

internal/clients/elasticsearch/logstash.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func GetLogstashPipeline(ctx context.Context, apiClient *clients.ApiClient, pipe
4141
if err != nil {
4242
return nil, diag.FromErr(err)
4343
}
44-
res, err := esClient.LogstashGetPipeline(pipelineID, esClient.LogstashGetPipeline.WithContext(ctx))
44+
res, err := esClient.LogstashGetPipeline(esClient.LogstashGetPipeline.WithDocumentID(pipelineID), esClient.LogstashGetPipeline.WithContext(ctx))
4545
if err != nil {
4646
return nil, diag.FromErr(err)
4747
}

internal/clients/elasticsearch/transform.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import (
88
"net/http"
99
"time"
1010

11-
"github.com/elastic/go-elasticsearch/v7"
12-
"github.com/elastic/go-elasticsearch/v7/esapi"
11+
"github.com/elastic/go-elasticsearch/v8"
12+
"github.com/elastic/go-elasticsearch/v8/esapi"
1313
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
1414
"github.com/elastic/terraform-provider-elasticstack/internal/models"
1515
"github.com/elastic/terraform-provider-elasticstack/internal/utils"

internal/elasticsearch/index/index/create.go

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,14 @@ package index
22

33
import (
44
"context"
5-
"fmt"
65

76
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
87
"github.com/elastic/terraform-provider-elasticstack/internal/clients/elasticsearch"
98
"github.com/elastic/terraform-provider-elasticstack/internal/utils"
10-
"github.com/hashicorp/go-version"
11-
"github.com/hashicorp/terraform-plugin-framework/path"
129
"github.com/hashicorp/terraform-plugin-framework/resource"
1310
"github.com/hashicorp/terraform-plugin-framework/types"
1411
)
1512

16-
var includeTypeNameMinUnsupportedVersion = version.Must(version.NewVersion("8.0.0"))
17-
1813
func (r Resource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse) {
1914
var planModel tfModel
2015
resp.Diagnostics.Append(req.Plan.Get(ctx, &planModel)...)
@@ -49,20 +44,6 @@ func (r Resource) Create(ctx context.Context, req resource.CreateRequest, resp *
4944
}
5045

5146
params := planModel.toPutIndexParams(serverFlavor)
52-
serverVersion, sdkDiags := client.ServerVersion(ctx)
53-
if sdkDiags.HasError() {
54-
resp.Diagnostics.Append(utils.FrameworkDiagsFromSDK(sdkDiags)...)
55-
return
56-
}
57-
58-
if params.IncludeTypeName && serverVersion.GreaterThanOrEqual(includeTypeNameMinUnsupportedVersion) {
59-
resp.Diagnostics.AddAttributeError(
60-
path.Root("include_type_name"),
61-
"'include_type_name' field is only supported for Elasticsearch v7.x",
62-
fmt.Sprintf("'include_type_name' field is only supported for Elasticsearch v7.x. Got %s", serverVersion),
63-
)
64-
return
65-
}
6647

6748
resp.Diagnostics.Append(elasticsearch.PutIndex(ctx, client, &apiModel, &params)...)
6849
if resp.Diagnostics.HasError() {

internal/elasticsearch/index/index/models.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ type tfModel struct {
148148
Mappings jsontypes.Normalized `tfsdk:"mappings"`
149149
SettingsRaw jsontypes.Normalized `tfsdk:"settings_raw"`
150150
DeletionProtection types.Bool `tfsdk:"deletion_protection"`
151-
IncludeTypeName types.Bool `tfsdk:"include_type_name"`
152151
WaitForActiveShards types.String `tfsdk:"wait_for_active_shards"`
153152
MasterTimeout customtypes.Duration `tfsdk:"master_timeout"`
154153
Timeout customtypes.Duration `tfsdk:"timeout"`
@@ -293,7 +292,6 @@ func (model tfModel) toPutIndexParams(serverFlavor string) models.PutIndexParams
293292

294293
if serverFlavor != "serverless" {
295294
params.WaitForActiveShards = model.WaitForActiveShards.ValueString()
296-
params.IncludeTypeName = model.IncludeTypeName.ValueBool()
297295
}
298296

299297
return params

internal/elasticsearch/index/index/models_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,13 +359,11 @@ func Test_tfModel_toPutIndexParams(t *testing.T) {
359359
MasterTimeout: customtypes.NewDurationValue(expectedParams.MasterTimeout.String()),
360360
Timeout: customtypes.NewDurationValue(expectedParams.Timeout.String()),
361361
WaitForActiveShards: basetypes.NewStringValue(expectedParams.WaitForActiveShards),
362-
IncludeTypeName: basetypes.NewBoolValue(expectedParams.IncludeTypeName),
363362
}
364363

365364
flavor := "not_serverless"
366365
if isServerless {
367366
flavor = "serverless"
368-
expectedParams.IncludeTypeName = false
369367
expectedParams.WaitForActiveShards = ""
370368
}
371369

internal/elasticsearch/index/index/schema.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -480,14 +480,6 @@ func getSchema() schema.Schema {
480480
planmodifiers.BoolUseDefaultIfUnknown(true),
481481
},
482482
},
483-
"include_type_name": schema.BoolAttribute{
484-
Description: "If true, a mapping type is expected in the body of mappings. Defaults to false. Supported for Elasticsearch 7.x.",
485-
Optional: true,
486-
Computed: true,
487-
PlanModifiers: []planmodifier.Bool{
488-
planmodifiers.BoolUseDefaultIfUnknown(false),
489-
},
490-
},
491483
"wait_for_active_shards": schema.StringAttribute{
492484
Description: "The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (number_of_replicas+1). Default: `1`, the primary shard. This value is ignored when running against Serverless projects.",
493485
Optional: true,

internal/elasticsearch/index/indices/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ type indexTfModel struct {
149149
AnalysisFilter jsontypes.Normalized `tfsdk:"analysis_filter"`
150150
AnalysisNormalizer jsontypes.Normalized `tfsdk:"analysis_normalizer"`
151151
DeletionProtection types.Bool `tfsdk:"deletion_protection"`
152-
IncludeTypeName types.Bool `tfsdk:"include_type_name"`
153152
WaitForActiveShards types.String `tfsdk:"wait_for_active_shards"`
154153
MasterTimeout customtypes.Duration `tfsdk:"master_timeout"`
155154
Timeout customtypes.Duration `tfsdk:"timeout"`

internal/elasticsearch/index/indices/schema.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,6 @@ func getSchema() schema.Schema {
330330
Computed: true,
331331
Description: "Whether to allow Terraform to destroy the index. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply command that deletes the instance will fail.",
332332
},
333-
"include_type_name": schema.BoolAttribute{
334-
Description: "If true, a mapping type is expected in the body of mappings. Defaults to false. Supported for Elasticsearch 7.x.",
335-
Optional: true,
336-
Computed: true,
337-
},
338333
"wait_for_active_shards": schema.StringAttribute{
339334
Description: "The number of shard copies that must be active before proceeding with the operation. Set to `all` or any positive integer up to the total number of shards in the index (number_of_replicas+1). Default: `1`, the primary shard. This value is ignored when running against Serverless projects.",
340335
Optional: true,

internal/elasticsearch/logstash/pipeline_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func checkResourceLogstashPipelineDestroy(s *terraform.State) error {
176176
if err != nil {
177177
return err
178178
}
179-
res, err := esClient.LogstashGetPipeline(compId.ResourceId)
179+
res, err := esClient.LogstashGetPipeline(esClient.LogstashGetPipeline.WithDocumentID(compId.ResourceId))
180180
if err != nil {
181181
return err
182182
}

internal/models/models.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ type PutIndexParams struct {
290290
WaitForActiveShards string
291291
MasterTimeout time.Duration
292292
Timeout time.Duration
293-
IncludeTypeName bool // IncludeTypeName is supported only in v7.x
294293
}
295294

296295
type IndexAlias struct {

internal/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"strings"
1212
"time"
1313

14-
"github.com/elastic/go-elasticsearch/v7/esapi"
14+
"github.com/elastic/go-elasticsearch/v8/esapi"
1515
providerSchema "github.com/elastic/terraform-provider-elasticstack/internal/schema"
1616
"github.com/hashicorp/terraform-plugin-framework/diag"
1717
fwdiag "github.com/hashicorp/terraform-plugin-framework/diag"

0 commit comments

Comments
 (0)