Skip to content

Commit 7df4807

Browse files
committed
Merge remote-tracking branch 'upstream/main' into prepare-0.11.17
2 parents 7df5445 + 235ca2f commit 7df4807

File tree

42 files changed

+2011
-38
lines changed

Some content is hidden

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

42 files changed

+2011
-38
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.24.4@sha256:20a022e5112a144aa7b7aeb3f22ebf2cdaefcc4aac0d64e8deeee8cdc18b9c0f"
4+
image: "golang:1.24.5@sha256:14fd8a55e59a560704e5fc44970b301d00d344e45d6b914dda228e09f359a088"
55
cpu: "16"
66
memory: "24G"
77
ephemeralStorage: "20G"
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: "Copilot Setup Steps"
2+
3+
# Automatically run the setup steps when they are changed to allow for easy validation, and
4+
# allow manual testing through the repository's "Actions" tab
5+
on:
6+
workflow_dispatch:
7+
push:
8+
paths:
9+
- .github/workflows/copilot-setup-steps.yml
10+
pull_request:
11+
paths:
12+
- .github/workflows/copilot-setup-steps.yml
13+
14+
jobs:
15+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16+
copilot-setup-steps:
17+
runs-on: ubuntu-latest
18+
19+
# Set the permissions to the lowest permissions possible needed for your steps.
20+
# Copilot will be given its own token for its operations.
21+
permissions:
22+
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
23+
contents: read
24+
env:
25+
ELASTICSEARCH_ENDPOINTS: "http://localhost:9200"
26+
ELASTICSEARCH_USERNAME: "elastic"
27+
ELASTICSEARCH_PASSWORD: password
28+
KIBANA_ENDPOINT: "http://localhost:5601"
29+
KIBANA_USERNAME: "elastic"
30+
KIBANA_PASSWORD: password
31+
KIBANA_SYSTEM_USERNAME: kibana_system
32+
KIBANA_SYSTEM_PASSWORD: password
33+
TF_ACC: "1"
34+
services:
35+
elasticsearch:
36+
image: docker.elastic.co/elasticsearch/elasticsearch:9.0.3
37+
env:
38+
discovery.type: single-node
39+
xpack.security.enabled: true
40+
xpack.security.authc.api_key.enabled: true
41+
xpack.security.authc.token.enabled: true
42+
xpack.watcher.enabled: true
43+
xpack.license.self_generated.type: trial
44+
repositories.url.allowed_urls: https://example.com/*
45+
path.repo: /tmp
46+
ELASTIC_PASSWORD: ${{ env.ELASTICSEARCH_PASSWORD }}
47+
ports:
48+
- 9200:9200
49+
options: --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
50+
kibana:
51+
image: docker.elastic.co/kibana/kibana:9.0.3
52+
env:
53+
SERVER_NAME: kibana
54+
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
55+
ELASTICSEARCH_USERNAME: ${{ env.KIBANA_SYSTEM_USERNAME }}
56+
ELASTICSEARCH_PASSWORD: ${{ env.KIBANA_SYSTEM_PASSWORD }}
57+
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: a7a6311933d3503b89bc2dbc36572c33a6c10925682e591bffcab6911c06786d
58+
# LOGGING_ROOT_LEVEL: debug
59+
ports:
60+
- 5601:5601
61+
options: --health-cmd="curl http://localhost:5601/api/status" --health-interval=10s --health-timeout=5s --health-retries=10
62+
fleet:
63+
image: docker.elastic.co/elastic-agent/elastic-agent:9.0.3
64+
env:
65+
SERVER_NAME: fleet
66+
FLEET_ENROLL: "1"
67+
FLEET_URL: https://fleet:8220
68+
FLEET_INSECURE: "true"
69+
FLEET_SERVER_ENABLE: "1"
70+
FLEET_SERVER_POLICY_ID: fleet-server
71+
FLEET_SERVER_ELASTICSEARCH_HOST: http://elasticsearch:9200
72+
FLEET_SERVER_ELASTICSEARCH_INSECURE: "true"
73+
FLEET_SERVER_INSECURE_HTTP: "true"
74+
KIBANA_HOST: http://kibana:5601
75+
KIBANA_FLEET_SETUP: "1"
76+
KIBANA_FLEET_PASSWORD: ${{ env.ELASTICSEARCH_PASSWORD }}
77+
ports:
78+
- 8220:8220
79+
options: --restart="unless-stopped"
80+
81+
steps:
82+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
83+
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
84+
with:
85+
go-version-file: 'go.mod'
86+
cache: true
87+
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3
88+
with:
89+
terraform_wrapper: false
90+
91+
- name: Get dependencies
92+
run: make setup
93+
94+
- name: Setup Kibana user
95+
run: make set-kibana-password
96+
env:
97+
ELASTICSEARCH_PASSWORD: ${{ env.ELASTICSEARCH_PASSWORD }}
98+
KIBANA_SYSTEM_USERNAME: ${{ env.KIBANA_SYSTEM_USERNAME }}
99+
KIBANA_SYSTEM_PASSWORD: ${{ env.KIBANA_SYSTEM_PASSWORD }}
100+
101+
- id: get-api-key
102+
name: Get ES API key
103+
run: |-
104+
echo "apikey=$(make create-es-api-key | jq -r .encoded)" >> "$GITHUB_OUTPUT"
105+
env:
106+
ELASTICSEARCH_PASSWORD: ${{ env.ELASTICSEARCH_PASSWORD }}
107+
108+
- id: setup-fleet
109+
name: Setup Fleet
110+
run: |-
111+
make setup-kibana-fleet
112+
env:
113+
ELASTICSEARCH_PASSWORD: ${{ env.ELASTICSEARCH_PASSWORD }}
114+
FLEET_NAME: "fleet"

