Skip to content

Commit 5bc6cb2

Browse files
committed
Merge remote-tracking branch 'origin/main' into copilot/fix-7855e918-4f89-4206-9e30-02dc9febbc48
* origin/main: (45 commits) Add resource to manage ML datafeed state (#1422) Extract agent policy test config (#1439) chore(deps): update golang:1.25.4 docker digest to e68f6a0 (#1437) chore(deps): update kibana-openapi-spec digest to 6a867d8 (#1435) chore(deps): update docker.elastic.co/kibana/kibana docker tag to v9.2.1 (#1434) chore(deps): update docker.elastic.co/elasticsearch/elasticsearch docker tag to v9.2.1 (#1433) First take at documented coding standards (#1429) chore(deps): update golangci/golangci-lint-action action to v9 (#1431) chore(deps): update golang:1.25.4 docker digest to 6ca9eb0 (#1432) chore(deps): update kibana-openapi-spec digest to 96ffcd7 (#1430) chore(deps): update kibana-openapi-spec digest to a8e3b64 (#1428) chore(deps): update golang docker tag to v1.25.4 (#1423) Update the system_user acceptance tests to utilise the config directory pattern (#1404) Add an issue template for covering new stack features (#1418) chore(deps): update golang:1.25.3 docker digest to 6d4e5e7 (#1421) Update provider description (#1405) chore(deps): update golang:1.25.3 docker digest to 0afe9b5 (#1416) chore(deps): update module github.com/golangci/golangci-lint to v2.6.1 (#1417) Added space awareness to Agent Policies (#1390) Fix data view color field format params not computed in Terraform state (#1414) ...
2 parents d99bf83 + 8f45626 commit 5bc6cb2

File tree

218 files changed

+21690
-3932
lines changed

Some content is hidden

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

218 files changed

+21690
-3932
lines changed

.buildkite/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
steps:
22
- label: Release
33
agents:
4-
image: "golang:1.25.3@sha256:bce1e7ec780444d85d041889e7a0e542b0be7b272a7f46a5fb947f0f484b9736"
4+
image: "golang:1.25.4@sha256:e68f6a00e88586577fafa4d9cefad1349c2be70d21244321321c407474ff9bf2"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"

.buildkite/scripts/update-kibana-client.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ make build
1212

1313
echo "--- Starting Stack containers"
1414
make docker-fleet
15-
docker ps
16-
sleep 30
1715

1816
echo "--- Collecting docker info"
1917
docker ps

.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
STACK_VERSION=9.1.5
2+
ELASTICSEARCH_CONTAINER_NAME=terraform-elasticstack-es
3+
ELASTICSEARCH_PASSWORD=password
4+
ELASTICSEARCH_PORT=9200
5+
ELASTICSEARCH_URL=http://localhost:${ELASTICSEARCH_PORT}
6+
ELASTICSEARCH_JAVA_OPTS="-Xms128m -Xmx1g"
7+
KIBANA_CONTAINER_NAME=terraform-elasticstack-kb
8+
KIBANA_SETTINGS_CONTAINER_NAME=terraform-elasticstack-kb-settings
9+
FLEET_SETTINGS_CONTAINER_NAME=terraform-elasticstack-fleet-settings
10+
KIBANA_CERTS_CONTAINER_NAME=terraform-elasticstack-kb-certs
11+
KIBANA_PORT=5601
12+
KIBANA_PASSWORD=password
13+
KIBANA_ENCRYPTION_KEY=GsRtLGKnnuvwVQ3lqSS5kGScdfpmgEDA
14+
FLEET_CONTAINER_NAME=terraform-elasticstack-fleet
15+
ACCEPTANCE_TESTS_CONTAINER_NAME=terraform-elasticstack-acceptance-tests
16+
TOKEN_ACCEPTANCE_TESTS_CONTAINER_NAME=terraform-elasticstack-token-acceptance-tests
17+
GOVERSION=1.25.1
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: New Stack functionality
2+
description: Add support for new Stack functionality
3+
title: "[FEATURE] <title>"
4+
labels: ["Feature", "Stack Led"]
5+
body:
6+
- type: input
7+
attributes:
8+
label: Name of the resource
9+
description: What is the name of the resource you are adding or extending?
10+
placeholder: "e.g elasticstack_elasticsearch_ml_datafeed"
11+
- type: textarea
12+
attributes:
13+
label: Describe new functionality
14+
description: A concise description of the new functionality to add.
15+
placeholder: |
16+
If you're extending an existing resource:
17+
* Describe any new fields, or changes to existing fields.
18+
* Reference the source code for the existing resource.
19+
* Describe any new cases that should be covered in acceptance testing.
20+
e.g:
21+
Add support for `query` field to the Machine Learning Datafeed resource.
22+
The code for the resource is in `internal/elasticsearch/ml/datafeed/`.
23+
Add new acceptance tests covering the new `query` field.
24+
25+
If you're adding an entirely new resource:
26+
* Describe the resource and its purpose.
27+
* Include links to relevant API documentation.
28+
* Describe where the resource code should live in the provider.
29+
* Describe any cases that should be covered in acceptance testing.
30+
e.g
31+
Add a new Machine Learning Datafeed resource to manage datafeeds for ML jobs.
32+
The new resource should live in `internal/elasticsearch/ml/datafeed/`.
33+
The resource will allow users to create, read, and delete ML datafeeds via the Elasticsearch API.
34+
API docs:
35+
- Create: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-put-datafeed
36+
- Get: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-get-datafeeds
37+
- Delete: https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-delete-datafeed
38+
Make sure acceptance tests cover both a basic datafeed, and thoroughly cover all attributes in the resource schema, including datafeeds filtered by the `query` attribute.
39+
validations:
40+
required: true
41+
- type: input
42+
attributes:
43+
label: Version Introduced
44+
description: What version of the Stack was this functionality introduced in?
45+
placeholder: "e.g 9.2.0"
46+
validations:
47+
required: true
48+
- type: textarea
49+
attributes:
50+
label: Anything else?
51+
placeholder: |
52+
Links? References? Anything that will give us more context about the functionality you're adding!
53+
54+
e.g:
55+
- Links to issues/PRs where this was added in Elasticsearch/Kibana etc.
56+
- Links to any relevant documentation.
57+
- Describe any dependencies or relationships to other resources (e.g an ML datafeed is linked to an anomaly detection job).
58+
- Describe any edge cases that should be covered in acceptance testing.
59+
validations:
60+
required: false

.github/copilot-instructions.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1-
You will be tasked to fix an issue from an open-source repository. This is a Go based repository hosting a Terrform provider for the elastic stack (elasticsearch and kibana) APIs. This repo currently supports both [plugin framework](https://developer.hashicorp.com/terraform/plugin/framework/getting-started/code-walkthrough) and [sdkv2](https://developer.hashicorp.com/terraform/plugin/sdkv2) resources. Unless you're told otherwise, all new resources _must_ use the plugin framework.
1+
You will be writing or reviewing code for the Terraform provider for Elastic Stack (Elasticsearch, Kibana, Fleet, APM, and Logstash). This is a Go-based repository hosting the provider source.
22

3-
Take your time and think through every step - remember to check your solution rigorously and watch out for boundary cases, especially with the changes you made. Your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.
3+
When writing code, you must adhere to the coding standards and conventions outlined in the [CODING_STANDARDS.md](../CODING_STANDARDS.md) document in this repository.
4+
5+
When reviewing code, ensure that all changes comply with the coding standards and conventions specified in the [CODING_STANDARDS.md](../CODING_STANDARDS.md) document. Pay special attention to project structure, schema definitions, JSON handling, resource implementation, and testing practices.
6+
7+
Take your time and think through every step - remember to check solutions rigorously and watch out for boundary cases, especially with the changes being made.
8+
9+
When writing code, your solution must be perfect. If not, continue working on it. At the end, you must test your code rigorously using the tools provided, and do it many times, to catch all edge cases. If it is not robust, iterate more and make it perfect. Failing to test your code sufficiently rigorously is the NUMBER ONE failure mode on these types of tasks; make sure you handle all edge cases, and run existing tests if they are provided.
410

511
Please see [README.md](../README.md) and the [CONTRIBUTING.md](../CONTRIBUTING.md) docs before getting started.
612

7-
# Workflow
13+
# Development Workflow
814

915
## High-Level Problem Solving Strategy
1016

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ jobs:
6363
xpack.security.enabled: true
6464
xpack.security.authc.api_key.enabled: true
6565
xpack.security.authc.token.enabled: true
66+
xpack.ml.use_auto_machine_memory_percent: true
67+
xpack.ml.max_model_memory_limit: 2g
6668
xpack.watcher.enabled: true
6769
xpack.license.self_generated.type: trial
6870
repositories.url.allowed_urls: https://example.com/*
6971
path.repo: /tmp
7072
ELASTIC_PASSWORD: ${{ env.ELASTIC_PASSWORD }}
7173
ports:
7274
- 9200:9200
73-
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
75+
options: --memory=2g --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
7476
kibana:
7577
image: docker.elastic.co/kibana/kibana:${{ matrix.version }}
7678
env:

CHANGELOG.md

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
## [Unreleased]
22

3+
- Fix `elasticstack_elasticsearch_snapshot_lifecycle` metadata type conversion causing terraform apply to fail ([#1409](https://github.com/elastic/terraform-provider-elasticstack/issues/1409))
4+
- Add new `elasticstack_elasticsearch_ml_anomaly_detection_job` resource ([#1329](https://github.com/elastic/terraform-provider-elasticstack/pull/1329))
5+
- Add new `elasticstack_elasticsearch_ml_datafeed` resource ([#1340](https://github.com/elastic/terraform-provider-elasticstack/pull/1340))
6+
- Add `space_ids` attribute to all Fleet resources to support space-aware Fleet resource management ([#1390](https://github.com/elastic/terraform-provider-elasticstack/pull/1390))
7+
- Add new `elasticstack_elasticsearch_ml_job_state` resource ([#1337](https://github.com/elastic/terraform-provider-elasticstack/pull/1337))
8+
- Add new `elasticstack_elasticsearch_ml_datafeed_state` resource ([#1422](https://github.com/elastic/terraform-provider-elasticstack/pull/1422))
9+
10+
## [0.12.1] - 2025-10-22
311
- Fix regression restricting the characters in an `elasticstack_elasticsearch_role_mapping` `name`. ([#1373](https://github.com/elastic/terraform-provider-elasticstack/pull/1373))
12+
- Add schema validations to require either (but not both) `index` and `data_view_id` is set for relevant Security Detection Rules ([#1381](https://github.com/elastic/terraform-provider-elasticstack/pull/1381))
413

514
## [0.12.0] - 2025-10-15
615

16+
- Fix provider crash with `elasticstack_kibana_action_connector` when `config` or `secrets` was unset in 0.11.17 ([#1355](https://github.com/elastic/terraform-provider-elasticstack/pull/1355))
17+
- Added `labels` field to `elasticstack_kibana_synthetics_monitor` resource for associating key-value pairs with monitors ([#1360](https://github.com/elastic/terraform-provider-elasticstack/pull/1360))
18+
- Fixes provider crash with `elasticstack_kibana_slo` when using `kql_custom_indicator` with no `filter` set. ([#1354](https://github.com/elastic/terraform-provider-elasticstack/pull/1354))
19+
- Updates for Security Detection Rules ([#1361](https://github.com/elastic/terraform-provider-elasticstack/pull/1361)
20+
- Add support for `threat` property
21+
- Gracefully support `query` property not being set
22+
- Add esql specific validations to reject unsupported fields `index` and `filters`
23+
- Gracefully handle response action with no provided `frequency`
24+
- Add validation for required `anomaly_threshold` field in anomaly detection rules
25+
- Add support for `timeline_id` / `timeline_title` fields
26+
- Gracefully handle `threat_query` not being provided for `threat_match` ule
27+
28+
## [0.11.19] - 2025-10-22
29+
30+
Version 0.11.19 is equivalent to 0.12.1. It is being released to help mitigate impact from 0.11.18 being inadvertently released ahead of schedule. This version contained a breaking change and defects related to internal refactors. While 0.11.19 still contains a breaking change from 0.11.17 it does fix defects (see details below) for any users relying on the latest 0.11.x version.
31+
32+
- Fix regression restricting the characters in an `elasticstack_elasticsearch_role_mapping` `name`. ([#1373](https://github.com/elastic/terraform-provider-elasticstack/pull/1373))
33+
- Add schema validations to require either (but not both) `index` and `data_view_id` is set for relevant Security Detection Rules ([#1381](https://github.com/elastic/terraform-provider-elasticstack/pull/1381))
734
- Fix provider crash with `elasticstack_kibana_action_connector` when `config` or `secrets` was unset in 0.11.17 ([#1355](https://github.com/elastic/terraform-provider-elasticstack/pull/1355))
835
- Added `labels` field to `elasticstack_kibana_synthetics_monitor` resource for associating key-value pairs with monitors ([#1360](https://github.com/elastic/terraform-provider-elasticstack/pull/1360))
936
- Fixes provider crash with `elasticstack_kibana_slo` when using `kql_custom_indicator` with no `filter` set. ([#1354](https://github.com/elastic/terraform-provider-elasticstack/pull/1354))
@@ -507,8 +534,10 @@ resource "elasticstack_fleet_output" "output" {
507534
- Initial set of docs
508535
- CI integration
509536
510-
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.0...HEAD
511-
[0.11.18]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.18...v0.12.0
537+
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.1...HEAD
538+
[0.12.1]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.0...v0.12.1
539+
[0.12.0]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.18...v0.12.0
540+
[0.11.19]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.18...v0.11.19
512541
[0.11.18]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.17...v0.11.18
513542
[0.11.17]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.16...v0.11.17
514543
[0.11.16]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.15...v0.11.16

0 commit comments

Comments
 (0)