Skip to content

Commit 10a33d6

Browse files
authored
Merge branch 'elastic:main' into main
2 parents a01a80c + 0d7feee commit 10a33d6

File tree

16 files changed

+156
-38
lines changed

16 files changed

+156
-38
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Fix a provider crash when interacting with elasticstack_kibana_data_view resources created with 0.11.0. ([#979](https://github.com/elastic/terraform-provider-elasticstack/pull/979))
44
- Add `max_primary_shard_docs` condition to ILM rollover ([#845](https://github.com/elastic/terraform-provider-elasticstack/pull/845))
55
- Add missing entries to `data_view.field_formats.params` ([#1001](https://github.com/elastic/terraform-provider-elasticstack/pull/1001))
6+
- Fix namespaces inconsistency when creating elasticstack_kibana_data_view resources ([#1011](https://github.com/elastic/terraform-provider-elasticstack/pull/1011))
67

78
## [0.11.13] - 2025-01-09
89

@@ -19,6 +20,7 @@
1920
- Support multiple group by fields in SLOs ([#870](https://github.com/elastic/terraform-provider-elasticstack/pull/878)). This changes to type of the `group_by` attribute of the `elasticstack_kibana_slo` resource from a String to a list of Strings. Any existing SLO defintions will need to update `group_by = "field"` to `group_by = ["field"]`.
2021

2122
### Changes
23+
2224
- Handle NPE in integration policy secrets ([#946](https://github.com/elastic/terraform-provider-elasticstack/pull/946))
2325
- Use the auto-generated OAS schema from elastic/kibana for the Fleet API. ([#834](https://github.com/elastic/terraform-provider-elasticstack/issues/834))
2426
- Support description in `elasticstack_elasticsearch_security_role` data sources. ([#884](https://github.com/elastic/terraform-provider-elasticstack/pull/884))

catalog-info.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ spec:
3131
teams:
3232
control-plane-hosted-applications:
3333
access_level: MANAGE_BUILD_AND_READ
34-
serverless-core-architecture:
34+
serverless-core:
3535
access_level: MANAGE_BUILD_AND_READ
3636
everyone:
3737
access_level: READ_ONLY

docs/resources/kibana_data_view.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Optional:
219219
- `width` (Number) Width for image type URLs.
220220

221221
<a id="nestedatt--data_view--field_formats--params--colors"></a>
222-
### Nested Schema for `data_view.field_formats.params.width`
222+
### Nested Schema for `data_view.field_formats.params.colors`
223223

224224
Optional:
225225

@@ -230,7 +230,7 @@ Optional:
230230

231231

232232
<a id="nestedatt--data_view--field_formats--params--lookup_entries"></a>
233-
### Nested Schema for `data_view.field_formats.params.width`
233+
### Nested Schema for `data_view.field_formats.params.lookup_entries`
234234

235235
Required:
236236

docs/resources/kibana_security_role.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ description: |-
1010

1111
Creates or updates a Kibana role. See https://www.elastic.co/guide/en/kibana/master/role-management-api-put.html
1212

13+
For Features, see: https://www.elastic.co/guide/en/kibana/current/features-api-get.html
14+
15+
For Security Privileges, see: https://www.elastic.co/guide/en/elasticsearch/reference/current/security-privileges.html
16+
1317
## Example Usage
1418

1519
### Using base privileges

docs/resources/kibana_synthetics_private_location.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ resource "elasticstack_fleet_agent_policy" "sample" {
3131
3232
resource "elasticstack_kibana_synthetics_private_location" "example" {
3333
label = "example label"
34-
space_id = "default"
3534
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id
3635
tags = ["tag-a", "tag-b"]
3736
geo = {

examples/resources/elasticstack_kibana_synthetics_private_location/resource.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ resource "elasticstack_fleet_agent_policy" "sample" {
1414

1515
resource "elasticstack_kibana_synthetics_private_location" "example" {
1616
label = "example label"
17-
space_id = "default"
1817
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id
1918
tags = ["tag-a", "tag-b"]
2019
geo = {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ require (
1212
github.com/google/uuid v1.6.0
1313
github.com/hashicorp/go-cty v1.4.1-0.20241127173709-a0325cb22c13
1414
github.com/hashicorp/go-version v1.7.0
15-
github.com/hashicorp/terraform-plugin-framework v1.13.0
15+
github.com/hashicorp/terraform-plugin-framework v1.14.1
1616
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0
17-
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0
17+
github.com/hashicorp/terraform-plugin-framework-validators v0.17.0
1818
github.com/hashicorp/terraform-plugin-go v0.26.0
1919
github.com/hashicorp/terraform-plugin-log v0.9.0
2020
github.com/hashicorp/terraform-plugin-mux v0.18.0

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ github.com/hashicorp/terraform-exec v0.22.0 h1:G5+4Sz6jYZfRYUCg6eQgDsqTzkNXV+fP8
9595
github.com/hashicorp/terraform-exec v0.22.0/go.mod h1:bjVbsncaeh8jVdhttWYZuBGj21FcYw6Ia/XfHcNO7lQ=
9696
github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q=
9797
github.com/hashicorp/terraform-json v0.24.0/go.mod h1:Nfj5ubo9xbu9uiAoZVBsNOjvNKB66Oyrvtit74kC7ow=
98-
github.com/hashicorp/terraform-plugin-framework v1.13.0 h1:8OTG4+oZUfKgnfTdPTJwZ532Bh2BobF4H+yBiYJ/scw=
99-
github.com/hashicorp/terraform-plugin-framework v1.13.0/go.mod h1:j64rwMGpgM3NYXTKuxrCnyubQb/4VKldEKlcG8cvmjU=
98+
github.com/hashicorp/terraform-plugin-framework v1.14.1 h1:jaT1yvU/kEKEsxnbrn4ZHlgcxyIfjvZ41BLdlLk52fY=
99+
github.com/hashicorp/terraform-plugin-framework v1.14.1/go.mod h1:xNUKmvTs6ldbwTuId5euAtg37dTxuyj3LHS3uj7BHQ4=
100100
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0 h1:SJXL5FfJJm17554Kpt9jFXngdM6fXbnUnZ6iT2IeiYA=
101101
github.com/hashicorp/terraform-plugin-framework-jsontypes v0.2.0/go.mod h1:p0phD0IYhsu9bR4+6OetVvvH59I6LwjXGnTVEr8ox6E=
102-
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0 h1:O9QqGoYDzQT7lwTXUsZEtgabeWW96zUBh47Smn2lkFA=
103-
github.com/hashicorp/terraform-plugin-framework-validators v0.16.0/go.mod h1:Bh89/hNmqsEWug4/XWKYBwtnw3tbz5BAy1L1OgvbIaY=
102+
github.com/hashicorp/terraform-plugin-framework-validators v0.17.0 h1:0uYQcqqgW3BMyyve07WJgpKorXST3zkpzvrOnf3mpbg=
103+
github.com/hashicorp/terraform-plugin-framework-validators v0.17.0/go.mod h1:VwdfgE/5Zxm43flraNa0VjcvKQOGVrcO4X8peIri0T0=
104104
github.com/hashicorp/terraform-plugin-go v0.26.0 h1:cuIzCv4qwigug3OS7iKhpGAbZTiypAfFQmw8aE65O2M=
105105
github.com/hashicorp/terraform-plugin-go v0.26.0/go.mod h1:+CXjuLDiFgqR+GcrM5a2E2Kal5t5q2jb0E3D57tTdNY=
106106
github.com/hashicorp/terraform-plugin-log v0.9.0 h1:i7hOA+vdAItN1/7UrfBqBwvYPQ9TFvymaRGZED3FCV0=

internal/kibana/data_view/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (r *DataViewResource) Create(ctx context.Context, req resource.CreateReques
3535
return
3636
}
3737

38-
diags = planModel.populateFromAPI(ctx, dataView)
38+
diags = planModel.populateFromAPI(ctx, dataView, spaceID)
3939
resp.Diagnostics.Append(diags...)
4040
if resp.Diagnostics.HasError() {
4141
return

internal/kibana/data_view/models.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/hashicorp/terraform-plugin-framework/types"
1313
)
1414

15-
func (model *dataViewModel) populateFromAPI(ctx context.Context, data *kbapi.DataViewsDataViewResponseObject) diag.Diagnostics {
15+
func (model *dataViewModel) populateFromAPI(ctx context.Context, data *kbapi.DataViewsDataViewResponseObject, spaceID string) diag.Diagnostics {
1616
if data == nil {
1717
return nil
1818
}
@@ -60,10 +60,15 @@ func (model *dataViewModel) populateFromAPI(ctx context.Context, data *kbapi.Dat
6060

6161
// Keep the original ordering if equal but unordered
6262
// The API response is ordered by name.
63-
if len(existing) == len(incoming) {
63+
// Additionally, allow for the response containing an extra namespace that is the current SpaceID
64+
// If the SpaceID is not included in the `namespaces` field, when trying to GET the object it will 404
65+
if (len(existing) == len(incoming)) || (len(existing) == len(incoming)-1) {
6466
useExisting := true
6567
for _, ns := range existing {
6668
if !slices.Contains(incoming, ns) {
69+
if ns == spaceID {
70+
continue
71+
}
6772
useExisting = false
6873
break
6974
}

0 commit comments

Comments
 (0)