.windsurf/rules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
* The project is a Terraform provider, written in Golang
2+
* The provider manages Elastic Stack resources
3+
* There is a mix of SDK, and plugin framework resources
4+
* New resources should be written with the Terraform plugin framework
5+
* Plugin framework resources should:
6+
* Follow the example set in /internal/elasticsearch/security/system_user
7+
* Be contained within their own module
8+
* Have the main concepts split across their own files
9+
* Include acceptance tests

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
## [Unreleased]
22

3+
<<<<<<< HEAD
34
## [0.11.17] - 2025-07-14
45

6+
=======
7+
- Add `elasticstack_apm_agent_configuration` resource ([#1196](https://github.com/elastic/terraform-provider-elasticstack/pull/1196))
8+
>>>>>>> upstream/main
59
- Add support for `timeslice_metric_indicator` in `elasticstack_kibana_slo` ([#1195](https://github.com/elastic/terraform-provider-elasticstack/pull/1195))
10+
- Add `elasticstack_elasticsearch_ingest_processor_reroute` data source ([#678](https://github.com/elastic/terraform-provider-elasticstack/issues/678))
11+
- Add support for `supports_agentless` to `elasticstack_fleet_agent_policy` ([#1197](https://github.com/elastic/terraform-provider-elasticstack/pull/1197))
12+
- Ignore `master_timeout` when targeting Serverless projects ([#1207](https://github.com/elastic/terraform-provider-elasticstack/pull/1207))
613

714
## [0.11.16] - 2025-07-09
815

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ install: build ## Install built provider into the local terraform cache
246246

247247
.PHONY: tools
248248
tools: $(GOBIN) ## Download golangci-lint locally if necessary.
249-
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.2.1
249+
@[[ -f $(GOBIN)/golangci-lint ]] || curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) v2.2.2
250250

251251
.PHONY: golangci-lint
252252
golangci-lint:
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
subcategory: "Ingest"
3+
layout: ""
4+
page_title: "Elasticstack: elasticstack_elasticsearch_ingest_processor_reroute Data Source"
5+
description: |-
6+
Helper data source to create a processor which reroutes a document to a different data stream, index, or index alias.
7+
---
8+
9+
# Data Source: elasticstack_elasticsearch_ingest_processor_reroute
10+
11+
Reroutes a document to a different data stream, index, or index alias. This processor is useful for routing documents based on data stream routing rules.
12+
13+
See: https://www.elastic.co/guide/en/elasticsearch/reference/current/reroute-processor.html
14+
15+
16+
## Example Usage
17+
18+
```terraform
19+
provider "elasticstack" {
20+
elasticsearch {}
21+
}
22+
23+
data "elasticstack_elasticsearch_ingest_processor_reroute" "reroute" {
24+
destination = "logs-generic-default"
25+
dataset = "generic"
26+
namespace = "default"
27+
}
28+
29+
resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
30+
name = "reroute-ingest"
31+
32+
processors = [
33+
data.elasticstack_elasticsearch_ingest_processor_reroute.reroute.json
34+
]
35+
}
36+
```
37+
38+
<!-- schema generated by tfplugindocs -->
39+
## Schema
40+
41+
### Optional
42+
43+
- `dataset` (String) The destination dataset to route the document to.
44+
- `description` (String) Description of the processor.
45+
- `destination` (String) The destination data stream, index, or index alias to route the document to.
46+
- `if` (String) Conditionally execute the processor
47+
- `ignore_failure` (Boolean) Ignore failures for the processor.
48+
- `namespace` (String) The destination namespace to route the document to.
49+
- `on_failure` (List of String) Handle failures for the processor.
50+
- `tag` (String) Identifier for the processor.
51+
52+
### Read-Only
53+
54+
- `id` (String) Internal identifier of the resource.
55+
- `json` (String) JSON representation of this data source.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
subcategory: "Kibana"
3+
layout: ""
4+
page_title: "Elasticstack: elasticstack_apm_agent_configuration Resource"
5+
description: |-
6+
Creates or updates an APM agent configuration
7+
---
8+
9+
# Resource: elasticstack_apm_agent_configuration
10+
11+
Creates or updates an APM agent configuration. See https://www.elastic.co/docs/solutions/observability/apm/apm-agent-central-configuration
12+
13+
## Example Usage
14+
15+
```terraform
16+
provider "elasticstack" {
17+
elasticsearch {}
18+
}
19+
20+
resource "elasticstack_apm_agent_configuration" "test_config" {
21+
service_name = "my-service"
22+
service_environment = "production"
23+
agent_name = "go"
24+
settings = {
25+
"transaction_sample_rate" = "0.5"
26+
"capture_body" = "all"
27+
}
28+
}
29+
```
30+
31+
<!-- schema generated by tfplugindocs -->
32+
## Schema
33+
34+
### Required
35+
36+
- `service_name` (String) The name of the service.
37+
- `settings` (Map of String) Agent configuration settings.
38+
39+
### Optional
40+
41+
- `agent_name` (String) The agent name is used by the UI to determine which settings to display.
42+
- `service_environment` (String) The environment of the service.
43+
44+
### Read-Only
45+
46+
- `id` (String) Internal identifier of the resource.
47+
48+
## Import
49+
50+
Import is supported using the following syntax:
51+
52+
```shell
53+
terraform import elasticstack_apm_agent_configuration.test_configuration my-service:production
54+
```

docs/resources/fleet_agent_policy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ resource "elasticstack_fleet_agent_policy" "test_policy" {
5656
- `monitoring_output_id` (String) The identifier for monitoring output.
5757
- `policy_id` (String) Unique identifier of the agent policy.
5858
- `skip_destroy` (Boolean) Set to true if you do not wish the agent policy to be deleted at destroy time, and instead just remove the agent policy from the Terraform state.
59+
- `supports_agentless` (Boolean) Set to true to enable agentless data collection.
5960
- `sys_monitoring` (Boolean) Enable collection of system logs and metrics.
6061

6162
### Read-Only
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
}
4+
5+
data "elasticstack_elasticsearch_ingest_processor_reroute" "reroute" {
6+
destination = "logs-generic-default"
7+
dataset = "generic"
8+
namespace = "default"
9+
}
10+
11+
resource "elasticstack_elasticsearch_ingest_pipeline" "my_ingest_pipeline" {
12+
name = "reroute-ingest"
13+
14+
processors = [
15+
data.elasticstack_elasticsearch_ingest_processor_reroute.reroute.json
16+
]
17+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
terraform import elasticstack_apm_agent_configuration.test_configuration my-service:production

0 commit comments

Comments
 (0)