1. Packages
  2. Datadog Provider
  3. API Docs
  4. User
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

datadog.User

Explore with Pulumi AI

datadog logo
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Datadog user resource. This can be used to create and manage Datadog users.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    // Source a role
    const roRole = datadog.getRole({
        filter: "Datadog Read Only Role",
    });
    // Create a new Datadog user
    const foo = new datadog.User("foo", {
        email: "new@example.com",
        roles: [roRole.then(roRole => roRole.id)],
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    # Source a role
    ro_role = datadog.get_role(filter="Datadog Read Only Role")
    # Create a new Datadog user
    foo = datadog.User("foo",
        email="new@example.com",
        roles=[ro_role.id])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Source a role
    		roRole, err := datadog.LookupRole(ctx, &datadog.LookupRoleArgs{
    			Filter: "Datadog Read Only Role",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Create a new Datadog user
    		_, err = datadog.NewUser(ctx, "foo", &datadog.UserArgs{
    			Email: pulumi.String("new@example.com"),
    			Roles: pulumi.StringArray{
    				pulumi.String(roRole.Id),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        // Source a role
        var roRole = Datadog.GetRole.Invoke(new()
        {
            Filter = "Datadog Read Only Role",
        });
    
        // Create a new Datadog user
        var foo = new Datadog.User("foo", new()
        {
            Email = "new@example.com",
            Roles = new[]
            {
                roRole.Apply(getRoleResult => getRoleResult.Id),
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.DatadogFunctions;
    import com.pulumi.datadog.inputs.GetRoleArgs;
    import com.pulumi.datadog.User;
    import com.pulumi.datadog.UserArgs;
    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) {
            // Source a role
            final var roRole = DatadogFunctions.getRole(GetRoleArgs.builder()
                .filter("Datadog Read Only Role")
                .build());
    
            // Create a new Datadog user
            var foo = new User("foo", UserArgs.builder()
                .email("new@example.com")
                .roles(roRole.applyValue(getRoleResult -> getRoleResult.id()))
                .build());
    
        }
    }
    
    resources:
      # Create a new Datadog user
      foo:
        type: datadog:User
        properties:
          email: new@example.com
          roles:
            - ${roRole.id}
    variables:
      # Source a role
      roRole:
        fn::invoke:
          Function: datadog:getRole
          Arguments:
            filter: Datadog Read Only Role
    

    Create User Resource

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

    Constructor syntax

    new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
    @overload
    def User(resource_name: str,
             args: UserArgs,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def User(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             email: Optional[str] = None,
             disabled: Optional[bool] = None,
             name: Optional[str] = None,
             roles: Optional[Sequence[str]] = None,
             send_user_invitation: Optional[bool] = None)
    func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
    public User(string name, UserArgs args, CustomResourceOptions? opts = null)
    public User(String name, UserArgs args)
    public User(String name, UserArgs args, CustomResourceOptions options)
    
    type: datadog:User
    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 UserArgs
    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 UserArgs
    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 UserArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args UserArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args UserArgs
    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 userResource = new Datadog.User("userResource", new()
    {
        Email = "string",
        Disabled = false,
        Name = "string",
        Roles = new[]
        {
            "string",
        },
        SendUserInvitation = false,
    });
    
    example, err := datadog.NewUser(ctx, "userResource", &datadog.UserArgs{
    	Email:    pulumi.String("string"),
    	Disabled: pulumi.Bool(false),
    	Name:     pulumi.String("string"),
    	Roles: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	SendUserInvitation: pulumi.Bool(false),
    })
    
    var userResource = new User("userResource", UserArgs.builder()
        .email("string")
        .disabled(false)
        .name("string")
        .roles("string")
        .sendUserInvitation(false)
        .build());
    
    user_resource = datadog.User("userResource",
        email="string",
        disabled=False,
        name="string",
        roles=["string"],
        send_user_invitation=False)
    
    const userResource = new datadog.User("userResource", {
        email: "string",
        disabled: false,
        name: "string",
        roles: ["string"],
        sendUserInvitation: false,
    });
    
    type: datadog:User
    properties:
        disabled: false
        email: string
        name: string
        roles:
            - string
        sendUserInvitation: false
    

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

    Email string
    Email address for user.
    Disabled bool
    Whether the user is disabled. Defaults to false.
    Name string
    Name for user.
    Roles List<string>
    A list of role IDs to assign to the user.
    SendUserInvitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    Email string
    Email address for user.
    Disabled bool
    Whether the user is disabled. Defaults to false.
    Name string
    Name for user.
    Roles []string
    A list of role IDs to assign to the user.
    SendUserInvitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    email String
    Email address for user.
    disabled Boolean
    Whether the user is disabled. Defaults to false.
    name String
    Name for user.
    roles List<String>
    A list of role IDs to assign to the user.
    sendUserInvitation Boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.
    email string
    Email address for user.
    disabled boolean
    Whether the user is disabled. Defaults to false.
    name string
    Name for user.
    roles string[]
    A list of role IDs to assign to the user.
    sendUserInvitation boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.
    email str
    Email address for user.
    disabled bool
    Whether the user is disabled. Defaults to false.
    name str
    Name for user.
    roles Sequence[str]
    A list of role IDs to assign to the user.
    send_user_invitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    email String
    Email address for user.
    disabled Boolean
    Whether the user is disabled. Defaults to false.
    name String
    Name for user.
    roles List<String>
    A list of role IDs to assign to the user.
    sendUserInvitation Boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    UserInvitationId string
    The ID of the user invitation that was sent when creating the user.
    Verified bool
    Returns true if the user is verified.
    Id string
    The provider-assigned unique ID for this managed resource.
    UserInvitationId string
    The ID of the user invitation that was sent when creating the user.
    Verified bool
    Returns true if the user is verified.
    id String
    The provider-assigned unique ID for this managed resource.
    userInvitationId String
    The ID of the user invitation that was sent when creating the user.
    verified Boolean
    Returns true if the user is verified.
    id string
    The provider-assigned unique ID for this managed resource.
    userInvitationId string
    The ID of the user invitation that was sent when creating the user.
    verified boolean
    Returns true if the user is verified.
    id str
    The provider-assigned unique ID for this managed resource.
    user_invitation_id str
    The ID of the user invitation that was sent when creating the user.
    verified bool
    Returns true if the user is verified.
    id String
    The provider-assigned unique ID for this managed resource.
    userInvitationId String
    The ID of the user invitation that was sent when creating the user.
    verified Boolean
    Returns true if the user is verified.

    Look up Existing User Resource

    Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            disabled: Optional[bool] = None,
            email: Optional[str] = None,
            name: Optional[str] = None,
            roles: Optional[Sequence[str]] = None,
            send_user_invitation: Optional[bool] = None,
            user_invitation_id: Optional[str] = None,
            verified: Optional[bool] = None) -> User
    func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
    public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
    public static User get(String name, Output<String> id, UserState 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:
    Disabled bool
    Whether the user is disabled. Defaults to false.
    Email string
    Email address for user.
    Name string
    Name for user.
    Roles List<string>
    A list of role IDs to assign to the user.
    SendUserInvitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    UserInvitationId string
    The ID of the user invitation that was sent when creating the user.
    Verified bool
    Returns true if the user is verified.
    Disabled bool
    Whether the user is disabled. Defaults to false.
    Email string
    Email address for user.
    Name string
    Name for user.
    Roles []string
    A list of role IDs to assign to the user.
    SendUserInvitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    UserInvitationId string
    The ID of the user invitation that was sent when creating the user.
    Verified bool
    Returns true if the user is verified.
    disabled Boolean
    Whether the user is disabled. Defaults to false.
    email String
    Email address for user.
    name String
    Name for user.
    roles List<String>
    A list of role IDs to assign to the user.
    sendUserInvitation Boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.
    userInvitationId String
    The ID of the user invitation that was sent when creating the user.
    verified Boolean
    Returns true if the user is verified.
    disabled boolean
    Whether the user is disabled. Defaults to false.
    email string
    Email address for user.
    name string
    Name for user.
    roles string[]
    A list of role IDs to assign to the user.
    sendUserInvitation boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.
    userInvitationId string
    The ID of the user invitation that was sent when creating the user.
    verified boolean
    Returns true if the user is verified.
    disabled bool
    Whether the user is disabled. Defaults to false.
    email str
    Email address for user.
    name str
    Name for user.
    roles Sequence[str]
    A list of role IDs to assign to the user.
    send_user_invitation bool
    Whether an invitation email should be sent when the user is created. Defaults to true.
    user_invitation_id str
    The ID of the user invitation that was sent when creating the user.
    verified bool
    Returns true if the user is verified.
    disabled Boolean
    Whether the user is disabled. Defaults to false.
    email String
    Email address for user.
    name String
    Name for user.
    roles List<String>
    A list of role IDs to assign to the user.
    sendUserInvitation Boolean
    Whether an invitation email should be sent when the user is created. Defaults to true.
    userInvitationId String
    The ID of the user invitation that was sent when creating the user.
    verified Boolean
    Returns true if the user is verified.

    Import

    $ pulumi import datadog:index/user:User example_user 6f1b44c0-30b2-11eb-86bc-279f7c1ebaa4
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi