1. Packages
  2. Packages
  3. Dynatrace
  4. API Docs
  5. DirectShares
Viewing docs for Dynatrace v0.36.0
published on Tuesday, Jun 9, 2026 by Pulumiverse
dynatrace logo
Viewing docs for Dynatrace v0.36.0
published on Tuesday, Jun 9, 2026 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: Read direct-shares (document:direct-shares:read), Write direct-shares (document:direct-shares:write), and Delete direct-shares (document:direct-shares:delete).

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

    Dynatrace Documentation

    • Dynatrace Documents - https://########.apps.dynatrace.com/platform/swagger-ui/index.html?urls.primaryName=Document%20Service

    Export Example Usage

    • terraform-provider-dynatrace -export dynatrace.DirectShares downloads all existing direct shares configurations for documents.

    Resource Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as dynatrace from "@pulumiverse/dynatrace";
    
    const thisDocument = new dynatrace.Document("this", {
        type: "dashboard",
        name: "#name#",
        content: JSON.stringify({
            version: 1,
            variables: [],
            tiles: {
                "0": {
                    type: "markdown",
                    title: "",
                    content: "Dashboard content",
                },
            },
            layouts: {
                "0": {
                    x: 0,
                    y: 0,
                    w: 24,
                    h: 14,
                },
            },
        }),
    });
    const sampleServiceUser = new dynatrace.IamServiceUser("sample_service_user", {
        name: "#name#",
        description: "Service user that can access the dashboard",
    });
    const sampleGroup = new dynatrace.IamGroup("sample_group", {
        name: "#name#",
        description: "Group that can acccess the dashboard",
    });
    const _this = new dynatrace.DirectShares("this", {
        documentId: thisDocument.id,
        access: "read-write",
        recipients: {
            recipients: [
                {
                    id: sampleServiceUser.id,
                    type: "user",
                },
                {
                    id: sampleGroup.id,
                    type: "group",
                },
            ],
        },
    });
    
    import pulumi
    import json
    import pulumiverse_dynatrace as dynatrace
    
    this_document = dynatrace.Document("this",
        type="dashboard",
        name="#name#",
        content=json.dumps({
            "version": 1,
            "variables": [],
            "tiles": {
                "0": {
                    "type": "markdown",
                    "title": "",
                    "content": "Dashboard content",
                },
            },
            "layouts": {
                "0": {
                    "x": 0,
                    "y": 0,
                    "w": 24,
                    "h": 14,
                },
            },
        }))
    sample_service_user = dynatrace.IamServiceUser("sample_service_user",
        name="#name#",
        description="Service user that can access the dashboard")
    sample_group = dynatrace.IamGroup("sample_group",
        name="#name#",
        description="Group that can acccess the dashboard")
    this = dynatrace.DirectShares("this",
        document_id=this_document.id,
        access="read-write",
        recipients={
            "recipients": [
                {
                    "id": sample_service_user.id,
                    "type": "user",
                },
                {
                    "id": sample_group.id,
                    "type": "group",
                },
            ],
        })
    
    package main
    
    import (
    	"encoding/json"
    
    	"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 {
    		tmpJSON0, err := json.Marshal(map[string]interface{}{
    			"version":   1,
    			"variables": []interface{}{},
    			"tiles": map[string]interface{}{
    				"0": map[string]interface{}{
    					"type":    "markdown",
    					"title":   "",
    					"content": "Dashboard content",
    				},
    			},
    			"layouts": map[string]interface{}{
    				"0": map[string]interface{}{
    					"x": 0,
    					"y": 0,
    					"w": 24,
    					"h": 14,
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		json0 := string(tmpJSON0)
    		thisDocument, err := dynatrace.NewDocument(ctx, "this", &dynatrace.DocumentArgs{
    			Type:    pulumi.String("dashboard"),
    			Name:    pulumi.String("#name#"),
    			Content: pulumi.String(pulumi.String(json0)),
    		})
    		if err != nil {
    			return err
    		}
    		sampleServiceUser, err := dynatrace.NewIamServiceUser(ctx, "sample_service_user", &dynatrace.IamServiceUserArgs{
    			Name:        pulumi.String("#name#"),
    			Description: pulumi.String("Service user that can access the dashboard"),
    		})
    		if err != nil {
    			return err
    		}
    		sampleGroup, err := dynatrace.NewIamGroup(ctx, "sample_group", &dynatrace.IamGroupArgs{
    			Name:        pulumi.String("#name#"),
    			Description: pulumi.String("Group that can acccess the dashboard"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = dynatrace.NewDirectShares(ctx, "this", &dynatrace.DirectSharesArgs{
    			DocumentId: thisDocument.ID(),
    			Access:     pulumi.String("read-write"),
    			Recipients: &dynatrace.DirectSharesRecipientsArgs{
    				Recipients: dynatrace.DirectSharesRecipientsRecipientArray{
    					&dynatrace.DirectSharesRecipientsRecipientArgs{
    						Id:   sampleServiceUser.ID(),
    						Type: pulumi.String("user"),
    					},
    					&dynatrace.DirectSharesRecipientsRecipientArgs{
    						Id:   sampleGroup.ID(),
    						Type: pulumi.String("group"),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using System.Text.Json;
    using Pulumi;
    using Dynatrace = Pulumiverse.Dynatrace;
    
    return await Deployment.RunAsync(() => 
    {
        var thisDocument = new Dynatrace.Document("this", new()
        {
            Type = "dashboard",
            Name = "#name#",
            Content = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                ["version"] = 1,
                ["variables"] = new[]
                {
                },
                ["tiles"] = new Dictionary<string, object?>
                {
                    ["0"] = new Dictionary<string, object?>
                    {
                        ["type"] = "markdown",
                        ["title"] = "",
                        ["content"] = "Dashboard content",
                    },
                },
                ["layouts"] = new Dictionary<string, object?>
                {
                    ["0"] = new Dictionary<string, object?>
                    {
                        ["x"] = 0,
                        ["y"] = 0,
                        ["w"] = 24,
                        ["h"] = 14,
                    },
                },
            }),
        });
    
        var sampleServiceUser = new Dynatrace.IamServiceUser("sample_service_user", new()
        {
            Name = "#name#",
            Description = "Service user that can access the dashboard",
        });
    
        var sampleGroup = new Dynatrace.IamGroup("sample_group", new()
        {
            Name = "#name#",
            Description = "Group that can acccess the dashboard",
        });
    
        var @this = new Dynatrace.DirectShares("this", new()
        {
            DocumentId = thisDocument.Id,
            Access = "read-write",
            Recipients = new Dynatrace.Inputs.DirectSharesRecipientsArgs
            {
                Recipients = new[]
                {
                    new Dynatrace.Inputs.DirectSharesRecipientsRecipientArgs
                    {
                        Id = sampleServiceUser.Id,
                        Type = "user",
                    },
                    new Dynatrace.Inputs.DirectSharesRecipientsRecipientArgs
                    {
                        Id = sampleGroup.Id,
                        Type = "group",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.dynatrace.Document;
    import com.pulumi.dynatrace.DocumentArgs;
    import com.pulumi.dynatrace.IamServiceUser;
    import com.pulumi.dynatrace.IamServiceUserArgs;
    import com.pulumi.dynatrace.IamGroup;
    import com.pulumi.dynatrace.IamGroupArgs;
    import com.pulumi.dynatrace.DirectShares;
    import com.pulumi.dynatrace.DirectSharesArgs;
    import com.pulumi.dynatrace.inputs.DirectSharesRecipientsArgs;
    import static com.pulumi.codegen.internal.Serialization.*;
    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 thisDocument = new Document("thisDocument", DocumentArgs.builder()
                .type("dashboard")
                .name("#name#")
                .content(serializeJson(
                    jsonObject(
                        jsonProperty("version", 1),
                        jsonProperty("variables", jsonArray(
                        )),
                        jsonProperty("tiles", jsonObject(
                            jsonProperty("0", jsonObject(
                                jsonProperty("type", "markdown"),
                                jsonProperty("title", ""),
                                jsonProperty("content", "Dashboard content")
                            ))
                        )),
                        jsonProperty("layouts", jsonObject(
                            jsonProperty("0", jsonObject(
                                jsonProperty("x", 0),
                                jsonProperty("y", 0),
                                jsonProperty("w", 24),
                                jsonProperty("h", 14)
                            ))
                        ))
                    )))
                .build());
    
            var sampleServiceUser = new IamServiceUser("sampleServiceUser", IamServiceUserArgs.builder()
                .name("#name#")
                .description("Service user that can access the dashboard")
                .build());
    
            var sampleGroup = new IamGroup("sampleGroup", IamGroupArgs.builder()
                .name("#name#")
                .description("Group that can acccess the dashboard")
                .build());
    
            var this_ = new DirectShares("this", DirectSharesArgs.builder()
                .documentId(thisDocument.id())
                .access("read-write")
                .recipients(DirectSharesRecipientsArgs.builder()
                    .recipients(                
                        DirectSharesRecipientsRecipientArgs.builder()
                            .id(sampleServiceUser.id())
                            .type("user")
                            .build(),
                        DirectSharesRecipientsRecipientArgs.builder()
                            .id(sampleGroup.id())
                            .type("group")
                            .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      this:
        type: dynatrace:DirectShares
        properties:
          documentId: ${thisDocument.id}
          access: read-write
          recipients:
            recipients:
              - id: ${sampleServiceUser.id}
                type: user
              - id: ${sampleGroup.id}
                type: group
      thisDocument:
        type: dynatrace:Document
        name: this
        properties:
          type: dashboard
          name: '#name#'
          content:
            fn::toJSON:
              version: 1
              variables: []
              tiles:
                '0':
                  type: markdown
                  title: ""
                  content: Dashboard content
              layouts:
                '0':
                  x: 0
                  y: 0
                  w: 24
                  h: 14
      sampleServiceUser:
        type: dynatrace:IamServiceUser
        name: sample_service_user
        properties:
          name: '#name#'
          description: Service user that can access the dashboard
      sampleGroup:
        type: dynatrace:IamGroup
        name: sample_group
        properties:
          name: '#name#'
          description: Group that can acccess the dashboard
    
    pulumi {
      required_providers {
        dynatrace = {
          source = "pulumi/dynatrace"
        }
      }
    }
    
    resource "dynatrace_directshares" "this" {
      document_id = dynatrace_document.this.id
      access      = "read-write"
      recipients = {
        recipients = [{
          "id"   = dynatrace_iamserviceuser.sample_service_user.id
          "type" = "user"
          }, {
          "id"   = dynatrace_iamgroup.sample_group.id
          "type" = "group"
        }]
      }
    }
    resource "dynatrace_document" "this" {
      type = "dashboard"
      name = "#name#"
      content = jsonencode({
        "version"   = 1
        "variables" = []
        "tiles" = {
          "0" = {
            "type"    = "markdown"
            "title"   = ""
            "content" = "Dashboard content"
          }
        }
        "layouts" = {
          "0" = {
            "x" = 0
            "y" = 0
            "w" = 24
            "h" = 14
          }
        }
      })
    }
    resource "dynatrace_iamserviceuser" "sample_service_user" {
      name        = "#name#"
      description = "Service user that can access the dashboard"
    }
    resource "dynatrace_iamgroup" "sample_group" {
      name        = "#name#"
      description = "Group that can acccess the dashboard"
    }
    

    Create DirectShares Resource

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

    Constructor syntax

    new DirectShares(name: string, args: DirectSharesArgs, opts?: CustomResourceOptions);
    @overload
    def DirectShares(resource_name: str,
                     args: DirectSharesArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def DirectShares(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     document_id: Optional[str] = None,
                     access: Optional[str] = None,
                     recipients: Optional[DirectSharesRecipientsArgs] = None)
    func NewDirectShares(ctx *Context, name string, args DirectSharesArgs, opts ...ResourceOption) (*DirectShares, error)
    public DirectShares(string name, DirectSharesArgs args, CustomResourceOptions? opts = null)
    public DirectShares(String name, DirectSharesArgs args)
    public DirectShares(String name, DirectSharesArgs args, CustomResourceOptions options)
    
    type: dynatrace:DirectShares
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "dynatrace_directshares" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args DirectSharesArgs
    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 DirectSharesArgs
    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 DirectSharesArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args DirectSharesArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args DirectSharesArgs
    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 directSharesResource = new Dynatrace.DirectShares("directSharesResource", new()
    {
        DocumentId = "string",
        Access = "string",
        Recipients = new Dynatrace.Inputs.DirectSharesRecipientsArgs
        {
            Recipients = new[]
            {
                new Dynatrace.Inputs.DirectSharesRecipientsRecipientArgs
                {
                    Id = "string",
                    Type = "string",
                },
            },
        },
    });
    
    example, err := dynatrace.NewDirectShares(ctx, "directSharesResource", &dynatrace.DirectSharesArgs{
    	DocumentId: pulumi.String("string"),
    	Access:     pulumi.String("string"),
    	Recipients: &dynatrace.DirectSharesRecipientsArgs{
    		Recipients: dynatrace.DirectSharesRecipientsRecipientArray{
    			&dynatrace.DirectSharesRecipientsRecipientArgs{
    				Id:   pulumi.String("string"),
    				Type: pulumi.String("string"),
    			},
    		},
    	},
    })
    
    resource "dynatrace_directshares" "directSharesResource" {
      document_id = "string"
      access      = "string"
      recipients = {
        recipients = [{
          "id"   = "string"
          "type" = "string"
        }]
      }
    }
    
    var directSharesResource = new DirectShares("directSharesResource", DirectSharesArgs.builder()
        .documentId("string")
        .access("string")
        .recipients(DirectSharesRecipientsArgs.builder()
            .recipients(DirectSharesRecipientsRecipientArgs.builder()
                .id("string")
                .type("string")
                .build())
            .build())
        .build());
    
    direct_shares_resource = dynatrace.DirectShares("directSharesResource",
        document_id="string",
        access="string",
        recipients={
            "recipients": [{
                "id": "string",
                "type": "string",
            }],
        })
    
    const directSharesResource = new dynatrace.DirectShares("directSharesResource", {
        documentId: "string",
        access: "string",
        recipients: {
            recipients: [{
                id: "string",
                type: "string",
            }],
        },
    });
    
    type: dynatrace:DirectShares
    properties:
        access: string
        documentId: string
        recipients:
            recipients:
                - id: string
                  type: string
    

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

    DocumentId string
    Document ID
    Access string
    Access grants. Possible values are read and read-write
    Recipients Pulumiverse.Dynatrace.Inputs.DirectSharesRecipients
    Recipients of the direct share
    DocumentId string
    Document ID
    Access string
    Access grants. Possible values are read and read-write
    Recipients DirectSharesRecipientsArgs
    Recipients of the direct share
    document_id string
    Document ID
    access string
    Access grants. Possible values are read and read-write
    recipients object
    Recipients of the direct share
    documentId String
    Document ID
    access String
    Access grants. Possible values are read and read-write
    recipients DirectSharesRecipients
    Recipients of the direct share
    documentId string
    Document ID
    access string
    Access grants. Possible values are read and read-write
    recipients DirectSharesRecipients
    Recipients of the direct share
    document_id str
    Document ID
    access str
    Access grants. Possible values are read and read-write
    recipients DirectSharesRecipientsArgs
    Recipients of the direct share
    documentId String
    Document ID
    access String
    Access grants. Possible values are read and read-write
    recipients Property Map
    Recipients of the direct share

    Outputs

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

    Get an existing DirectShares 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?: DirectSharesState, opts?: CustomResourceOptions): DirectShares
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            access: Optional[str] = None,
            document_id: Optional[str] = None,
            recipients: Optional[DirectSharesRecipientsArgs] = None) -> DirectShares
    func GetDirectShares(ctx *Context, name string, id IDInput, state *DirectSharesState, opts ...ResourceOption) (*DirectShares, error)
    public static DirectShares Get(string name, Input<string> id, DirectSharesState? state, CustomResourceOptions? opts = null)
    public static DirectShares get(String name, Output<String> id, DirectSharesState state, CustomResourceOptions options)
    resources:  _:    type: dynatrace:DirectShares    get:      id: ${id}
    import {
      to = dynatrace_directshares.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.
    The following state arguments are supported:
    Access string
    Access grants. Possible values are read and read-write
    DocumentId string
    Document ID
    Recipients Pulumiverse.Dynatrace.Inputs.DirectSharesRecipients
    Recipients of the direct share
    Access string
    Access grants. Possible values are read and read-write
    DocumentId string
    Document ID
    Recipients DirectSharesRecipientsArgs
    Recipients of the direct share
    access string
    Access grants. Possible values are read and read-write
    document_id string
    Document ID
    recipients object
    Recipients of the direct share
    access String
    Access grants. Possible values are read and read-write
    documentId String
    Document ID
    recipients DirectSharesRecipients
    Recipients of the direct share
    access string
    Access grants. Possible values are read and read-write
    documentId string
    Document ID
    recipients DirectSharesRecipients
    Recipients of the direct share
    access str
    Access grants. Possible values are read and read-write
    document_id str
    Document ID
    recipients DirectSharesRecipientsArgs
    Recipients of the direct share
    access String
    Access grants. Possible values are read and read-write
    documentId String
    Document ID
    recipients Property Map
    Recipients of the direct share

    Supporting Types

    DirectSharesRecipients, DirectSharesRecipientsArgs

    Recipients []DirectSharesRecipientsRecipient
    Recipient of the direct share
    recipients list(object)
    Recipient of the direct share
    recipients DirectSharesRecipientsRecipient[]
    Recipient of the direct share
    recipients List<Property Map>
    Recipient of the direct share

    DirectSharesRecipientsRecipient, DirectSharesRecipientsRecipientArgs

    Id string
    Identifier of the recipient
    Type string
    Type of the recipient. Possible values are group' anduser'
    Id string
    Identifier of the recipient
    Type string
    Type of the recipient. Possible values are group' anduser'
    id string
    Identifier of the recipient
    type string
    Type of the recipient. Possible values are group' anduser'
    id String
    Identifier of the recipient
    type String
    Type of the recipient. Possible values are group' anduser'
    id string
    Identifier of the recipient
    type string
    Type of the recipient. Possible values are group' anduser'
    id str
    Identifier of the recipient
    type str
    Type of the recipient. Possible values are group' anduser'
    id String
    Identifier of the recipient
    type String
    Type of the recipient. Possible values are group' anduser'

    Package Details

    Repository
    dynatrace pulumiverse/pulumi-dynatrace
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the dynatrace Terraform Provider.
    dynatrace logo
    Viewing docs for Dynatrace v0.36.0
    published on Tuesday, Jun 9, 2026 by Pulumiverse

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial