Skip to content

Commit dd927a9

Browse files
committed
Merge remote-tracking branch 'origin/main' into copilot/add-default-data-view-resource
* origin/main: (32 commits) chore(deps): update kibana-openapi-spec digest to c99d51c (#1487) [Feature] Introduce elasticsearch alias resource with atomic write index management and nested attributes (#1343) Support setting solution for 8.16+ on Cloud (#1486) Refactor all Kibana connector acceptance tests to use ConfigDirectory pattern (#1484) Support .bedrock and .gen-ai connectors (#1467) Bump golang.org/x/crypto from 0.41.0 to 0.45.0 in /libs/go-kibana-rest (#1481) Bump golang.org/x/crypto from 0.42.0 to 0.45.0 (#1480) fix(deps): update module github.com/go-resty/resty/v2 to v2.17.0 (#1478) chore(deps): update kibana-openapi-spec digest to f1d0789 (#1479) chore(deps): update kibana-openapi-spec digest to 5841714 (#1477) chore(deps): update golang:1.25.4 docker digest to 6981837 (#1476) chore(deps): update kibana-openapi-spec digest to 67de5ef (#1475) chore(deps): update golangci/golangci-lint-action digest to e7fa5ac (#1474) chore(deps): update kibana-openapi-spec digest to b4553b6 (#1472) chore(deps): update actions/checkout action to v6 (#1470) Support publishing experimental resources/datasources within the framework provider (#1464) chore(deps): update actions/setup-go digest to 4dc6199 (#1466) fix(deps): update module github.com/elastic/elastic-transport-go/v8 to v8.8.0 (#1459) Prepare 0.12.2 Release (#1458) Support spaces for detection rules (#1457) ...
2 parents 87a2736 + 863d7cf commit dd927a9

File tree

94 files changed

+10456
-3140
lines changed

Some content is hidden

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

94 files changed

+10456
-3140
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.4@sha256:e68f6a00e88586577fafa4d9cefad1349c2be70d21244321321c407474ff9bf2"
4+
image: "golang:1.25.4@sha256:698183780de28062f4ef46f82a79ec0ae69d2d22f7b160cf69f71ea8d98bf25d"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
contents: read
2424

2525
steps:
26-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
27-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
26+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
27+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
2828
with:
2929
go-version-file: 'go.mod'
3030
cache: true

.github/workflows/test.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ jobs:
1818
runs-on: ubuntu-latest
1919
timeout-minutes: 5
2020
steps:
21-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
22-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
21+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
22+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
2323
with:
2424
go-version-file: 'go.mod'
2525
cache: true
@@ -34,8 +34,8 @@ jobs:
3434
name: Lint
3535
runs-on: ubuntu-latest
3636
steps:
37-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
38-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
37+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
38+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
3939
with:
4040
go-version-file: 'go.mod'
4141
cache: true
@@ -139,8 +139,8 @@ jobs:
139139
- version: '8.4.3'
140140
runner: ubuntu-22.04
141141
steps:
142-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
143-
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6
142+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6
143+
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
144144
with:
145145
go-version-file: 'go.mod'
146146
cache: true

CHANGELOG.md

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

3+
### Breaking changes
4+
5+
#### `elasticstack_elasticsearch_index.alias` block has changed to a set attribute.
6+
7+
The `alias` block in the `elasticstack_elasticsearch_index` resource has been moved to an attribute.
8+
This transition provides better support for future changes in both the provider and the underlying Terraform framework.
9+
10+
Existing usage of the `alias` block must be migrated to the attribute syntax. For example:
11+
12+
```hcl
13+
alias {
14+
name = "my_alias_1"
15+
}
16+
17+
alias {
18+
name = "my_alias_2"
19+
filter = jsonencode({
20+
term = { "user.id" = "developer" }
21+
})
22+
}
23+
```
24+
25+
becomes
26+
27+
```hcl
28+
alias = [
29+
{
30+
name = "my_alias_1"
31+
},
32+
{
33+
name = "my_alias_2"
34+
filter = jsonencode({
35+
term = { "user.id" = "developer" }
36+
})
37+
}
38+
]
39+
```
40+
41+
### Changes
42+
43+
- Support `.bedrock` and `.gen-ai` connectors ([#1467](https://github.com/elastic/terraform-provider-elasticstack/pull/1467))
44+
- Support the `solution` attribute in `elasticstack_kibana_space` from 8.16 ([#1486](https://github.com/elastic/terraform-provider-elasticstack/pull/1486))
45+
- Add `elasticstack_elasticsearch_alias` resource ([#1343](https://github.com/elastic/terraform-provider-elasticstack/pull/1343))
46+
47+
## [0.12.2] - 2025-11-19
348
- Fix `elasticstack_elasticsearch_snapshot_lifecycle` metadata type conversion causing terraform apply to fail ([#1409](https://github.com/elastic/terraform-provider-elasticstack/issues/1409))
449
- Add new `elasticstack_elasticsearch_ml_anomaly_detection_job` resource ([#1329](https://github.com/elastic/terraform-provider-elasticstack/pull/1329))
550
- Add new `elasticstack_elasticsearch_ml_datafeed` resource ([#1340](https://github.com/elastic/terraform-provider-elasticstack/pull/1340))
651
- 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))
52+
- Add back missing import support for `elasticstack_elasticsearch_security_role_mapping` ([#1441](https://github.com/elastic/terraform-provider-elasticstack/pull/1441))
753
- Add new `elasticstack_elasticsearch_ml_job_state` resource ([#1337](https://github.com/elastic/terraform-provider-elasticstack/pull/1337))
854
- Add new `elasticstack_elasticsearch_ml_datafeed_state` resource ([#1422](https://github.com/elastic/terraform-provider-elasticstack/pull/1422))
55+
- Add `output_id` to `elasticstack_fleet_integration_policy` resource ([#1445](https://github.com/elastic/terraform-provider-elasticstack/pull/1445))
56+
- Make `hosts` attribute required in `elasticstack_fleet_output` resource ([#1450](https://github.com/elastic/terraform-provider-elasticstack/pull/1450/files))
57+
- Fix `elasticstack_kibana_security_detection_rule` to properly respect `space_id`
958

1059
## [0.12.1] - 2025-10-22
1160
- Fix regression restricting the characters in an `elasticstack_elasticsearch_role_mapping` `name`. ([#1373](https://github.com/elastic/terraform-provider-elasticstack/pull/1373))
@@ -534,7 +583,8 @@ resource "elasticstack_fleet_output" "output" {
534583
- Initial set of docs
535584
- CI integration
536585
537-
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.1...HEAD
586+
[Unreleased]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.2...HEAD
587+
[0.12.2]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.1...v0.12.2
538588
[0.12.1]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.12.0...v0.12.1
539589
[0.12.0]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.18...v0.12.0
540590
[0.11.19]: https://github.com/elastic/terraform-provider-elasticstack/compare/v0.11.18...v0.11.19

Makefile

Lines changed: 8 additions & 2 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.12.1
4+
VERSION ?= 0.12.2
55

66
NAME = elasticstack
77
BINARY = terraform-provider-${NAME}
@@ -46,6 +46,12 @@ build-ci: ## build the terraform provider
4646
.PHONY: build
4747
build: lint build-ci ## build the terraform provider
4848

49+
# run acceptance tests against the docker container that has been started with `make docker-kibana` (or `make docker-elasticsearch`)
50+
# To run specific test (e.g. TestAccResourceActionConnector) execute `make testacc-vs-docker TESTARGS='-run ^TestAccResourceKibanaConnectorBedrock$$'`
51+
.PHONY: testacc-vs-docker
52+
testacc-vs-docker:
53+
@ ELASTICSEARCH_ENDPOINTS=http://localhost:9200 KIBANA_ENDPOINT=http://localhost:5601 ELASTICSEARCH_USERNAME=$(ELASTICSEARCH_USERNAME) ELASTICSEARCH_PASSWORD=$(ELASTICSEARCH_PASSWORD) make testacc
54+
4955
.PHONY: testacc
5056
testacc: ## Run acceptance tests
5157
TF_ACC=1 go tool gotestsum --format testname --rerun-fails=3 --packages="-v ./..." -- -count $(ACCTEST_COUNT) -parallel $(ACCTEST_PARALLELISM) $(TESTARGS) -timeout $(ACCTEST_TIMEOUT)
@@ -130,7 +136,7 @@ install: build ## Install built provider into the local terraform cache
130136

131137
.PHONY: tools
132138
tools: $(GOBIN) ## Download golangci-lint locally if necessary.
133-
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.6.1
139+
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.6.2
134140

135141
.PHONY: golangci-lint
136142
golangci-lint:

docs/resources/elasticsearch_index.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ provider "elasticstack" {
2020
resource "elasticstack_elasticsearch_index" "my_index" {
2121
name = "my-index"
2222
23-
alias {
23+
alias = [{
2424
name = "my_alias_1"
25-
}
26-
27-
alias {
25+
}, {
2826
name = "my_alias_2"
2927
filter = jsonencode({
3028
term = { "user.id" = "developer" }
3129
})
32-
}
30+
}]
3331
3432
mappings = jsonencode({
3533
properties = {
@@ -59,7 +57,7 @@ resource "elasticstack_elasticsearch_index" "my_index" {
5957

6058
### Optional
6159

62-
- `alias` (Block Set) Aliases for the index. (see [below for nested schema](#nestedblock--alias))
60+
- `alias` (Attributes Set) Aliases for the index. (see [below for nested schema](#nestedatt--alias))
6361
- `analysis_analyzer` (String) A JSON string describing the analyzers applied to the index.
6462
- `analysis_char_filter` (String) A JSON string describing the char_filters applied to the index.
6563
- `analysis_filter` (String) A JSON string describing the filters applied to the index.
@@ -135,7 +133,7 @@ resource "elasticstack_elasticsearch_index" "my_index" {
135133
- `id` (String) Internal identifier of the resource
136134
- `settings_raw` (String) All raw settings fetched from the cluster.
137135

138-
<a id="nestedblock--alias"></a>
136+
<a id="nestedatt--alias"></a>
139137
### Nested Schema for `alias`
140138

141139
Required:
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
---
2+
# generated by https://github.com/hashicorp/terraform-plugin-docs
3+
page_title: "elasticstack_elasticsearch_index_alias Resource - terraform-provider-elasticstack"
4+
subcategory: "Index"
5+
description: |-
6+
Manages an Elasticsearch alias. See the alias documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html for more details.
7+
---
8+
9+
# elasticstack_elasticsearch_index_alias (Resource)
10+
11+
Manages an Elasticsearch alias. See the [alias documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) for more details.
12+
13+
14+
15+
<!-- schema generated by tfplugindocs -->
16+
## Schema
17+
18+
### Required
19+
20+
- `name` (String) The alias name.
21+
22+
### Optional
23+
24+
- `read_indices` (Attributes Set) Set of read indices for the alias. (see [below for nested schema](#nestedatt--read_indices))
25+
- `write_index` (Attributes) The write index for the alias. Only one write index is allowed per alias. (see [below for nested schema](#nestedatt--write_index))
26+
27+
### Read-Only
28+
29+
- `id` (String) Generated ID of the alias resource.
30+
31+
<a id="nestedatt--read_indices"></a>
32+
### Nested Schema for `read_indices`
33+
34+
Required:
35+
36+
- `name` (String) Name of the read index.
37+
38+
Optional:
39+
40+
- `filter` (String) Query used to limit documents the alias can access.
41+
- `index_routing` (String) Value used to route indexing operations to a specific shard.
42+
- `is_hidden` (Boolean) If true, the alias is hidden.
43+
- `routing` (String) Value used to route indexing and search operations to a specific shard.
44+
- `search_routing` (String) Value used to route search operations to a specific shard.
45+
46+
47+
<a id="nestedatt--write_index"></a>
48+
### Nested Schema for `write_index`
49+
50+
Required:
51+
52+
- `name` (String) Name of the write index.
53+
54+
Optional:
55+
56+
- `filter` (String) Query used to limit documents the alias can access.
57+
- `index_routing` (String) Value used to route indexing operations to a specific shard.
58+
- `is_hidden` (Boolean) If true, the alias is hidden.
59+
- `routing` (String) Value used to route indexing and search operations to a specific shard.
60+
- `search_routing` (String) Value used to route search operations to a specific shard.

docs/resources/fleet_integration_policy.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ resource "elasticstack_fleet_integration_policy" "sample" {
6363
agent_policy_id = elasticstack_fleet_agent_policy.sample.policy_id
6464
integration_name = elasticstack_fleet_integration.sample.name
6565
integration_version = elasticstack_fleet_integration.sample.version
66+
// Optional: specify a custom output to send data to
67+
// output_id = "my-custom-output-id"
6668
6769
input {
6870
input_id = "tcp-tcp"
@@ -102,6 +104,7 @@ resource "elasticstack_fleet_integration_policy" "sample" {
102104
- `enabled` (Boolean) Enable the integration policy.
103105
- `force` (Boolean) Force operations, such as creation and deletion, to occur.
104106
- `input` (Block List) Integration inputs. (see [below for nested schema](#nestedblock--input))
107+
- `output_id` (String) The ID of the output to send data to. When not specified, the default output of the agent policy will be used.
105108
- `policy_id` (String) Unique identifier of the integration policy.
106109
- `space_ids` (Set of String) The Kibana space IDs where this integration policy is available. When set, must match the space_ids of the referenced agent policy. If not set, will be inherited from the agent policy. Note: The order of space IDs does not matter as this is a set.
107110
- `vars_json` (String, Sensitive) Integration-level variables as JSON.

docs/resources/fleet_output.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ resource "elasticstack_fleet_output" "kafka_round_robin" {
200200

201201
### Required
202202

203+
- `hosts` (List of String) A list of hosts.
203204
- `name` (String) The name of the output.
204205
- `type` (String) The output type.
205206

@@ -210,7 +211,6 @@ resource "elasticstack_fleet_output" "kafka_round_robin" {
210211
- `config_yaml` (String, Sensitive) Advanced YAML configuration. YAML settings here will be added to the output section of each agent policy.
211212
- `default_integrations` (Boolean) Make this output the default for agent integrations.
212213
- `default_monitoring` (Boolean) Make this output the default for agent monitoring.
213-
- `hosts` (List of String) A list of hosts.
214214
- `kafka` (Attributes) Kafka-specific configuration. (see [below for nested schema](#nestedatt--kafka))
215215
- `output_id` (String) Unique identifier of the output.
216216
- `space_ids` (Set of String) The Kibana space IDs where this output is available. When set, the output will be created and managed within the specified space. Note: The order of space IDs does not matter as this is a set.

docs/resources/kibana_action_connector.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,44 @@ resource "elasticstack_kibana_action_connector" "slack-api-connector" {
5252
token = "<your-token>"
5353
})
5454
}
55+
56+
resource "elasticstack_kibana_action_connector" "bedrock-connector" {
57+
name = "aws-bedrock"
58+
connector_type_id = ".bedrock"
59+
config = jsonencode({
60+
apiUrl = "https://bedrock-runtime.us-east-1.amazonaws.com"
61+
defaultModel = "anthropic.claude-v2"
62+
})
63+
secrets = jsonencode({
64+
accessKey = "<your-aws-access-key>"
65+
secret = "<your-aws-secret-key>"
66+
})
67+
}
68+
69+
resource "elasticstack_kibana_action_connector" "genai-openai-connector" {
70+
name = "openai"
71+
connector_type_id = ".gen-ai"
72+
config = jsonencode({
73+
apiProvider = "OpenAI"
74+
apiUrl = "https://api.openai.com/v1"
75+
defaultModel = "gpt-4"
76+
})
77+
secrets = jsonencode({
78+
apiKey = "<your-openai-api-key>"
79+
})
80+
}
81+
82+
resource "elasticstack_kibana_action_connector" "genai-azure-connector" {
83+
name = "azure-openai"
84+
connector_type_id = ".gen-ai"
85+
config = jsonencode({
86+
apiProvider = "Azure OpenAI"
87+
apiUrl = "https://my-resource.openai.azure.com/openai/deployments/my-deployment"
88+
})
89+
secrets = jsonencode({
90+
apiKey = "<your-azure-api-key>"
91+
})
92+
}
5593
```
5694

5795
<!-- schema generated by tfplugindocs -->

0 commit comments

Comments
 (0)