published on Tuesday, Jun 9, 2026 by Pulumiverse
published on Tuesday, Jun 9, 2026 by Pulumiverse
This resource requires the API token scopes Read settings (
settings.read) and Write settings (settings.write)
Changing the Monitoring Mode for Agents that are currently not connected to Dynatrace is not possible. By default the Terraform Provider will silently ignore settings for these hosts. You have, of course, to expect non-empty plans in such cases. If you would like to get notified explicitly about the inability to change the monitoring mode for an offline host, you can set the environment variable
DYNATRACE_HOST_MONITORING_WARNINGStotrue. Terraform will then print out a warning about that resource.
Dynatrace Documentation
Hosts - https://www.dynatrace.com/support/help/how-to-use-dynatrace/infrastructure-monitoring/hosts
Settings API - https://www.dynatrace.com/support/help/dynatrace-api/environment-api/settings (schemaId:
builtin:host.monitoring.mode)
Export Example Usage
terraform-provider-dynatrace -export dynatrace.HostMonitoringModedownloads all existing host monitoring mode configuration
By default settings for Agents that are currently offline are not getting exported. You can change that by setting the environment variable
DYNATRACE_HOST_MONITORING_OFFLINEtotruebefore running the export. Be aware that you will get settings exported for every host that has been connected within the last 3 years that way.
The full documentation of the export feature is available here.
Resource Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as dynatrace from "@pulumiverse/dynatrace";
const hosts = dynatrace.getEntities({
type: "HOST",
});
const mode = new dynatrace.HostMonitoringMode("mode", {
hostId: hosts.then(hosts => hosts.entities?.[0]?.entityId),
monitoringMode: "FULL_STACK",
});
import pulumi
import pulumi_dynatrace as dynatrace
import pulumiverse_dynatrace as dynatrace
hosts = dynatrace.get_entities(type="HOST")
mode = dynatrace.HostMonitoringMode("mode",
host_id=hosts.entities[0].entity_id,
monitoring_mode="FULL_STACK")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-dynatrace/sdk/go/dynatrace"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
hosts, err := dynatrace.GetEntities(ctx, &dynatrace.GetEntitiesArgs{
Type: pulumi.StringRef("HOST"),
}, nil)
if err != nil {
return err
}
_, err = dynatrace.NewHostMonitoringMode(ctx, "mode", &dynatrace.HostMonitoringModeArgs{
HostId: pulumi.String(pulumi.String(hosts.Entities[0].EntityId)),
MonitoringMode: pulumi.String("FULL_STACK"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Dynatrace = Pulumiverse.Dynatrace;
return await Deployment.RunAsync(() =>
{
var hosts = Dynatrace.GetEntities.Invoke(new()
{
Type = "HOST",
});
var mode = new Dynatrace.HostMonitoringMode("mode", new()
{
HostId = hosts.Apply(getEntitiesResult => getEntitiesResult.Entities[0]?.EntityId),
MonitoringMode = "FULL_STACK",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.DynatraceFunctions;
import com.pulumi.dynatrace.inputs.GetEntitiesArgs;
import com.pulumi.dynatrace.HostMonitoringMode;
import com.pulumi.dynatrace.HostMonitoringModeArgs;
import java.util.ArrayList;
import java.util.Arrays;
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) {
final var hosts = DynatraceFunctions.getEntities(GetEntitiesArgs.builder()
.type("HOST")
.build());
var mode = new HostMonitoringMode("mode", HostMonitoringModeArgs.builder()
.hostId(hosts.entities()[0].entityId())
.monitoringMode("FULL_STACK")
.build());
}
}
resources:
mode:
type: dynatrace:HostMonitoringMode
properties:
hostId: ${hosts.entities[0].entityId}
monitoringMode: FULL_STACK
variables:
hosts:
fn::invoke:
function: dynatrace:getEntities
arguments:
type: HOST
pulumi {
required_providers {
dynatrace = {
source = "pulumi/dynatrace"
}
}
}
data "dynatrace_getentities" "hosts" {
type = "HOST"
}
resource "dynatrace_hostmonitoringmode" "mode" {
host_id = data.dynatrace_getentities.hosts.entities[0].entity_id
monitoring_mode = "FULL_STACK"
}
Create HostMonitoringMode Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HostMonitoringMode(name: string, args: HostMonitoringModeArgs, opts?: CustomResourceOptions);@overload
def HostMonitoringMode(resource_name: str,
args: HostMonitoringModeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HostMonitoringMode(resource_name: str,
opts: Optional[ResourceOptions] = None,
host_id: Optional[str] = None,
monitoring_mode: Optional[str] = None)func NewHostMonitoringMode(ctx *Context, name string, args HostMonitoringModeArgs, opts ...ResourceOption) (*HostMonitoringMode, error)public HostMonitoringMode(string name, HostMonitoringModeArgs args, CustomResourceOptions? opts = null)
public HostMonitoringMode(String name, HostMonitoringModeArgs args)
public HostMonitoringMode(String name, HostMonitoringModeArgs args, CustomResourceOptions options)
type: dynatrace:HostMonitoringMode
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "dynatrace_hostmonitoringmode" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args HostMonitoringModeArgs
- 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 HostMonitoringModeArgs
- 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 HostMonitoringModeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HostMonitoringModeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HostMonitoringModeArgs
- 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 hostMonitoringModeResource = new Dynatrace.HostMonitoringMode("hostMonitoringModeResource", new()
{
HostId = "string",
MonitoringMode = "string",
});
example, err := dynatrace.NewHostMonitoringMode(ctx, "hostMonitoringModeResource", &dynatrace.HostMonitoringModeArgs{
HostId: pulumi.String("string"),
MonitoringMode: pulumi.String("string"),
})
resource "dynatrace_hostmonitoringmode" "hostMonitoringModeResource" {
host_id = "string"
monitoring_mode = "string"
}
var hostMonitoringModeResource = new HostMonitoringMode("hostMonitoringModeResource", HostMonitoringModeArgs.builder()
.hostId("string")
.monitoringMode("string")
.build());
host_monitoring_mode_resource = dynatrace.HostMonitoringMode("hostMonitoringModeResource",
host_id="string",
monitoring_mode="string")
const hostMonitoringModeResource = new dynatrace.HostMonitoringMode("hostMonitoringModeResource", {
hostId: "string",
monitoringMode: "string",
});
type: dynatrace:HostMonitoringMode
properties:
hostId: string
monitoringMode: string
HostMonitoringMode 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 HostMonitoringMode resource accepts the following input properties:
- Host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- Monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- Host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- Monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host_
id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring_
mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id String - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode String - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host_
id str - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring_
mode str - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id String - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode String - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
Outputs
All input properties are implicitly available as output properties. Additionally, the HostMonitoringMode 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 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 HostMonitoringMode Resource
Get an existing HostMonitoringMode 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?: HostMonitoringModeState, opts?: CustomResourceOptions): HostMonitoringMode@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
host_id: Optional[str] = None,
monitoring_mode: Optional[str] = None) -> HostMonitoringModefunc GetHostMonitoringMode(ctx *Context, name string, id IDInput, state *HostMonitoringModeState, opts ...ResourceOption) (*HostMonitoringMode, error)public static HostMonitoringMode Get(string name, Input<string> id, HostMonitoringModeState? state, CustomResourceOptions? opts = null)public static HostMonitoringMode get(String name, Output<String> id, HostMonitoringModeState state, CustomResourceOptions options)resources: _: type: dynatrace:HostMonitoringMode get: id: ${id}import {
to = dynatrace_hostmonitoringmode.example
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.
- Host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- Monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- Host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- Monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host_
id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring_
mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id String - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode String - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id string - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode string - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host_
id str - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring_
mode str - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
- host
Id String - The scope of this settings. If the settings should cover the whole environment, just don't specify any scope.
- monitoring
Mode String - Possible Values:
DISCOVERY,FULL_STACK,INFRA_ONLY
Package Details
- Repository
- dynatrace pulumiverse/pulumi-dynatrace
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
dynatraceTerraform Provider.
published on Tuesday, Jun 9, 2026 by Pulumiverse