Skip to content

Commit 0359a86

Browse files
committed
make docs-generate
1 parent 57eb439 commit 0359a86

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed
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 a 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+
}

internal/apm/agent_configuration/resource.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@ import (
44
"context"
55

66
"github.com/elastic/terraform-provider-elasticstack/internal/clients"
7+
"github.com/hashicorp/terraform-plugin-framework/path"
78
"github.com/hashicorp/terraform-plugin-framework/resource"
89
)
910

1011
// Ensure provider defined types fully satisfy framework interfaces.
1112
var _ resource.Resource = &resourceAgentConfiguration{}
13+
var _ resource.ResourceWithConfigure = &resourceAgentConfiguration{}
14+
var _ resource.ResourceWithImportState = &resourceAgentConfiguration{}
1215

1316
func NewAgentConfigurationResource() resource.Resource {
1417
return &resourceAgentConfiguration{}
@@ -27,3 +30,7 @@ func (r *resourceAgentConfiguration) Configure(ctx context.Context, req resource
2730
resp.Diagnostics.Append(diags...)
2831
r.client = client
2932
}
33+
34+
func (r *resourceAgentConfiguration) ImportState(ctx context.Context, request resource.ImportStateRequest, response *resource.ImportStateResponse) {
35+
resource.ImportStatePassthroughID(ctx, path.Root("id"), request, response)
36+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 a an APM agent configuration. See https://www.elastic.co/docs/solutions/observability/apm/apm-agent-central-configuration
12+
13+
## Example Usage
14+
15+
{{ tffile "examples/resources/elasticstack_apm_agent_configuration/resource.tf" }}
16+
17+
{{ .SchemaMarkdown | trimspace }}
18+
19+
## Import
20+
21+
Import is supported using the following syntax:
22+
23+
{{ codefile "shell" "examples/resources/elasticstack_apm_agent_configuration/import.sh" }}

0 commit comments

Comments
 (0)