Skip to content

Commit 49f7c89

Browse files
committed
Merge remote-tracking branch 'origin/main' into ml-df
* origin/main: (43 commits) chore(deps): update golang:1.25.3 docker digest to bce1e7e (#1382) Clean before regenerating the client Clean before regenerating the client Use a working API spec chore(deps): update kibana-openapi-spec digest to 9b8ef82 (#1377) Include the generated client in the post upgrade task Reliably run acceptance tests in Kibana client buildkite pipeline (#1378) Test older runner (#1380) Fixup file match chore(deps): update golang docker tag to v1.25.3 (#1369) Add post upgrade tasks for Kibana client Allow free text for Elasticsearch role mapping names (#1373) Use an image with Golang and Terraform Run acceptance tests Remove postUpgradeTasks from renovate chore(deps): pin docker.elastic.co/ci-agent-images/mis-terraform docker tag to 2fae26c (#1371) Synthetics tidy (#1370) Use terraform build image Bump agent resources Don't trigger on PR ...
2 parents 7991ad0 + d55ffb1 commit 49f7c89

File tree

173 files changed

+29321
-2335
lines changed

Some content is hidden

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

173 files changed

+29321
-2335
lines changed

.buildkite/hooks/pre-command

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
set -euo pipefail
44

5+
if [[ "${BUILDKITE_PIPELINE_SLUG}" != "terraform-provider-elasticstack-release" ]]; then
6+
echo "Skipping pre-command hook for non-release pipeline"
7+
exit 0
8+
fi
9+
510
RELEASE_VAULT_PATH=kv/ci-shared/terraform-providers
611

712
if [[ "$BUILDKITE_PIPELINE_SLUG" == "terraform-provider-elasticstack-release" ]]; then

.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.1@sha256:8305f5fa8ea63c7b5bc85bd223ccc62941f852318ebfbd22f53bbd0b358c07e1"
4+
image: "golang:1.25.3@sha256:bce1e7ec780444d85d041889e7a0e542b0be7b272a7f46a5fb947f0f484b9736"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
source /etc/profile.d/go.sh
6+
7+
echo "--- Regenerating the Kibana client"
8+
make -C generated/kbapi all
9+
10+
echo "--- Building the provider"
11+
make build
12+
13+
echo "--- Starting Stack containers"
14+
make docker-fleet
15+
docker ps
16+
sleep 30
17+
18+
echo "--- Collecting docker info"
19+
docker ps
20+
docker logs terraform-elasticstack-kb 2>&1 > kibana.log
21+
docker logs terraform-elasticstack-es 2>&1 > es.log
22+
docker logs terraform-elasticstack-fleet 2>&1 > fleet.log
23+
24+
buildkite-agent artifact upload kibana.log
25+
buildkite-agent artifact upload es.log
26+
buildkite-agent artifact upload fleet.log
27+
28+
echo "--- Running acceptance tests"
29+
ELASTICSEARCH_ENDPOINTS=http://localhost:9200 KIBANA_ENDPOINT=http://localhost:5601 ELASTICSEARCH_USERNAME=elastic ELASTICSEARCH_PASSWORD=password make testacc
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
agents:
2+
provider: "gcp"
3+
machineType: "n1-standard-4"
4+
image: family/terraform-provider-elasticstack-ubuntu-2204
5+
steps:
6+
- label: Regenerate Kibana client and build provider
7+
command:
8+
- ".buildkite/scripts/update-kibana-client.sh"

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
test:
5151
name: Matrix Acceptance Test
5252
needs: build
53-
runs-on: ubuntu-latest
53+
runs-on: ${{ matrix.runner == 'ubuntu-22.04' && 'ubuntu-22.04' || 'ubuntu-latest' }}
5454
env:
5555
ELASTIC_PASSWORD: password
5656
KIBANA_SYSTEM_USERNAME: kibana_system
@@ -108,11 +108,6 @@ jobs:
108108
matrix:
109109
version:
110110
- '7.17.13'
111-
- '8.0.1'
112-
- '8.1.3'
113-
- '8.2.3'
114-
- '8.3.3'
115-
- '8.4.3'
116111
- '8.5.3'
117112
- '8.6.2'
118113
- '8.7.1'
@@ -130,6 +125,17 @@ jobs:
130125
- '8.19.3'
131126
- '9.0.7'
132127
- '9.1.3'
128+
include:
129+
- version: '8.0.1'
130+
runner: ubuntu-22.04
131+
- version: '8.1.3'
132+
runner: ubuntu-22.04
133+
- version: '8.2.3'
134+
runner: ubuntu-22.04
135+
- version: '8.3.3'
136+
runner: ubuntu-22.04
137+
- version: '8.4.3'
138+
runner: ubuntu-22.04
133139
steps:
134140
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
135141
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6

CHANGELOG.md

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
## [Unreleased]
22

3+
- Fix regression restricting the characters in an `elasticstack_elasticsearch_role_mapping` `name`. ([#1373](https://github.com/elastic/terraform-provider-elasticstack/pull/1373))
4+
5+
## [0.12.0] - 2025-10-15
6+
7+
- 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))
8+
- 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))
9+
- 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))
10+
- Updates for Security Detection Rules ([#1361](https://github.com/elastic/terraform-provider-elasticstack/pull/1361)
11+
- Add support for `threat` property
12+
- Gracefully support `query` property not being set
13+
- Add esql specific validations to reject unsupported fields `index` and `filters`
14+
- Gracefully handle response action with no provided `frequency`
15+
- Add validation for required `anomaly_threshold` field in anomaly detection rules
16+
- Add support for `timeline_id` / `timeline_title` fields
17+
- Gracefully handle `threat_query` not being provided for `threat_match` ule
18+
19+
## [0.11.18] - 2025-10-10
20+
21+
### Breaking changes
22+
23+
The `ssl` field on the `elasticstack_fleet_output` resource has been changes from a block to an attribute. This change ensures ongoing consistency within the resource schema for this resource, and aligns with Terraform best practices.
24+
25+
Existing `elasticstack_fleet_output` resources defining `ssl` will have to update the declaration to an attribute style. For example:
26+
27+
```hcl
28+
resource "elasticstack_fleet_output" "output" {
29+
...
30+
ssl {
31+
...
32+
}
33+
}
34+
```
35+
36+
becomes
37+
38+
```hcl
39+
resource "elasticstack_fleet_output" "output" {
40+
...
41+
ssl = { # Note the equals sign here.
42+
...
43+
}
44+
}
45+
```
46+
47+
### Changes
48+
49+
- Create `elasticstack_kibana_security_detection_rule` resource. ([#1290](https://github.com/elastic/terraform-provider-elasticstack/pull/1290))
50+
- Add `elasticstack_kibana_export_saved_objects` data source ([#1293](https://github.com/elastic/terraform-provider-elasticstack/pull/1293))
351
- Create `elasticstack_kibana_maintenance_window` resource. ([#1224](https://github.com/elastic/terraform-provider-elasticstack/pull/1224))
452
- Add support for `solution` field in `elasticstack_kibana_space` resource and data source ([#1102](https://github.com/elastic/terraform-provider-elasticstack/issues/1102))
553
- Add `slo_id` validation to `elasticstack_kibana_slo` ([#1221](https://github.com/elastic/terraform-provider-elasticstack/pull/1221))
@@ -21,6 +69,7 @@
2169
- Add support for `unenrollment_timeout` in `elasticstack_fleet_agent_policy` ([#1169](https://github.com/elastic/terraform-provider-elasticstack/issues/1169))
2270
- Handle default value for `allow_restricted_indices` in `elasticstack_elasticsearch_security_api_key` ([#1315](https://github.com/elastic/terraform-provider-elasticstack/pull/1315))
2371
- Fixed `nil` reference in kibana synthetics API client in case of response errors ([#1320](https://github.com/elastic/terraform-provider-elasticstack/pull/1320))
72+
- Add support for `agent_policy_ids` in `elasticstack_fleet_integration_policy` ([#1131](https://github.com/elastic/terraform-provider-elasticstack/pull/1311))
2473

2574
## [0.11.17] - 2025-07-21
2675

@@ -458,7 +507,9 @@
458507
- Initial set of docs
459508
- CI integration
460509
461-
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.17...HEAD
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
512+
[0.11.18]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.17...v0.11.18
462513
[0.11.17]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.16...v0.11.17
463514
[0.11.16]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.15...v0.11.16
464515
[0.11.15]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.14...v0.11.15

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.DEFAULT_GOAL = help
22
SHELL := /bin/bash
33

4-
VERSION ?= 0.11.17
4+
VERSION ?= 0.12.0
55

66
NAME = elasticstack
77
BINARY = terraform-provider-${NAME}
@@ -54,7 +54,7 @@ build: lint build-ci ## build the terraform provider
5454

5555
.PHONY: testacc
5656
testacc: ## Run acceptance tests
57-
TF_ACC=1 go test -v ./... -count $(ACCTEST_COUNT) -parallel $(ACCTEST_PARALLELISM) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT)
57+
TF_ACC=1 go tool gotestsum --format testname --rerun-fails=3 --packages="-v ./..." -- -count $(ACCTEST_COUNT) -parallel $(ACCTEST_PARALLELISM) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT)
5858

5959
.PHONY: test
6060
test: ## Run unit tests
@@ -245,7 +245,7 @@ install: build ## Install built provider into the local terraform cache
245245

246246
.PHONY: tools
247247
tools: $(GOBIN) ## Download golangci-lint locally if necessary.
248-
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.4.0
248+
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.5.0
249249

250250
.PHONY: golangci-lint
251251
golangci-lint:

catalog-info.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,42 @@ spec:
3535
access_level: MANAGE_BUILD_AND_READ
3636
everyone:
3737
access_level: READ_ONLY
38+
39+
---
40+
# yaml-language-server: $schema=https://gist.githubusercontent.com/elasticmachine/988b80dae436cafea07d9a4a460a011d/raw/e57ee3bed7a6f73077a3f55a38e76e40ec87a7cf/rre.schema.json
41+
apiVersion: backstage.io/v1alpha1
42+
kind: Resource
43+
metadata:
44+
name: buildkite-pipeline-tf-provider-elasticstack-update-kibana
45+
description: Buildkite Pipeline for updating Kibana client in Terraform provider Elasticstack
46+
links:
47+
- title: Pipeline
48+
url: https://buildkite.com/elastic/terraform-provider-elasticstack-update-kibana-client
49+
50+
spec:
51+
type: buildkite-pipeline
52+
owner: group:control-plane-hosted-applications
53+
system: buildkite
54+
implementation:
55+
apiVersion: buildkite.elastic.dev/v1
56+
kind: Pipeline
57+
metadata:
58+
name: terraform-provider-elasticstack / Update Kibana client
59+
description: Terraform provider Elasticstack - update Kibana client
60+
spec:
61+
repository: elastic/terraform-provider-elasticstack
62+
pipeline_file: ".buildkite/update-kibana-client.yml"
63+
provider_settings:
64+
build_branches: false
65+
build_pull_requests: false
66+
build_pull_request_labels_changed: false
67+
build_pull_request_ready_for_review: false
68+
build_pull_request_forks: false
69+
build_tags: false
70+
teams:
71+
control-plane-hosted-applications:
72+
access_level: MANAGE_BUILD_AND_READ
73+
serverless-core:
74+
access_level: MANAGE_BUILD_AND_READ
75+
everyone:
76+
access_level: READ_ONLY

docs/data-sources/elasticsearch_enrich_policy.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
# generated by https://github.com/hashicorp/terraform-plugin-docs
43
page_title: "elasticstack_elasticsearch_enrich_policy Data Source - terraform-provider-elasticstack"

docs/data-sources/elasticsearch_index_template.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
---
32
# generated by https://github.com/hashicorp/terraform-plugin-docs
43
page_title: "elasticstack_elasticsearch_index_template Data Source - terraform-provider-elasticstack"

0 commit comments

Comments
 (0)