1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. ApmAgentConfiguration
elasticstack 0.11.17 published on Tuesday, Jul 22, 2025 by elastic

elasticstack.ApmAgentConfiguration

Explore with Pulumi AI

elasticstack logo
elasticstack 0.11.17 published on Tuesday, Jul 22, 2025 by elastic

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as elasticstack from "@pulumi/elasticstack";
    
    const testConfig = new elasticstack.ApmAgentConfiguration("testConfig", {
        agentName: "go",
        serviceEnvironment: "production",
        serviceName: "my-service",
        settings: {
            capture_body: "all",
            transaction_sample_rate: "0.5",
        },
    });
    
    import pulumi
    import pulumi_elasticstack as elasticstack
    
    test_config = elasticstack.ApmAgentConfiguration("testConfig",
        agent_name="go",
        service_environment="production",
        service_name="my-service",
        settings={
            "capture_body": "all",
            "transaction_sample_rate": "0.5",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/elasticstack/elasticstack"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := elasticstack.NewApmAgentConfiguration(ctx, "testConfig", &elasticstack.ApmAgentConfigurationArgs{
    			AgentName:          pulumi.String("go"),
    			ServiceEnvironment: pulumi.String("production"),
    			ServiceName:        pulumi.String("my-service"),
    			Settings: pulumi.StringMap{
    				"capture_body":            pulumi.String("all"),
    				"transaction_sample_rate": pulumi.String("0.5"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Elasticstack = Pulumi.Elasticstack;
    
    return await Deployment.RunAsync(() => 
    {
        var testConfig = new Elasticstack.ApmAgentConfiguration("testConfig", new()
        {
            AgentName = "go",
            ServiceEnvironment = "production",
            ServiceName = "my-service",
            Settings = 
            {
                { "capture_body", "all" },
                { "transaction_sample_rate", "0.5" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.ApmAgentConfiguration;
    import com.pulumi.elasticstack.ApmAgentConfigurationArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var testConfig = new ApmAgentConfiguration("testConfig", ApmAgentConfigurationArgs.builder()
                .agentName("go")
                .serviceEnvironment("production")
                .serviceName("my-service")
                .settings(Map.ofEntries(
                    Map.entry("capture_body", "all"),
                    Map.entry("transaction_sample_rate", "0.5")
                ))
                .build());
    
        }
    }
    
    resources:
      testConfig:
        type: elasticstack:ApmAgentConfiguration
        properties:
          agentName: go
          serviceEnvironment: production
          serviceName: my-service
          settings:
            capture_body: all
            transaction_sample_rate: '0.5'
    

    Create ApmAgentConfiguration Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ApmAgentConfiguration(name: string, args: ApmAgentConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def ApmAgentConfiguration(resource_name: str,
                              args: ApmAgentConfigurationArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ApmAgentConfiguration(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              service_name: Optional[str] = None,
                              settings: Optional[Mapping[str, str]] = None,
                              agent_name: Optional[str] = None,
                              service_environment: Optional[str] = None)
    func NewApmAgentConfiguration(ctx *Context, name string, args ApmAgentConfigurationArgs, opts ...ResourceOption) (*ApmAgentConfiguration, error)
    public ApmAgentConfiguration(string name, ApmAgentConfigurationArgs args, CustomResourceOptions? opts = null)
    public ApmAgentConfiguration(String name, ApmAgentConfigurationArgs args)
    public ApmAgentConfiguration(String name, ApmAgentConfigurationArgs args, CustomResourceOptions options)
    
    type: elasticstack:ApmAgentConfiguration
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ApmAgentConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ApmAgentConfigurationArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ApmAgentConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ApmAgentConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ApmAgentConfigurationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var apmAgentConfigurationResource = new Elasticstack.ApmAgentConfiguration("apmAgentConfigurationResource", new()
    {
        ServiceName = "string",
        Settings = 
        {
            { "string", "string" },
        },
        AgentName = "string",
        ServiceEnvironment = "string",
    });
    
    example, err := elasticstack.NewApmAgentConfiguration(ctx, "apmAgentConfigurationResource", &elasticstack.ApmAgentConfigurationArgs{
    	ServiceName: pulumi.String("string"),
    	Settings: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	AgentName:          pulumi.String("string"),
    	ServiceEnvironment: pulumi.String("string"),
    })
    
    var apmAgentConfigurationResource = new ApmAgentConfiguration("apmAgentConfigurationResource", ApmAgentConfigurationArgs.builder()
        .serviceName("string")
        .settings(Map.of("string", "string"))
        .agentName("string")
        .serviceEnvironment("string")
        .build());
    
    apm_agent_configuration_resource = elasticstack.ApmAgentConfiguration("apmAgentConfigurationResource",
        service_name="string",
        settings={
            "string": "string",
        },
        agent_name="string",
        service_environment="string")
    
    const apmAgentConfigurationResource = new elasticstack.ApmAgentConfiguration("apmAgentConfigurationResource", {
        serviceName: "string",
        settings: {
            string: "string",
        },
        agentName: "string",
        serviceEnvironment: "string",
    });
    
    type: elasticstack:ApmAgentConfiguration
    properties:
        agentName: string
        serviceEnvironment: string
        serviceName: string
        settings:
            string: string
    

    ApmAgentConfiguration Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ApmAgentConfiguration resource accepts the following input properties:

    ServiceName string
    The name of the service.
    Settings Dictionary<string, string>
    Agent configuration settings.
    AgentName string
    The agent name is used by the UI to determine which settings to display.
    ServiceEnvironment string
    The environment of the service.
    ServiceName string
    The name of the service.
    Settings map[string]string
    Agent configuration settings.
    AgentName string
    The agent name is used by the UI to determine which settings to display.
    ServiceEnvironment string
    The environment of the service.
    serviceName String
    The name of the service.
    settings Map<String,String>
    Agent configuration settings.
    agentName String
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment String
    The environment of the service.
    serviceName string
    The name of the service.
    settings {[key: string]: string}
    Agent configuration settings.
    agentName string
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment string
    The environment of the service.
    service_name str
    The name of the service.
    settings Mapping[str, str]
    Agent configuration settings.
    agent_name str
    The agent name is used by the UI to determine which settings to display.
    service_environment str
    The environment of the service.
    serviceName String
    The name of the service.
    settings Map<String>
    Agent configuration settings.
    agentName String
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment String
    The environment of the service.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ApmAgentConfiguration resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ApmAgentConfiguration Resource

    Get an existing ApmAgentConfiguration resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ApmAgentConfigurationState, opts?: CustomResourceOptions): ApmAgentConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            agent_name: Optional[str] = None,
            service_environment: Optional[str] = None,
            service_name: Optional[str] = None,
            settings: Optional[Mapping[str, str]] = None) -> ApmAgentConfiguration
    func GetApmAgentConfiguration(ctx *Context, name string, id IDInput, state *ApmAgentConfigurationState, opts ...ResourceOption) (*ApmAgentConfiguration, error)
    public static ApmAgentConfiguration Get(string name, Input<string> id, ApmAgentConfigurationState? state, CustomResourceOptions? opts = null)
    public static ApmAgentConfiguration get(String name, Output<String> id, ApmAgentConfigurationState state, CustomResourceOptions options)
    resources:  _:    type: elasticstack:ApmAgentConfiguration    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    AgentName string
    The agent name is used by the UI to determine which settings to display.
    ServiceEnvironment string
    The environment of the service.
    ServiceName string
    The name of the service.
    Settings Dictionary<string, string>
    Agent configuration settings.
    AgentName string
    The agent name is used by the UI to determine which settings to display.
    ServiceEnvironment string
    The environment of the service.
    ServiceName string
    The name of the service.
    Settings map[string]string
    Agent configuration settings.
    agentName String
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment String
    The environment of the service.
    serviceName String
    The name of the service.
    settings Map<String,String>
    Agent configuration settings.
    agentName string
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment string
    The environment of the service.
    serviceName string
    The name of the service.
    settings {[key: string]: string}
    Agent configuration settings.
    agent_name str
    The agent name is used by the UI to determine which settings to display.
    service_environment str
    The environment of the service.
    service_name str
    The name of the service.
    settings Mapping[str, str]
    Agent configuration settings.
    agentName String
    The agent name is used by the UI to determine which settings to display.
    serviceEnvironment String
    The environment of the service.
    serviceName String
    The name of the service.
    settings Map<String>
    Agent configuration settings.

    Import

    $ pulumi import elasticstack:index/apmAgentConfiguration:ApmAgentConfiguration test_configuration my-service:production
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    elasticstack elastic/terraform-provider-elasticstack
    License
    Notes
    This Pulumi package is based on the elasticstack Terraform Provider.
    elasticstack logo
    elasticstack 0.11.17 published on Tuesday, Jul 22, 2025 by elastic