1. Packages
  2. Elasticstack Provider
  3. API Docs
  4. FleetAgentPolicy
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

elasticstack.FleetAgentPolicy

Explore with Pulumi AI

elasticstack logo
elasticstack 0.11.15 published on Wednesday, Apr 23, 2025 by elastic

    Creates or updates a Fleet Agent Policy. See https://www.elastic.co/guide/en/fleet/current/fleet-api-docs.html#create-agent-policy-api

    Example Usage

    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    Coming soon!
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.elasticstack.FleetAgentPolicy;
    import com.pulumi.elasticstack.FleetAgentPolicyArgs;
    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 testPolicy = new FleetAgentPolicy("testPolicy", FleetAgentPolicyArgs.builder()
                .description("Test Agent Policy")
                .globalDataTags(Map.ofEntries(
                    Map.entry("first_tag", Map.of("stringValue", "tag_value")),
                    Map.entry("second_tag", Map.of("numberValue", 1.2))
                ))
                .monitorLogs(true)
                .monitorMetrics(true)
                .namespace("default")
                .sysMonitoring(true)
                .build());
    
        }
    }
    
    resources:
      testPolicy:
        type: elasticstack:FleetAgentPolicy
        properties:
          description: Test Agent Policy
          globalDataTags:
            first_tag:
              - stringValue: tag_value
            second_tag:
              - numberValue: 1.2
          monitorLogs: true
          monitorMetrics: true
          namespace: default
          sysMonitoring: true
    

    Create FleetAgentPolicy Resource

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

    Constructor syntax

    new FleetAgentPolicy(name: string, args: FleetAgentPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def FleetAgentPolicy(resource_name: str,
                         args: FleetAgentPolicyArgs,
                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def FleetAgentPolicy(resource_name: str,
                         opts: Optional[ResourceOptions] = None,
                         namespace: Optional[str] = None,
                         fleet_server_host_id: Optional[str] = None,
                         download_source_id: Optional[str] = None,
                         data_output_id: Optional[str] = None,
                         global_data_tags: Optional[Mapping[str, FleetAgentPolicyGlobalDataTagsArgs]] = None,
                         monitor_logs: Optional[bool] = None,
                         monitor_metrics: Optional[bool] = None,
                         monitoring_output_id: Optional[str] = None,
                         name: Optional[str] = None,
                         description: Optional[str] = None,
                         policy_id: Optional[str] = None,
                         skip_destroy: Optional[bool] = None,
                         sys_monitoring: Optional[bool] = None)
    func NewFleetAgentPolicy(ctx *Context, name string, args FleetAgentPolicyArgs, opts ...ResourceOption) (*FleetAgentPolicy, error)
    public FleetAgentPolicy(string name, FleetAgentPolicyArgs args, CustomResourceOptions? opts = null)
    public FleetAgentPolicy(String name, FleetAgentPolicyArgs args)
    public FleetAgentPolicy(String name, FleetAgentPolicyArgs args, CustomResourceOptions options)
    
    type: elasticstack:FleetAgentPolicy
    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 FleetAgentPolicyArgs
    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 FleetAgentPolicyArgs
    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 FleetAgentPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args FleetAgentPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args FleetAgentPolicyArgs
    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 fleetAgentPolicyResource = new Elasticstack.FleetAgentPolicy("fleetAgentPolicyResource", new()
    {
        Namespace = "string",
        FleetServerHostId = "string",
        DownloadSourceId = "string",
        DataOutputId = "string",
        GlobalDataTags = 
        {
            { "string", new Elasticstack.Inputs.FleetAgentPolicyGlobalDataTagsArgs
            {
                NumberValue = 0,
                StringValue = "string",
            } },
        },
        MonitorLogs = false,
        MonitorMetrics = false,
        MonitoringOutputId = "string",
        Name = "string",
        Description = "string",
        PolicyId = "string",
        SkipDestroy = false,
        SysMonitoring = false,
    });
    
    example, err := elasticstack.NewFleetAgentPolicy(ctx, "fleetAgentPolicyResource", &elasticstack.FleetAgentPolicyArgs{
    	Namespace:         pulumi.String("string"),
    	FleetServerHostId: pulumi.String("string"),
    	DownloadSourceId:  pulumi.String("string"),
    	DataOutputId:      pulumi.String("string"),
    	GlobalDataTags: elasticstack.FleetAgentPolicyGlobalDataTagsMap{
    		"string": &elasticstack.FleetAgentPolicyGlobalDataTagsArgs{
    			NumberValue: pulumi.Float64(0),
    			StringValue: pulumi.String("string"),
    		},
    	},
    	MonitorLogs:        pulumi.Bool(false),
    	MonitorMetrics:     pulumi.Bool(false),
    	MonitoringOutputId: pulumi.String("string"),
    	Name:               pulumi.String("string"),
    	Description:        pulumi.String("string"),
    	PolicyId:           pulumi.String("string"),
    	SkipDestroy:        pulumi.Bool(false),
    	SysMonitoring:      pulumi.Bool(false),
    })
    
    var fleetAgentPolicyResource = new FleetAgentPolicy("fleetAgentPolicyResource", FleetAgentPolicyArgs.builder()
        .namespace("string")
        .fleetServerHostId("string")
        .downloadSourceId("string")
        .dataOutputId("string")
        .globalDataTags(Map.of("string", Map.ofEntries(
            Map.entry("numberValue", 0),
            Map.entry("stringValue", "string")
        )))
        .monitorLogs(false)
        .monitorMetrics(false)
        .monitoringOutputId("string")
        .name("string")
        .description("string")
        .policyId("string")
        .skipDestroy(false)
        .sysMonitoring(false)
        .build());
    
    fleet_agent_policy_resource = elasticstack.FleetAgentPolicy("fleetAgentPolicyResource",
        namespace="string",
        fleet_server_host_id="string",
        download_source_id="string",
        data_output_id="string",
        global_data_tags={
            "string": {
                "number_value": 0,
                "string_value": "string",
            },
        },
        monitor_logs=False,
        monitor_metrics=False,
        monitoring_output_id="string",
        name="string",
        description="string",
        policy_id="string",
        skip_destroy=False,
        sys_monitoring=False)
    
    const fleetAgentPolicyResource = new elasticstack.FleetAgentPolicy("fleetAgentPolicyResource", {
        namespace: "string",
        fleetServerHostId: "string",
        downloadSourceId: "string",
        dataOutputId: "string",
        globalDataTags: {
            string: {
                numberValue: 0,
                stringValue: "string",
            },
        },
        monitorLogs: false,
        monitorMetrics: false,
        monitoringOutputId: "string",
        name: "string",
        description: "string",
        policyId: "string",
        skipDestroy: false,
        sysMonitoring: false,
    });
    
    type: elasticstack:FleetAgentPolicy
    properties:
        dataOutputId: string
        description: string
        downloadSourceId: string
        fleetServerHostId: string
        globalDataTags:
            string:
                numberValue: 0
                stringValue: string
        monitorLogs: false
        monitorMetrics: false
        monitoringOutputId: string
        name: string
        namespace: string
        policyId: string
        skipDestroy: false
        sysMonitoring: false
    

    FleetAgentPolicy 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 FleetAgentPolicy resource accepts the following input properties:

    Namespace string
    The namespace of the agent policy.
    DataOutputId string
    The identifier for the data output.
    Description string
    The description of the agent policy.
    DownloadSourceId string
    The identifier for the Elastic Agent binary download server.
    FleetServerHostId string
    The identifier for the Fleet server host.
    GlobalDataTags Dictionary<string, FleetAgentPolicyGlobalDataTagsArgs>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    MonitorLogs bool
    Enable collection of agent logs.
    MonitorMetrics bool
    Enable collection of agent metrics.
    MonitoringOutputId string
    The identifier for monitoring output.
    Name string
    The name of the agent policy.
    PolicyId string
    Unique identifier of the agent policy.
    SkipDestroy bool
    SysMonitoring bool
    Enable collection of system logs and metrics.
    Namespace string
    The namespace of the agent policy.
    DataOutputId string
    The identifier for the data output.
    Description string
    The description of the agent policy.
    DownloadSourceId string
    The identifier for the Elastic Agent binary download server.
    FleetServerHostId string
    The identifier for the Fleet server host.
    GlobalDataTags map[string]FleetAgentPolicyGlobalDataTagsArgs
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    MonitorLogs bool
    Enable collection of agent logs.
    MonitorMetrics bool
    Enable collection of agent metrics.
    MonitoringOutputId string
    The identifier for monitoring output.
    Name string
    The name of the agent policy.
    PolicyId string
    Unique identifier of the agent policy.
    SkipDestroy bool
    SysMonitoring bool
    Enable collection of system logs and metrics.
    namespace String
    The namespace of the agent policy.
    dataOutputId String
    The identifier for the data output.
    description String
    The description of the agent policy.
    downloadSourceId String
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId String
    The identifier for the Fleet server host.
    globalDataTags Map<String,FleetAgentPolicyGlobalDataTagsArgs>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs Boolean
    Enable collection of agent logs.
    monitorMetrics Boolean
    Enable collection of agent metrics.
    monitoringOutputId String
    The identifier for monitoring output.
    name String
    The name of the agent policy.
    policyId String
    Unique identifier of the agent policy.
    skipDestroy Boolean
    sysMonitoring Boolean
    Enable collection of system logs and metrics.
    namespace string
    The namespace of the agent policy.
    dataOutputId string
    The identifier for the data output.
    description string
    The description of the agent policy.
    downloadSourceId string
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId string
    The identifier for the Fleet server host.
    globalDataTags {[key: string]: FleetAgentPolicyGlobalDataTagsArgs}
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs boolean
    Enable collection of agent logs.
    monitorMetrics boolean
    Enable collection of agent metrics.
    monitoringOutputId string
    The identifier for monitoring output.
    name string
    The name of the agent policy.
    policyId string
    Unique identifier of the agent policy.
    skipDestroy boolean
    sysMonitoring boolean
    Enable collection of system logs and metrics.
    namespace str
    The namespace of the agent policy.
    data_output_id str
    The identifier for the data output.
    description str
    The description of the agent policy.
    download_source_id str
    The identifier for the Elastic Agent binary download server.
    fleet_server_host_id str
    The identifier for the Fleet server host.
    global_data_tags Mapping[str, FleetAgentPolicyGlobalDataTagsArgs]
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitor_logs bool
    Enable collection of agent logs.
    monitor_metrics bool
    Enable collection of agent metrics.
    monitoring_output_id str
    The identifier for monitoring output.
    name str
    The name of the agent policy.
    policy_id str
    Unique identifier of the agent policy.
    skip_destroy bool
    sys_monitoring bool
    Enable collection of system logs and metrics.
    namespace String
    The namespace of the agent policy.
    dataOutputId String
    The identifier for the data output.
    description String
    The description of the agent policy.
    downloadSourceId String
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId String
    The identifier for the Fleet server host.
    globalDataTags Map<Property Map>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs Boolean
    Enable collection of agent logs.
    monitorMetrics Boolean
    Enable collection of agent metrics.
    monitoringOutputId String
    The identifier for monitoring output.
    name String
    The name of the agent policy.
    policyId String
    Unique identifier of the agent policy.
    skipDestroy Boolean
    sysMonitoring Boolean
    Enable collection of system logs and metrics.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the FleetAgentPolicy 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 FleetAgentPolicy Resource

    Get an existing FleetAgentPolicy 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?: FleetAgentPolicyState, opts?: CustomResourceOptions): FleetAgentPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            data_output_id: Optional[str] = None,
            description: Optional[str] = None,
            download_source_id: Optional[str] = None,
            fleet_server_host_id: Optional[str] = None,
            global_data_tags: Optional[Mapping[str, FleetAgentPolicyGlobalDataTagsArgs]] = None,
            monitor_logs: Optional[bool] = None,
            monitor_metrics: Optional[bool] = None,
            monitoring_output_id: Optional[str] = None,
            name: Optional[str] = None,
            namespace: Optional[str] = None,
            policy_id: Optional[str] = None,
            skip_destroy: Optional[bool] = None,
            sys_monitoring: Optional[bool] = None) -> FleetAgentPolicy
    func GetFleetAgentPolicy(ctx *Context, name string, id IDInput, state *FleetAgentPolicyState, opts ...ResourceOption) (*FleetAgentPolicy, error)
    public static FleetAgentPolicy Get(string name, Input<string> id, FleetAgentPolicyState? state, CustomResourceOptions? opts = null)
    public static FleetAgentPolicy get(String name, Output<String> id, FleetAgentPolicyState state, CustomResourceOptions options)
    resources:  _:    type: elasticstack:FleetAgentPolicy    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:
    DataOutputId string
    The identifier for the data output.
    Description string
    The description of the agent policy.
    DownloadSourceId string
    The identifier for the Elastic Agent binary download server.
    FleetServerHostId string
    The identifier for the Fleet server host.
    GlobalDataTags Dictionary<string, FleetAgentPolicyGlobalDataTagsArgs>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    MonitorLogs bool
    Enable collection of agent logs.
    MonitorMetrics bool
    Enable collection of agent metrics.
    MonitoringOutputId string
    The identifier for monitoring output.
    Name string
    The name of the agent policy.
    Namespace string
    The namespace of the agent policy.
    PolicyId string
    Unique identifier of the agent policy.
    SkipDestroy bool
    SysMonitoring bool
    Enable collection of system logs and metrics.
    DataOutputId string
    The identifier for the data output.
    Description string
    The description of the agent policy.
    DownloadSourceId string
    The identifier for the Elastic Agent binary download server.
    FleetServerHostId string
    The identifier for the Fleet server host.
    GlobalDataTags map[string]FleetAgentPolicyGlobalDataTagsArgs
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    MonitorLogs bool
    Enable collection of agent logs.
    MonitorMetrics bool
    Enable collection of agent metrics.
    MonitoringOutputId string
    The identifier for monitoring output.
    Name string
    The name of the agent policy.
    Namespace string
    The namespace of the agent policy.
    PolicyId string
    Unique identifier of the agent policy.
    SkipDestroy bool
    SysMonitoring bool
    Enable collection of system logs and metrics.
    dataOutputId String
    The identifier for the data output.
    description String
    The description of the agent policy.
    downloadSourceId String
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId String
    The identifier for the Fleet server host.
    globalDataTags Map<String,FleetAgentPolicyGlobalDataTagsArgs>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs Boolean
    Enable collection of agent logs.
    monitorMetrics Boolean
    Enable collection of agent metrics.
    monitoringOutputId String
    The identifier for monitoring output.
    name String
    The name of the agent policy.
    namespace String
    The namespace of the agent policy.
    policyId String
    Unique identifier of the agent policy.
    skipDestroy Boolean
    sysMonitoring Boolean
    Enable collection of system logs and metrics.
    dataOutputId string
    The identifier for the data output.
    description string
    The description of the agent policy.
    downloadSourceId string
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId string
    The identifier for the Fleet server host.
    globalDataTags {[key: string]: FleetAgentPolicyGlobalDataTagsArgs}
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs boolean
    Enable collection of agent logs.
    monitorMetrics boolean
    Enable collection of agent metrics.
    monitoringOutputId string
    The identifier for monitoring output.
    name string
    The name of the agent policy.
    namespace string
    The namespace of the agent policy.
    policyId string
    Unique identifier of the agent policy.
    skipDestroy boolean
    sysMonitoring boolean
    Enable collection of system logs and metrics.
    data_output_id str
    The identifier for the data output.
    description str
    The description of the agent policy.
    download_source_id str
    The identifier for the Elastic Agent binary download server.
    fleet_server_host_id str
    The identifier for the Fleet server host.
    global_data_tags Mapping[str, FleetAgentPolicyGlobalDataTagsArgs]
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitor_logs bool
    Enable collection of agent logs.
    monitor_metrics bool
    Enable collection of agent metrics.
    monitoring_output_id str
    The identifier for monitoring output.
    name str
    The name of the agent policy.
    namespace str
    The namespace of the agent policy.
    policy_id str
    Unique identifier of the agent policy.
    skip_destroy bool
    sys_monitoring bool
    Enable collection of system logs and metrics.
    dataOutputId String
    The identifier for the data output.
    description String
    The description of the agent policy.
    downloadSourceId String
    The identifier for the Elastic Agent binary download server.
    fleetServerHostId String
    The identifier for the Fleet server host.
    globalDataTags Map<Property Map>
    User-defined data tags to apply to all inputs. Values can be strings (stringvalue) or numbers (numbervalue) but not both. Example -- key1 = {stringvalue = value1}, key2 = {numbervalue = 42}
    monitorLogs Boolean
    Enable collection of agent logs.
    monitorMetrics Boolean
    Enable collection of agent metrics.
    monitoringOutputId String
    The identifier for monitoring output.
    name String
    The name of the agent policy.
    namespace String
    The namespace of the agent policy.
    policyId String
    Unique identifier of the agent policy.
    skipDestroy Boolean
    sysMonitoring Boolean
    Enable collection of system logs and metrics.

    Supporting Types

    FleetAgentPolicyGlobalDataTags, FleetAgentPolicyGlobalDataTagsArgs

    NumberValue double
    Number value for the field. If this is set, string_value must not be defined.
    StringValue string
    String value for the field. If this is set, number_value must not be defined.
    NumberValue float64
    Number value for the field. If this is set, string_value must not be defined.
    StringValue string
    String value for the field. If this is set, number_value must not be defined.
    numberValue Double
    Number value for the field. If this is set, string_value must not be defined.
    stringValue String
    String value for the field. If this is set, number_value must not be defined.
    numberValue number
    Number value for the field. If this is set, string_value must not be defined.
    stringValue string
    String value for the field. If this is set, number_value must not be defined.
    number_value float
    Number value for the field. If this is set, string_value must not be defined.
    string_value str
    String value for the field. If this is set, number_value must not be defined.
    numberValue Number
    Number value for the field. If this is set, string_value must not be defined.
    stringValue String
    String value for the field. If this is set, number_value must not be defined.

    Import

    $ pulumi import elasticstack:index/fleetAgentPolicy:FleetAgentPolicy my_policy <fleet_agent_policy_id>
    

    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.15 published on Wednesday, Apr 23, 2025 by elastic