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.PolicyBindingsdownloads all existing policy bindings
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 myGroup = new dynatrace.UserGroup("my_group", {name: "my_group"});
const envPolicy = new dynatrace.Policy("env_policy", {
name: "my_policy_valid_for_environment_########-####-####-####-############",
environment: "########-####-####-####-############",
statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
const envBindings = new dynatrace.PolicyBindings("env_bindings", {
group: myGroup.id,
environment: "########-####-####-####-############",
policies: [envPolicy.id],
});
const clusterPolicy = new dynatrace.Policy("cluster_policy", {
name: "my_policy_valid_for_all_environments_in_this_cluster",
cluster: "########-####-####-####-############",
statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
const clusterBindings = new dynatrace.PolicyBindings("cluster_bindings", {
group: myGroup.id,
cluster: "########-####-####-####-############",
policies: [clusterPolicy.id],
});
import pulumi
import pulumiverse_dynatrace as dynatrace
my_group = dynatrace.UserGroup("my_group", name="my_group")
env_policy = dynatrace.Policy("env_policy",
name="my_policy_valid_for_environment_########-####-####-####-############",
environment="########-####-####-####-############",
statement_query="ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
env_bindings = dynatrace.PolicyBindings("env_bindings",
group=my_group.id,
environment="########-####-####-####-############",
policies=[env_policy.id])
cluster_policy = dynatrace.Policy("cluster_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\";")
cluster_bindings = dynatrace.PolicyBindings("cluster_bindings",
group=my_group.id,
cluster="########-####-####-####-############",
policies=[cluster_policy.id])
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 {
myGroup, err := dynatrace.NewUserGroup(ctx, "my_group", &dynatrace.UserGroupArgs{
Name: pulumi.String("my_group"),
})
if err != nil {
return err
}
envPolicy, err := dynatrace.NewPolicy(ctx, "env_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
}
_, err = dynatrace.NewPolicyBindings(ctx, "env_bindings", &dynatrace.PolicyBindingsArgs{
Group: myGroup.ID(),
Environment: pulumi.String("########-####-####-####-############"),
Policies: pulumi.StringArray{
envPolicy.ID(),
},
})
if err != nil {
return err
}
clusterPolicy, err := dynatrace.NewPolicy(ctx, "cluster_policy", &dynatrace.PolicyArgs{
Name: pulumi.String("my_policy_valid_for_all_environments_in_this_cluster"),
Cluster: pulumi.String("########-####-####-####-############"),
StatementQuery: pulumi.String("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"),
})
if err != nil {
return err
}
_, err = dynatrace.NewPolicyBindings(ctx, "cluster_bindings", &dynatrace.PolicyBindingsArgs{
Group: myGroup.ID(),
Cluster: pulumi.String("########-####-####-####-############"),
Policies: pulumi.StringArray{
clusterPolicy.ID(),
},
})
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 myGroup = new Dynatrace.UserGroup("my_group", new()
{
Name = "my_group",
});
var envPolicy = new Dynatrace.Policy("env_policy", new()
{
Name = "my_policy_valid_for_environment_########-####-####-####-############",
Environment = "########-####-####-####-############",
StatementQuery = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
});
var envBindings = new Dynatrace.PolicyBindings("env_bindings", new()
{
Group = myGroup.Id,
Environment = "########-####-####-####-############",
Policies = new[]
{
envPolicy.Id,
},
});
var clusterPolicy = new Dynatrace.Policy("cluster_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\";",
});
var clusterBindings = new Dynatrace.PolicyBindings("cluster_bindings", new()
{
Group = myGroup.Id,
Cluster = "########-####-####-####-############",
Policies = new[]
{
clusterPolicy.Id,
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.dynatrace.UserGroup;
import com.pulumi.dynatrace.UserGroupArgs;
import com.pulumi.dynatrace.Policy;
import com.pulumi.dynatrace.PolicyArgs;
import com.pulumi.dynatrace.PolicyBindings;
import com.pulumi.dynatrace.PolicyBindingsArgs;
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 myGroup = new UserGroup("myGroup", UserGroupArgs.builder()
.name("my_group")
.build());
var envPolicy = new Policy("envPolicy", PolicyArgs.builder()
.name("my_policy_valid_for_environment_########-####-####-####-############")
.environment("########-####-####-####-############")
.statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
.build());
var envBindings = new PolicyBindings("envBindings", PolicyBindingsArgs.builder()
.group(myGroup.id())
.environment("########-####-####-####-############")
.policies(envPolicy.id())
.build());
var clusterPolicy = new Policy("clusterPolicy", PolicyArgs.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());
var clusterBindings = new PolicyBindings("clusterBindings", PolicyBindingsArgs.builder()
.group(myGroup.id())
.cluster("########-####-####-####-############")
.policies(clusterPolicy.id())
.build());
}
}
resources:
myGroup:
type: dynatrace:UserGroup
name: my_group
properties:
name: my_group
envPolicy:
type: dynatrace:Policy
name: env_policy
properties:
name: my_policy_valid_for_environment_########-####-####-####-############
environment: '########-####-####-####-############'
statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";
envBindings:
type: dynatrace:PolicyBindings
name: env_bindings
properties:
group: ${myGroup.id}
environment: '########-####-####-####-############'
policies:
- ${envPolicy.id}
clusterPolicy:
type: dynatrace:Policy
name: cluster_policy
properties:
name: my_policy_valid_for_all_environments_in_this_cluster
cluster: '########-####-####-####-############'
statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";
clusterBindings:
type: dynatrace:PolicyBindings
name: cluster_bindings
properties:
group: ${myGroup.id}
cluster: '########-####-####-####-############'
policies:
- ${clusterPolicy.id}
pulumi {
required_providers {
dynatrace = {
source = "pulumi/dynatrace"
}
}
}
resource "dynatrace_usergroup" "my_group" {
name = "my_group"
}
resource "dynatrace_policy" "env_policy" {
name = "my_policy_valid_for_environment_########-####-####-####-############"
environment = "########-####-####-####-############"
statement_query = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";"
}
resource "dynatrace_policybindings" "env_bindings" {
group = dynatrace_usergroup.my_group.id
environment = "########-####-####-####-############"
policies = [dynatrace_policy.env_policy.id]
}
resource "dynatrace_policy" "cluster_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\";"
}
resource "dynatrace_policybindings" "cluster_bindings" {
group = dynatrace_usergroup.my_group.id
cluster = "########-####-####-####-############"
policies = [dynatrace_policy.cluster_policy.id]
}
Policy Bindings to Groups on different levels are required to be specified within separate resources.
The following example would be invalid, because policies the policies to be bound to the group are defined for different levels.
```terraform
resource “dynatrace_user_group” “my_group” {
name = “my_group”
permissions {
…
}
}
resource “dynatrace_policy” “env_policy” {
name = “my_policy_valid_for_environment_########-####-####-####-############”
environment = “########-####-####-####-############”
statement_query = “ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";”
}
resource “dynatrace_policy” “cluster_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";”
}
resource “dynatrace_policy_bindings” “bindings” {
group = dynatrace_user_group.my_group.id
cluster = “########-####-####-####-############”
policies = [dynatrace_policy.cluster_policy.id, dynatrace_policy.env_policy.id] # INVALID, because dynatrace_policy.env_policy is not defined for the cluster level
}
## Schema
### Required
- `group` (String) The name of the policy
- `policies` (Set of String) A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes `cluster` or `environment`.
### Optional
- `cluster` (String) The UUID of the cluster. The attribute `policies` must contain ONLY policies defined for that cluster.
- `environment` (String) The ID of the environment (https://<environmentid>.live.dynatrace.com). The attribute `policies` must contain ONLY policies defined for that environment.
### Read-Only
- `id` (String) The ID of this resource.
Create PolicyBindings Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolicyBindings(name: string, args: PolicyBindingsArgs, opts?: CustomResourceOptions);@overload
def PolicyBindings(resource_name: str,
args: PolicyBindingsArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PolicyBindings(resource_name: str,
opts: Optional[ResourceOptions] = None,
group: Optional[str] = None,
policies: Optional[Sequence[str]] = None,
cluster: Optional[str] = None,
environment: Optional[str] = None)func NewPolicyBindings(ctx *Context, name string, args PolicyBindingsArgs, opts ...ResourceOption) (*PolicyBindings, error)public PolicyBindings(string name, PolicyBindingsArgs args, CustomResourceOptions? opts = null)
public PolicyBindings(String name, PolicyBindingsArgs args)
public PolicyBindings(String name, PolicyBindingsArgs args, CustomResourceOptions options)
type: dynatrace:PolicyBindings
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "dynatrace_policybindings" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args PolicyBindingsArgs
- 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 PolicyBindingsArgs
- 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 PolicyBindingsArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyBindingsArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyBindingsArgs
- 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 policyBindingsResource = new Dynatrace.PolicyBindings("policyBindingsResource", new()
{
Group = "string",
Policies = new[]
{
"string",
},
Cluster = "string",
Environment = "string",
});
example, err := dynatrace.NewPolicyBindings(ctx, "policyBindingsResource", &dynatrace.PolicyBindingsArgs{
Group: pulumi.String("string"),
Policies: pulumi.StringArray{
pulumi.String("string"),
},
Cluster: pulumi.String("string"),
Environment: pulumi.String("string"),
})
resource "dynatrace_policybindings" "policyBindingsResource" {
group = "string"
policies = ["string"]
cluster = "string"
environment = "string"
}
var policyBindingsResource = new PolicyBindings("policyBindingsResource", PolicyBindingsArgs.builder()
.group("string")
.policies("string")
.cluster("string")
.environment("string")
.build());
policy_bindings_resource = dynatrace.PolicyBindings("policyBindingsResource",
group="string",
policies=["string"],
cluster="string",
environment="string")
const policyBindingsResource = new dynatrace.PolicyBindings("policyBindingsResource", {
group: "string",
policies: ["string"],
cluster: "string",
environment: "string",
});
type: dynatrace:PolicyBindings
properties:
cluster: string
environment: string
group: string
policies:
- string
PolicyBindings 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 PolicyBindings resource accepts the following input properties:
- Group string
- The name of the policy
- Policies List<string>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - Cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - Environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- Group string
- The name of the policy
- Policies []string
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - Cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - Environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- group string
- The name of the policy
- policies list(string)
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- group String
- The name of the policy
- policies List<String>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - cluster String
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment String
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- group string
- The name of the policy
- policies string[]
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- group str
- The name of the policy
- policies Sequence[str]
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - cluster str
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment str
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
- group String
- The name of the policy
- policies List<String>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment. - cluster String
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment String
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment.
Outputs
All input properties are implicitly available as output properties. Additionally, the PolicyBindings 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 PolicyBindings Resource
Get an existing PolicyBindings 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?: PolicyBindingsState, opts?: CustomResourceOptions): PolicyBindings@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cluster: Optional[str] = None,
environment: Optional[str] = None,
group: Optional[str] = None,
policies: Optional[Sequence[str]] = None) -> PolicyBindingsfunc GetPolicyBindings(ctx *Context, name string, id IDInput, state *PolicyBindingsState, opts ...ResourceOption) (*PolicyBindings, error)public static PolicyBindings Get(string name, Input<string> id, PolicyBindingsState? state, CustomResourceOptions? opts = null)public static PolicyBindings get(String name, Output<String> id, PolicyBindingsState state, CustomResourceOptions options)resources: _: type: dynatrace:PolicyBindings get: id: ${id}import {
to = dynatrace_policybindings.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. The attribute
policiesmust contain ONLY policies defined for that cluster. - Environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - Group string
- The name of the policy
- Policies List<string>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- Cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - Environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - Group string
- The name of the policy
- Policies []string
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - group string
- The name of the policy
- policies list(string)
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- cluster String
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment String
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - group String
- The name of the policy
- policies List<String>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- cluster string
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment string
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - group string
- The name of the policy
- policies string[]
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- cluster str
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment str
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - group str
- The name of the policy
- policies Sequence[str]
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
- cluster String
- The UUID of the cluster. The attribute
policiesmust contain ONLY policies defined for that cluster. - environment String
- The ID of the environment (https://.live.dynatrace.com). The attribute
policiesmust contain ONLY policies defined for that environment. - group String
- The name of the policy
- policies List<String>
- A list of IDs referring to policies bound to that group. It's not possible to mix policies here that are defined for different scopes (different clusters or environments) than specified via attributes
clusterorenvironment.
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