1. Packages
  2. Dynatrace
  3. API Docs
  4. IamPolicyBoundary
Dynatrace v0.27.0 published on Friday, Mar 21, 2025 by Pulumiverse

dynatrace.IamPolicyBoundary

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.27.0 published on Friday, Mar 21, 2025 by Pulumiverse

    Dynatrace SaaS only

    To utilize this resource, please define the environment variables DT_CLIENT_ID, DT_CLIENT_SECRET, DT_ACCOUNT_ID with an OAuth client including the following permissions: Allow IAM policy configuration for environments (iam-policies-management) and View environments (account-env-read).

    This resource is excluded by default in the export utility, please explicitly specify the resource to retrieve existing configuration.

    Dynatrace Documentation

    • Dynatrace IAM Group Permissions - https://docs.dynatrace.com/docs/manage/identity-access-management/permission-management/manage-user-permissions-policies

    • Settings API - https://www.dynatrace.com/support/help/how-to-use-dynatrace/user-management-and-sso/manage-groups-and-permissions/iam/iam-getting-started

    Resource Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    const thisIamPolicyBoundary = new dynatrace.IamPolicyBoundary("thisIamPolicyBoundary", {query: "environment:management-zone startsWith \"[Foo]\";"});
    const thisIamGroup = new dynatrace.IamGroup("thisIamGroup", {});
    const thisIamPolicy = new dynatrace.IamPolicy("thisIamPolicy", {
        account: "########-####-####-####-############",
        statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"#########\";",
    });
    const thisIamPolicyBindingsV2 = new dynatrace.IamPolicyBindingsV2("thisIamPolicyBindingsV2", {
        environment: "########",
        group: thisIamGroup.id,
        policies: [{
            id: thisIamPolicy.id,
            boundaries: [thisIamPolicyBoundary.id],
        }],
    });
    
    import pulumi
    import pulumiverse_dynatrace as dynatrace
    
    this_iam_policy_boundary = dynatrace.IamPolicyBoundary("thisIamPolicyBoundary", query="environment:management-zone startsWith \"[Foo]\";")
    this_iam_group = dynatrace.IamGroup("thisIamGroup")
    this_iam_policy = dynatrace.IamPolicy("thisIamPolicy",
        account="########-####-####-####-############",
        statement_query="ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"#########\";")
    this_iam_policy_bindings_v2 = dynatrace.IamPolicyBindingsV2("thisIamPolicyBindingsV2",
        environment="########",
        group=this_iam_group.id,
        policies=[{
            "id": this_iam_policy.id,
            "boundaries": [this_iam_policy_boundary.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 {
    		thisIamPolicyBoundary, err := dynatrace.NewIamPolicyBoundary(ctx, "thisIamPolicyBoundary", &dynatrace.IamPolicyBoundaryArgs{
    			Query: pulumi.String("environment:management-zone startsWith \"[Foo]\";"),
    		})
    		if err != nil {
    			return err
    		}
    		thisIamGroup, err := dynatrace.NewIamGroup(ctx, "thisIamGroup", nil)
    		if err != nil {
    			return err
    		}
    		thisIamPolicy, err := dynatrace.NewIamPolicy(ctx, "thisIamPolicy", &dynatrace.IamPolicyArgs{
    			Account:        pulumi.String("########-####-####-####-############"),
    			StatementQuery: pulumi.String("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"#########\";"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.NewIamPolicyBindingsV2(ctx, "thisIamPolicyBindingsV2", &dynatrace.IamPolicyBindingsV2Args{
    			Environment: pulumi.String("########"),
    			Group:       thisIamGroup.ID(),
    			Policies: dynatrace.IamPolicyBindingsV2PolicyArray{
    				&dynatrace.IamPolicyBindingsV2PolicyArgs{
    					Id: thisIamPolicy.ID(),
    					Boundaries: pulumi.StringArray{
    						thisIamPolicyBoundary.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 thisIamPolicyBoundary = new Dynatrace.IamPolicyBoundary("thisIamPolicyBoundary", new()
        {
            Query = "environment:management-zone startsWith \"[Foo]\";",
        });
    
        var thisIamGroup = new Dynatrace.IamGroup("thisIamGroup");
    
        var thisIamPolicy = new Dynatrace.IamPolicy("thisIamPolicy", new()
        {
            Account = "########-####-####-####-############",
            StatementQuery = "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"#########\";",
        });
    
        var thisIamPolicyBindingsV2 = new Dynatrace.IamPolicyBindingsV2("thisIamPolicyBindingsV2", new()
        {
            Environment = "########",
            Group = thisIamGroup.Id,
            Policies = new[]
            {
                new Dynatrace.Inputs.IamPolicyBindingsV2PolicyArgs
                {
                    Id = thisIamPolicy.Id,
                    Boundaries = new[]
                    {
                        thisIamPolicyBoundary.Id,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.IamPolicyBoundary;
    import com.pulumi.dynatrace.IamPolicyBoundaryArgs;
    import com.pulumi.dynatrace.IamGroup;
    import com.pulumi.dynatrace.IamPolicy;
    import com.pulumi.dynatrace.IamPolicyArgs;
    import com.pulumi.dynatrace.IamPolicyBindingsV2;
    import com.pulumi.dynatrace.IamPolicyBindingsV2Args;
    import com.pulumi.dynatrace.inputs.IamPolicyBindingsV2PolicyArgs;
    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 thisIamPolicyBoundary = new IamPolicyBoundary("thisIamPolicyBoundary", IamPolicyBoundaryArgs.builder()
                .query("environment:management-zone startsWith \"[Foo]\";")
                .build());
    
            var thisIamGroup = new IamGroup("thisIamGroup");
    
            var thisIamPolicy = new IamPolicy("thisIamPolicy", IamPolicyArgs.builder()
                .account("########-####-####-####-############")
                .statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"#########\";")
                .build());
    
            var thisIamPolicyBindingsV2 = new IamPolicyBindingsV2("thisIamPolicyBindingsV2", IamPolicyBindingsV2Args.builder()
                .environment("########")
                .group(thisIamGroup.id())
                .policies(IamPolicyBindingsV2PolicyArgs.builder()
                    .id(thisIamPolicy.id())
                    .boundaries(thisIamPolicyBoundary.id())
                    .build())
                .build());
    
        }
    }
    
    resources:
      thisIamPolicyBoundary:
        type: dynatrace:IamPolicyBoundary
        properties:
          query: environment:management-zone startsWith "[Foo]";
      thisIamPolicyBindingsV2:
        type: dynatrace:IamPolicyBindingsV2
        properties:
          environment: '########'
          group: ${thisIamGroup.id}
          policies:
            - id: ${thisIamPolicy.id}
              boundaries:
                - ${thisIamPolicyBoundary.id}
      thisIamGroup:
        type: dynatrace:IamGroup
      thisIamPolicy:
        type: dynatrace:IamPolicy
        properties:
          account: '########-####-####-####-############'
          statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "#########";
    

    Create IamPolicyBoundary Resource

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

    Constructor syntax

    new IamPolicyBoundary(name: string, args: IamPolicyBoundaryArgs, opts?: CustomResourceOptions);
    @overload
    def IamPolicyBoundary(resource_name: str,
                          args: IamPolicyBoundaryArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamPolicyBoundary(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          query: Optional[str] = None,
                          name: Optional[str] = None)
    func NewIamPolicyBoundary(ctx *Context, name string, args IamPolicyBoundaryArgs, opts ...ResourceOption) (*IamPolicyBoundary, error)
    public IamPolicyBoundary(string name, IamPolicyBoundaryArgs args, CustomResourceOptions? opts = null)
    public IamPolicyBoundary(String name, IamPolicyBoundaryArgs args)
    public IamPolicyBoundary(String name, IamPolicyBoundaryArgs args, CustomResourceOptions options)
    
    type: dynatrace:IamPolicyBoundary
    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 IamPolicyBoundaryArgs
    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 IamPolicyBoundaryArgs
    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 IamPolicyBoundaryArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamPolicyBoundaryArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamPolicyBoundaryArgs
    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 iamPolicyBoundaryResource = new Dynatrace.IamPolicyBoundary("iamPolicyBoundaryResource", new()
    {
        Query = "string",
        Name = "string",
    });
    
    example, err := dynatrace.NewIamPolicyBoundary(ctx, "iamPolicyBoundaryResource", &dynatrace.IamPolicyBoundaryArgs{
    	Query: pulumi.String("string"),
    	Name:  pulumi.String("string"),
    })
    
    var iamPolicyBoundaryResource = new IamPolicyBoundary("iamPolicyBoundaryResource", IamPolicyBoundaryArgs.builder()
        .query("string")
        .name("string")
        .build());
    
    iam_policy_boundary_resource = dynatrace.IamPolicyBoundary("iamPolicyBoundaryResource",
        query="string",
        name="string")
    
    const iamPolicyBoundaryResource = new dynatrace.IamPolicyBoundary("iamPolicyBoundaryResource", {
        query: "string",
        name: "string",
    });
    
    type: dynatrace:IamPolicyBoundary
    properties:
        name: string
        query: string
    

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

    Query string
    The boundary query
    Name string
    The name of the policy
    Query string
    The boundary query
    Name string
    The name of the policy
    query String
    The boundary query
    name String
    The name of the policy
    query string
    The boundary query
    name string
    The name of the policy
    query str
    The boundary query
    name str
    The name of the policy
    query String
    The boundary query
    name String
    The name of the policy

    Outputs

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

    Get an existing IamPolicyBoundary 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?: IamPolicyBoundaryState, opts?: CustomResourceOptions): IamPolicyBoundary
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            name: Optional[str] = None,
            query: Optional[str] = None) -> IamPolicyBoundary
    func GetIamPolicyBoundary(ctx *Context, name string, id IDInput, state *IamPolicyBoundaryState, opts ...ResourceOption) (*IamPolicyBoundary, error)
    public static IamPolicyBoundary Get(string name, Input<string> id, IamPolicyBoundaryState? state, CustomResourceOptions? opts = null)
    public static IamPolicyBoundary get(String name, Output<String> id, IamPolicyBoundaryState state, CustomResourceOptions options)
    resources:  _:    type: dynatrace:IamPolicyBoundary    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:
    Name string
    The name of the policy
    Query string
    The boundary query
    Name string
    The name of the policy
    Query string
    The boundary query
    name String
    The name of the policy
    query String
    The boundary query
    name string
    The name of the policy
    query string
    The boundary query
    name str
    The name of the policy
    query str
    The boundary query
    name String
    The name of the policy
    query String
    The boundary query

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Dynatrace v0.27.0 published on Friday, Mar 21, 2025 by Pulumiverse