published on Tuesday, Jun 9, 2026 by Pulumiverse
published on Tuesday, Jun 9, 2026 by Pulumiverse
Dynatrace Managed only
To utilize this resource, please define the environment variables
DT_CLUSTER_URLandDT_CLUSTER_API_TOKENwith the cluster API token scope Service Provider API (ServiceProviderAPI).
Dynatrace Documentation
- Dynatrace IAM Policy Management - https://docs.dynatrace.com/managed/manage/identity-access-management/permission-management/manage-user-permissions-policies
Export Example Usage
terraform-provider-dynatrace -export dynatrace.Policydownloads all existing policies
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 policy = new dynatrace.Policy("policy", {
name: "my_policy_valid_for_environment_########-####-####-####-############",
environment: "########-####-####-####-############",
statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
import pulumi
import pulumiverse_dynatrace as dynatrace
policy = dynatrace.Policy("policy",
name="my_policy_valid_for_environment_########-####-####-####-############",
environment="########-####-####-####-############",
statement_query="ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
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 {
_, err := dynatrace.NewPolicy(ctx, "policy", &dynatrace.PolicyArgs{
Name: pulumi.String("my_policy_valid_for_environment_########-####-####-####-############"),
Environment: pulumi.String("########-####-####-####-############"),
StatementQuery: pulumi.String("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"),
})
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 policy = new Dynatrace.Policy("policy", new()
{
Name = "my_policy_valid_for_environment_########-####-####-####-############",
Environment = "########-####-####-####-############",
StatementQuery = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.Policy;
import com.pulumi.dynatrace.PolicyArgs;
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) {
var policy = new Policy("policy", PolicyArgs.builder()
.name("my_policy_valid_for_environment_########-####-####-####-############")
.environment("########-####-####-####-############")
.statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
.build());
}
}
resources:
policy:
type: dynatrace:Policy
properties:
name: my_policy_valid_for_environment_########-####-####-####-############
environment: '########-####-####-####-############'
statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";
pulumi {
required_providers {
dynatrace = {
source = "pulumi/dynatrace"
}
}
}
resource "dynatrace_policy" "policy" {
name = "my_policy_valid_for_environment_########-####-####-####-############"
environment = "########-####-####-####-############"
statement_query = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"
}
import * as pulumi from "@pulumi/pulumi";
import * as dynatrace from "@pulumiverse/dynatrace";
const policy = new dynatrace.IamPolicy("policy", {
name: "my_policy_valid_for_all_environments_in_this_cluster",
cluster: "########-####-####-####-############",
statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
import pulumi
import pulumiverse_dynatrace as dynatrace
policy = dynatrace.IamPolicy("policy",
name="my_policy_valid_for_all_environments_in_this_cluster",
cluster="########-####-####-####-############",
statement_query="ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
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 {
_, err := dynatrace.NewIamPolicy(ctx, "policy", &dynatrace.IamPolicyArgs{
Name: pulumi.String("my_policy_valid_for_all_environments_in_this_cluster"),
Cluster: "########-####-####-####-############",
StatementQuery: pulumi.String("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"),
})
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 policy = new Dynatrace.IamPolicy("policy", new()
{
Name = "my_policy_valid_for_all_environments_in_this_cluster",
Cluster = "########-####-####-####-############",
StatementQuery = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.IamPolicy;
import com.pulumi.dynatrace.IamPolicyArgs;
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) {
var policy = new IamPolicy("policy", IamPolicyArgs.builder()
.name("my_policy_valid_for_all_environments_in_this_cluster")
.cluster("########-####-####-####-############")
.statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
.build());
}
}
resources:
policy:
type: dynatrace:IamPolicy
properties:
name: my_policy_valid_for_all_environments_in_this_cluster
cluster: '########-####-####-####-############'
statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";
pulumi {
required_providers {
dynatrace = {
source = "pulumi/dynatrace"
}
}
}
resource "dynatrace_iampolicy" "policy" {
name = "my_policy_valid_for_all_environments_in_this_cluster"
cluster = "########-####-####-####-############"
statement_query = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"
}
Create Policy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Policy(name: string, args: PolicyArgs, opts?: CustomResourceOptions);@overload
def Policy(resource_name: str,
args: PolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Policy(resource_name: str,
opts: Optional[ResourceOptions] = None,
statement_query: Optional[str] = None,
cluster: Optional[str] = None,
description: Optional[str] = None,
environment: Optional[str] = None,
name: Optional[str] = None,
tags: Optional[Sequence[str]] = None)func NewPolicy(ctx *Context, name string, args PolicyArgs, opts ...ResourceOption) (*Policy, error)public Policy(string name, PolicyArgs args, CustomResourceOptions? opts = null)
public Policy(String name, PolicyArgs args)
public Policy(String name, PolicyArgs args, CustomResourceOptions options)
type: dynatrace:Policy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "dynatrace_policy" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PolicyArgs
- 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 PolicyArgs
- 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 PolicyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyArgs
- 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 policyResource = new Dynatrace.Policy("policyResource", new()
{
StatementQuery = "string",
Cluster = "string",
Description = "string",
Environment = "string",
Name = "string",
Tags = new[]
{
"string",
},
});
example, err := dynatrace.NewPolicy(ctx, "policyResource", &dynatrace.PolicyArgs{
StatementQuery: pulumi.String("string"),
Cluster: pulumi.String("string"),
Description: pulumi.String("string"),
Environment: pulumi.String("string"),
Name: pulumi.String("string"),
Tags: pulumi.StringArray{
pulumi.String("string"),
},
})
resource "dynatrace_policy" "policyResource" {
statement_query = "string"
cluster = "string"
description = "string"
environment = "string"
name = "string"
tags = ["string"]
}
var policyResource = new Policy("policyResource", PolicyArgs.builder()
.statementQuery("string")
.cluster("string")
.description("string")
.environment("string")
.name("string")
.tags("string")
.build());
policy_resource = dynatrace.Policy("policyResource",
statement_query="string",
cluster="string",
description="string",
environment="string",
name="string",
tags=["string"])
const policyResource = new dynatrace.Policy("policyResource", {
statementQuery: "string",
cluster: "string",
description: "string",
environment: "string",
name: "string",
tags: ["string"],
});
type: dynatrace:Policy
properties:
cluster: string
description: string
environment: string
name: string
statementQuery: string
tags:
- string
Policy 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 Policy resource accepts the following input properties:
- Statement
Query string - The Statement Query of the policy
- Cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- Description string
- An optional description text for the policy
- Environment string
- The ID of the environment if the policy should be applied to a specific environment
- Name string
- The name of the policy
- List<string>
- Tags for this policy
- Statement
Query string - The Statement Query of the policy
- Cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- Description string
- An optional description text for the policy
- Environment string
- The ID of the environment if the policy should be applied to a specific environment
- Name string
- The name of the policy
- []string
- Tags for this policy
- statement_
query string - The Statement Query of the policy
- cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description string
- An optional description text for the policy
- environment string
- The ID of the environment if the policy should be applied to a specific environment
- name string
- The name of the policy
- list(string)
- Tags for this policy
- statement
Query String - The Statement Query of the policy
- cluster String
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description String
- An optional description text for the policy
- environment String
- The ID of the environment if the policy should be applied to a specific environment
- name String
- The name of the policy
- List<String>
- Tags for this policy
- statement
Query string - The Statement Query of the policy
- cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description string
- An optional description text for the policy
- environment string
- The ID of the environment if the policy should be applied to a specific environment
- name string
- The name of the policy
- string[]
- Tags for this policy
- statement_
query str - The Statement Query of the policy
- cluster str
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description str
- An optional description text for the policy
- environment str
- The ID of the environment if the policy should be applied to a specific environment
- name str
- The name of the policy
- Sequence[str]
- Tags for this policy
- statement
Query String - The Statement Query of the policy
- cluster String
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description String
- An optional description text for the policy
- environment String
- The ID of the environment if the policy should be applied to a specific environment
- name String
- The name of the policy
- List<String>
- Tags for this policy
Outputs
All input properties are implicitly available as output properties. Additionally, the Policy 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 Policy Resource
Get an existing Policy 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?: PolicyState, opts?: CustomResourceOptions): Policy@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster: Optional[str] = None,
description: Optional[str] = None,
environment: Optional[str] = None,
name: Optional[str] = None,
statement_query: Optional[str] = None,
tags: Optional[Sequence[str]] = None) -> Policyfunc GetPolicy(ctx *Context, name string, id IDInput, state *PolicyState, opts ...ResourceOption) (*Policy, error)public static Policy Get(string name, Input<string> id, PolicyState? state, CustomResourceOptions? opts = null)public static Policy get(String name, Output<String> id, PolicyState state, CustomResourceOptions options)resources: _: type: dynatrace:Policy get: id: ${id}import {
to = dynatrace_policy.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.
- Cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- Description string
- An optional description text for the policy
- Environment string
- The ID of the environment if the policy should be applied to a specific environment
- Name string
- The name of the policy
- Statement
Query string - The Statement Query of the policy
- List<string>
- Tags for this policy
- Cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- Description string
- An optional description text for the policy
- Environment string
- The ID of the environment if the policy should be applied to a specific environment
- Name string
- The name of the policy
- Statement
Query string - The Statement Query of the policy
- []string
- Tags for this policy
- cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description string
- An optional description text for the policy
- environment string
- The ID of the environment if the policy should be applied to a specific environment
- name string
- The name of the policy
- statement_
query string - The Statement Query of the policy
- list(string)
- Tags for this policy
- cluster String
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description String
- An optional description text for the policy
- environment String
- The ID of the environment if the policy should be applied to a specific environment
- name String
- The name of the policy
- statement
Query String - The Statement Query of the policy
- List<String>
- Tags for this policy
- cluster string
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description string
- An optional description text for the policy
- environment string
- The ID of the environment if the policy should be applied to a specific environment
- name string
- The name of the policy
- statement
Query string - The Statement Query of the policy
- string[]
- Tags for this policy
- cluster str
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description str
- An optional description text for the policy
- environment str
- The ID of the environment if the policy should be applied to a specific environment
- name str
- The name of the policy
- statement_
query str - The Statement Query of the policy
- Sequence[str]
- Tags for this policy
- cluster String
- The UUID of the cluster in case the policy should be applied to all environments of this cluster.
- description String
- An optional description text for the policy
- environment String
- The ID of the environment if the policy should be applied to a specific environment
- name String
- The name of the policy
- statement
Query String - The Statement Query of the policy
- List<String>
- Tags for this policy
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