Skip to content

Commit 741a4cf

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mw-resource-2.0
2 parents 6549a9f + 5f2154e commit 741a4cf

File tree

112 files changed

+974
-629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+974
-629
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- Add support for `solution` field in `elasticstack_kibana_space` resource and data source ([#1102](https://github.com/elastic/terraform-provider-elasticstack/issues/1102))
55
- Add `slo_id` validation to `elasticstack_kibana_slo` ([#1221](https://github.com/elastic/terraform-provider-elasticstack/pull/1221))
66
- Add `ignore_missing_component_templates` to `elasticstack_elasticsearch_index_template` ([#1206](https://github.com/elastic/terraform-provider-elasticstack/pull/1206))
7+
- Migrate `elasticstack_elasticsearch_enrich_policy` resource and data source to Terraform Plugin Framework ([#1220](https://github.com/elastic/terraform-provider-elasticstack/pull/1220))
78
- Prevent provider panic when a script exists in state, but not in Elasticsearch ([#1218](https://github.com/elastic/terraform-provider-elasticstack/pull/1218))
89
- Allow version changes without a destroy/create cycle with `elasticstack_fleet_integration` ([#1255](https://github.com/elastic/terraform-provider-elasticstack/pull/1255)). This fixes an issue where it was impossible to upgrade integrations which are used by an integration policy.
910
- Add `namespace` attribute to `elasticstack_kibana_synthetics_monitor` resource to support setting data stream namespace independently from `space_id` ([#1247](https://github.com/elastic/terraform-provider-elasticstack/pull/1247))

docs/data-sources/elasticsearch_enrich_policy.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,35 @@ output "query" {
7474

7575
- `name` (String) The name of the policy.
7676

77+
### Optional
78+
79+
- `elasticsearch_connection` (Block List, Deprecated) Elasticsearch connection configuration block. (see [below for nested schema](#nestedblock--elasticsearch_connection))
80+
7781
### Read-Only
7882

7983
- `enrich_fields` (Set of String) Fields to add to matching incoming documents. These fields must be present in the source indices.
8084
- `id` (String) Internal identifier of the resource
8185
- `indices` (Set of String) Array of one or more source indices used to create the enrich index.
82-
- `match_field` (String) Field in source indices used to match incoming documents.
86+
- `match_field` (String) Field from the source indices used to match incoming documents.
8387
- `policy_type` (String) The type of enrich policy, can be one of geo_match, match, range.
8488
- `query` (String) Query used to filter documents in the enrich index. The policy only uses documents matching this query to enrich incoming documents. Defaults to a match_all query.
89+
90+
<a id="nestedblock--elasticsearch_connection"></a>
91+
### Nested Schema for `elasticsearch_connection`
92+
93+
Optional:
94+
95+
- `api_key` (String, Sensitive) API Key to use for authentication to Elasticsearch
96+
- `bearer_token` (String, Sensitive) Bearer Token to use for authentication to Elasticsearch
97+
- `ca_data` (String) PEM-encoded custom Certificate Authority certificate
98+
- `ca_file` (String) Path to a custom Certificate Authority certificate
99+
- `cert_data` (String) PEM encoded certificate for client auth
100+
- `cert_file` (String) Path to a file containing the PEM encoded certificate for client auth
101+
- `endpoints` (List of String, Sensitive) A list of endpoints where the terraform provider will point to, this must include the http(s) schema and port number.
102+
- `es_client_authentication` (String, Sensitive) ES Client Authentication field to be used with the JWT token
103+
- `headers` (Map of String, Sensitive) A list of headers to be sent with each request to Elasticsearch.
104+
- `insecure` (Boolean) Disable TLS certificate validation
105+
- `key_data` (String, Sensitive) PEM encoded private key for client auth
106+
- `key_file` (String) Path to a file containing the PEM encoded private key for client auth
107+
- `password` (String, Sensitive) Password to use for API authentication to Elasticsearch.
108+
- `username` (String) Username to use for API authentication to Elasticsearch.

docs/resources/elasticsearch_enrich_policy.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ resource "elasticstack_elasticsearch_enrich_policy" "policy1" {
5858

5959
### Optional
6060

61-
- `elasticsearch_connection` (Block List, Max: 1, Deprecated) Elasticsearch connection configuration block. This property will be removed in a future provider version. Configure the Elasticsearch connection via the provider configuration instead. (see [below for nested schema](#nestedblock--elasticsearch_connection))
61+
- `elasticsearch_connection` (Block List, Deprecated) Elasticsearch connection configuration block. (see [below for nested schema](#nestedblock--elasticsearch_connection))
6262
- `execute` (Boolean) Whether to call the execute API function in order to create the enrich index.
6363
- `query` (String) Query used to filter documents in the enrich index. The policy only uses documents matching this query to enrich incoming documents. Defaults to a match_all query.
6464

6565
### Read-Only
6666

67-
- `id` (String) The ID of this resource.
67+
- `id` (String) Internal identifier of the resource
6868

6969
<a id="nestedblock--elasticsearch_connection"></a>
7070
### Nested Schema for `elasticsearch_connection`

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ require (
1919
github.com/hashicorp/terraform-plugin-log v0.9.0
2020
github.com/hashicorp/terraform-plugin-mux v0.20.0
2121
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0
22+
github.com/hashicorp/terraform-plugin-testing v1.13.3
2223
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c
2324
github.com/oapi-codegen/runtime v1.1.2
24-
github.com/stretchr/testify v1.11.0
25+
github.com/stretchr/testify v1.11.1
2526
go.uber.org/mock v0.6.0
2627
)
2728

go.sum

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ github.com/hashicorp/terraform-plugin-mux v0.20.0 h1:3QpBnI9uCuL0Yy2Rq/kR9cOdmOF
621621
github.com/hashicorp/terraform-plugin-mux v0.20.0/go.mod h1:wSIZwJjSYk86NOTX3fKUlThMT4EAV1XpBHz9SAvjQr4=
622622
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0 h1:NFPMacTrY/IdcIcnUB+7hsore1ZaRWU9cnB6jFoBnIM=
623623
github.com/hashicorp/terraform-plugin-sdk/v2 v2.37.0/go.mod h1:QYmYnLfsosrxjCnGY1p9c7Zj6n9thnEE+7RObeYs3fA=
624+
github.com/hashicorp/terraform-plugin-testing v1.13.3 h1:QLi/khB8Z0a5L54AfPrHukFpnwsGL8cwwswj4RZduCo=
625+
github.com/hashicorp/terraform-plugin-testing v1.13.3/go.mod h1:WHQ9FDdiLoneey2/QHpGM/6SAYf4A7AZazVg7230pLE=
624626
github.com/hashicorp/terraform-registry-address v0.2.5 h1:2GTftHqmUhVOeuu9CW3kwDkRe4pcBDq0uuK5VJngU1M=
625627
github.com/hashicorp/terraform-registry-address v0.2.5/go.mod h1:PpzXWINwB5kuVS5CA7m1+eO2f1jKb5ZDIxrOPfpnGkg=
626628
github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S52uzrw4x0jKQ=
@@ -986,8 +988,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
986988
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
987989
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
988990
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
989-
github.com/stretchr/testify v1.11.0 h1:ib4sjIrwZKxE5u/Japgo/7SJV3PvgjGiRNAvTVGqQl8=
990-
github.com/stretchr/testify v1.11.0/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
991+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
992+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
991993
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
992994
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
993995
github.com/theupdateframework/go-tuf v0.7.0 h1:CqbQFrWo1ae3/I0UCblSbczevCCbS31Qvs5LdxRWqRI=

internal/acctest/checks/resource_list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package checks
33
import (
44
"fmt"
55

6-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
6+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
77
)
88

99
func TestCheckResourceListAttr(name, key string, values []string) resource.TestCheckFunc {

internal/acctest/checks/user_auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"io"
77

88
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
9-
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
9+
"github.com/hashicorp/terraform-plugin-testing/terraform"
1010
)
1111

1212
func CheckUserCanAuthenticate(username string, password string) func(*terraform.State) error {

internal/apm/agent_configuration/resource_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"testing"
66

77
"github.com/elastic/terraform-provider-elasticstack/internal/acctest"
8-
tf_acctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
9-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
8+
tf_acctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
9+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
1010
)
1111

1212
func TestAccResourceAgentConfiguration(t *testing.T) {

internal/elasticsearch/cluster/cluster_info_data_source_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"testing"
55

66
"github.com/elastic/terraform-provider-elasticstack/internal/acctest"
7-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
7+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
88
)
99

1010
func TestAccDataSourceClusterInfo(t *testing.T) {

internal/elasticsearch/cluster/script_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import (
66

77
"github.com/elastic/terraform-provider-elasticstack/internal/acctest"
88
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
9-
sdkacctest "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
10-
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
11-
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
9+
sdkacctest "github.com/hashicorp/terraform-plugin-testing/helper/acctest"
10+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
11+
"github.com/hashicorp/terraform-plugin-testing/terraform"
1212
"github.com/stretchr/testify/require"
1313
)
1414

0 commit comments

Comments
 (0)