1. Packages
  2. Dynatrace
  3. API Docs
  4. IamPolicy
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

dynatrace.IamPolicy

Explore with Pulumi AI

dynatrace logo
Dynatrace v0.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse

    This resource is excluded by default in the export utility since it is part of the account management API. You can, of course, specify that resource explicitly in order to export it. In that case, don’t forget to specify the environment variables DT_CLIENT_ID, DT_ACCOUNT_ID and DT_CLIENT_SECRET for authentication.

    This resource requires the OAuth client permissions Allow IAM policy configuration for environments (iam-policies-management) and View environments (account-env-read)

    Dynatrace Documentation

    • Dynatrace IAM Policy Management - https://www.dynatrace.com/support/help/manage/access-control/user-management-and-sso/manage-groups-and-permissions/iam/iam-policy-mgt

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

    Prerequisites

    Using this resource requires an OAuth client to be configured within your account settings. The scopes of the OAuth Client need to include account-idm-read, account-idm-write, account-env-read, account-env-write, iam-policies-management, iam:policies:write, iam:policies:read, iam:bindings:write, iam:bindings:read and iam:effective-permissions:read.

    Finally the provider configuration requires the credentials for that OAuth Client. The configuration section of your provider needs to look like this.

    import * as pulumi from "@pulumi/pulumi";
    
    import pulumi
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    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) {
        }
    }
    
    {}
    

    Resource Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    const policy = new dynatrace.IamPolicy("policy", {
        environment: "siz654##",
        statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
    });
    
    import pulumi
    import pulumiverse_dynatrace as dynatrace
    
    policy = dynatrace.IamPolicy("policy",
        environment="siz654##",
        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{
    			Environment:    pulumi.String("siz654##"),
    			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()
        {
            Environment = "siz654##",
            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.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 policy = new IamPolicy("policy", IamPolicyArgs.builder()
                .environment("siz654##")
                .statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
                .build());
    
        }
    }
    
    resources:
      policy:
        type: dynatrace:IamPolicy
        properties:
          environment: siz654##
          statementQuery: 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", {
        account: "########-####-####-####-############",
        statementQuery: "ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";",
    });
    
    import pulumi
    import pulumiverse_dynatrace as dynatrace
    
    policy = dynatrace.IamPolicy("policy",
        account="########-####-####-####-############",
        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{
    			Account:        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.IamPolicy("policy", new()
        {
            Account = "########-####-####-####-############",
            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.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 policy = new IamPolicy("policy", IamPolicyArgs.builder()
                .account("########-####-####-####-############")
                .statementQuery("ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = \"string\";")
                .build());
    
        }
    }
    
    resources:
      policy:
        type: dynatrace:IamPolicy
        properties:
          account: '########-####-####-####-############'
          statementQuery: ALLOW settings:objects:read, settings:schemas:read WHERE settings:schemaId = "string";
    

    Create IamPolicy Resource

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

    Constructor syntax

    new IamPolicy(name: string, args: IamPolicyArgs, opts?: CustomResourceOptions);
    @overload
    def IamPolicy(resource_name: str,
                  args: IamPolicyArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def IamPolicy(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  statement_query: Optional[str] = None,
                  account: Optional[str] = None,
                  description: Optional[str] = None,
                  environment: Optional[str] = None,
                  name: Optional[str] = None,
                  tags: Optional[Sequence[str]] = None)
    func NewIamPolicy(ctx *Context, name string, args IamPolicyArgs, opts ...ResourceOption) (*IamPolicy, error)
    public IamPolicy(string name, IamPolicyArgs args, CustomResourceOptions? opts = null)
    public IamPolicy(String name, IamPolicyArgs args)
    public IamPolicy(String name, IamPolicyArgs args, CustomResourceOptions options)
    
    type: dynatrace:IamPolicy
    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 IamPolicyArgs
    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 IamPolicyArgs
    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 IamPolicyArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IamPolicyArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IamPolicyArgs
    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 iamPolicyResource = new Dynatrace.IamPolicy("iamPolicyResource", new()
    {
        StatementQuery = "string",
        Account = "string",
        Description = "string",
        Name = "string",
        Tags = new[]
        {
            "string",
        },
    });
    
    example, err := dynatrace.NewIamPolicy(ctx, "iamPolicyResource", &dynatrace.IamPolicyArgs{
    	StatementQuery: pulumi.String("string"),
    	Account:        pulumi.String("string"),
    	Description:    pulumi.String("string"),
    	Name:           pulumi.String("string"),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var iamPolicyResource = new IamPolicy("iamPolicyResource", IamPolicyArgs.builder()
        .statementQuery("string")
        .account("string")
        .description("string")
        .name("string")
        .tags("string")
        .build());
    
    iam_policy_resource = dynatrace.IamPolicy("iamPolicyResource",
        statement_query="string",
        account="string",
        description="string",
        name="string",
        tags=["string"])
    
    const iamPolicyResource = new dynatrace.IamPolicy("iamPolicyResource", {
        statementQuery: "string",
        account: "string",
        description: "string",
        name: "string",
        tags: ["string"],
    });
    
    type: dynatrace:IamPolicy
    properties:
        account: string
        description: string
        name: string
        statementQuery: string
        tags:
            - string
    

    IamPolicy Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The IamPolicy resource accepts the following input properties:

    StatementQuery string
    The Statement Query of the policy
    Account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    Description string
    An optional description text for the policy
    Environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    Name string
    The name of the policy
    Tags List<string>
    Tags for this policy
    StatementQuery string
    The Statement Query of the policy
    Account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    Description string
    An optional description text for the policy
    Environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    Name string
    The name of the policy
    Tags []string
    Tags for this policy
    statementQuery String
    The Statement Query of the policy
    account String
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description String
    An optional description text for the policy
    environment String
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name String
    The name of the policy
    tags List<String>
    Tags for this policy
    statementQuery string
    The Statement Query of the policy
    account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description string
    An optional description text for the policy
    environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name string
    The name of the policy
    tags string[]
    Tags for this policy
    statement_query str
    The Statement Query of the policy
    account str
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description str
    An optional description text for the policy
    environment str
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name str
    The name of the policy
    tags Sequence[str]
    Tags for this policy
    statementQuery String
    The Statement Query of the policy
    account String
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description String
    An optional description text for the policy
    environment String
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name String
    The name of the policy
    tags List<String>
    Tags for this policy

    Outputs

    All input properties are implicitly available as output properties. Additionally, the IamPolicy resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    Id string
    The provider-assigned unique ID for this managed resource.
    Uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    id string
    The provider-assigned unique ID for this managed resource.
    uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    id str
    The provider-assigned unique ID for this managed resource.
    uuid str
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    id String
    The provider-assigned unique ID for this managed resource.
    uuid String
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though

    Look up Existing IamPolicy Resource

    Get an existing IamPolicy 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?: IamPolicyState, opts?: CustomResourceOptions): IamPolicy
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            account: 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,
            uuid: Optional[str] = None) -> IamPolicy
    func GetIamPolicy(ctx *Context, name string, id IDInput, state *IamPolicyState, opts ...ResourceOption) (*IamPolicy, error)
    public static IamPolicy Get(string name, Input<string> id, IamPolicyState? state, CustomResourceOptions? opts = null)
    public static IamPolicy get(String name, Output<String> id, IamPolicyState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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:
    Account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    Description string
    An optional description text for the policy
    Environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    Name string
    The name of the policy
    StatementQuery string
    The Statement Query of the policy
    Tags List<string>
    Tags for this policy
    Uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    Account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    Description string
    An optional description text for the policy
    Environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    Name string
    The name of the policy
    StatementQuery string
    The Statement Query of the policy
    Tags []string
    Tags for this policy
    Uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    account String
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description String
    An optional description text for the policy
    environment String
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name String
    The name of the policy
    statementQuery String
    The Statement Query of the policy
    tags List<String>
    Tags for this policy
    uuid String
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    account string
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description string
    An optional description text for the policy
    environment string
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name string
    The name of the policy
    statementQuery string
    The Statement Query of the policy
    tags string[]
    Tags for this policy
    uuid string
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    account str
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description str
    An optional description text for the policy
    environment str
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name str
    The name of the policy
    statement_query str
    The Statement Query of the policy
    tags Sequence[str]
    Tags for this policy
    uuid str
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though
    account String
    The UUID of the account (urn:dtaccount:<account-uuid>) in case the policy should be applied to all environments of this account. The prefix urn:dtaccount: MUST be omitted here.
    description String
    An optional description text for the policy
    environment String
    The ID of the environment (https://\n\n.live.dynatrace.com) if the policy should be applied to a specific environment

    Deprecated: Configuring policies on environment level has been deprecated by Dynatrace. Please consider creating an account wide policy instead

    name String
    The name of the policy
    statementQuery String
    The Statement Query of the policy
    tags List<String>
    Tags for this policy
    uuid String
    The ID of this resource is a concatenation of multiple pieces of information (policy UUID, accountID, environmentID, ...). There are use cases where you JUST need the UUID of the Policy, though

    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.16.0 published on Tuesday, Sep 10, 2024 by Pulumiverse