Skip to content

Add APM agent configuration #1196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## [Unreleased]

- Add `elasticstack_apm_agent_configuration` resource ([#1196](https://github.com/elastic/terraform-provider-elasticstack/pull/1196))
- Add support for `timeslice_metric_indicator` in `elasticstack_kibana_slo` ([#1195](https://github.com/elastic/terraform-provider-elasticstack/pull/1195))
- Add `elasticstack_elasticsearch_ingest_processor_reroute` data source ([#678](https://github.com/elastic/terraform-provider-elasticstack/issues/678))
- Add support for `supports_agentless` to `elasticstack_fleet_agent_policy` ([#1197](https://github.com/elastic/terraform-provider-elasticstack/pull/1197))
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