Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .windsurf/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
* The project is a Terraform provider, written in Golang
* The provider manages Elastic Stack resources
* There is a mix of SDK, and plugin framework resources
* New resources should be written with the Terraform plugin framework
* Plugin framework resources should:
* Follow the example set in /internal/elasticsearch/security/system_user
* Be contained within their own module
* Have the main concepts split across their own files
* Include acceptance tests
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## [Unreleased]

- Add `elasticstack_apm_agent_configuration` resource ([#1196](https://github.com/elastic/terraform-provider-elasticstack/pull/1196))

## [0.11.16] - 2025-07-09

- Add `headers` for the provider connection ([#1057](https://github.com/elastic/terraform-provider-elasticstack/pull/1057))
Expand Down
54 changes: 54 additions & 0 deletions docs/resources/apm_agent_configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
subcategory: "Kibana"
layout: ""
page_title: "Elasticstack: elasticstack_apm_agent_configuration Resource"
description: |-
Creates or updates an APM agent configuration
---

# Resource: elasticstack_apm_agent_configuration

Creates or updates an APM agent configuration. See https://www.elastic.co/docs/solutions/observability/apm/apm-agent-central-configuration

## Example Usage

```terraform
provider "elasticstack" {
elasticsearch {}
}

resource "elasticstack_apm_agent_configuration" "test_config" {
service_name = "my-service"
service_environment = "production"
agent_name = "go"
settings = {
"transaction_sample_rate" = "0.5"
"capture_body" = "all"
}
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `service_name` (String) The name of the service.
- `settings` (Map of String) Agent configuration settings.

### Optional

- `agent_name` (String) The agent name is used by the UI to determine which settings to display.
- `service_environment` (String) The environment of the service.

### Read-Only

- `id` (String) Internal identifier of the resource.

## Import

Import is supported using the following syntax:

```shell
terraform import elasticstack_apm_agent_configuration.test_configuration my-service:production
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import elasticstack_apm_agent_configuration.test_configuration my-service:production
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
provider "elasticstack" {
elasticsearch {}
}

resource "elasticstack_apm_agent_configuration" "test_config" {
service_name = "my-service"
service_environment = "production"
agent_name = "go"
settings = {
"transaction_sample_rate" = "0.5"
"capture_body" = "all"
}
}
Loading
Loading