Skip to content

Commit 6b34f12

Browse files
tobiodimuon
andauthored
Add APM agent configuration (#1196)
* Add agent configuration operations to generated client * Add agent configuration resource * Add windsurf rules * make docs-generate * Patch delete agent policy spec * Set Elastic API version * Changelog * Apply suggestions from code review Co-authored-by: Dmitry Onishchenko <[email protected]> * Update internal/apm/agent_configuration/read.go Co-authored-by: Dmitry Onishchenko <[email protected]> * PR feedback * Remove spec customisation The fix has been merged into Kibana/main --------- Co-authored-by: Dmitry Onishchenko <[email protected]>
1 parent 23ff177 commit 6b34f12

File tree

17 files changed

+1295
-0
lines changed

17 files changed

+1295
-0
lines changed

.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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
## [Unreleased]
22

3+
- Add `elasticstack_apm_agent_configuration` resource ([#1196](https://github.com/elastic/terraform-provider-elasticstack/pull/1196))
34
- Add support for `timeslice_metric_indicator` in `elasticstack_kibana_slo` ([#1195](https://github.com/elastic/terraform-provider-elasticstack/pull/1195))
45
- Add `elasticstack_elasticsearch_ingest_processor_reroute` data source ([#678](https://github.com/elastic/terraform-provider-elasticstack/issues/678))
56
- Add support for `supports_agentless` to `elasticstack_fleet_agent_policy` ([#1197](https://github.com/elastic/terraform-provider-elasticstack/pull/1197))
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+
```
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
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
provider "elasticstack" {
2+
elasticsearch {}
3+
}
4+
5+
resource "elasticstack_apm_agent_configuration" "test_config" {
6+
service_name = "my-service"
7+
service_environment = "production"
8+
agent_name = "go"
9+
settings = {
10+
"transaction_sample_rate" = "0.5"
11+
"capture_body" = "all"
12+
}
13+
}

0 commit comments

Comments
 (0)