Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

User

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

Schema

Required

  • email (String) Email address for user.

Optional

  • access_role (String, Deprecated) Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.
  • disabled (Boolean) Whether the user is disabled.
  • handle (String, Deprecated) The user handle, must be a valid email.
  • id (String) The ID of this resource.
  • is_admin (Boolean, Deprecated) Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.
  • name (String) Name for user.
  • role (String, Deprecated) Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.
  • roles (Set of String) A list a role IDs to assign to the user.
  • send_user_invitation (Boolean) Whether an invitation email should be sent when the user is created.

Read-only

  • user_invitation_id (String) The ID of the user invitation that was sent when creating the user.
  • verified (Boolean) Returns true if Datadog user is verified.

Example Usage

using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        var roRole = Output.Create(Datadog.GetRole.InvokeAsync(new Datadog.GetRoleArgs
        {
            Filter = "Datadog Read Only Role",
        }));
        // Create a new Datadog user
        var foo = new Datadog.User("foo", new Datadog.UserArgs
        {
            Email = "new@example.com",
            Roles = 
            {
                roRole.Apply(roRole => roRole.Id),
            },
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        roRole, err := datadog.LookupRole(ctx, &datadog.LookupRoleArgs{
            Filter: "Datadog Read Only Role",
        }, nil)
        if err != nil {
            return err
        }
        _, 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
    })
}
import pulumi
import pulumi_datadog as datadog

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])
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

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)],
});

Create a User Resource

new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
def User(resource_name: str, opts: Optional[ResourceOptions] = None, access_role: Optional[str] = None, disabled: Optional[bool] = None, email: Optional[str] = None, handle: Optional[str] = None, is_admin: Optional[bool] = None, name: Optional[str] = None, role: 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)
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.
opts ResourceOptions
A bag of options that control this 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.

User Resource Properties

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

Inputs

The User resource accepts the following input properties:

Email string

Email address for user.

AccessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Disabled bool

Whether the user is disabled.

Handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

IsAdmin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Name string

Name for user.

Role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

Roles List<string>

A list a role IDs to assign to the user.

SendUserInvitation bool

Whether an invitation email should be sent when the user is created.

Email string

Email address for user.

AccessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Disabled bool

Whether the user is disabled.

Handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

IsAdmin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Name string

Name for user.

Role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

Roles []string

A list a role IDs to assign to the user.

SendUserInvitation bool

Whether an invitation email should be sent when the user is created.

email string

Email address for user.

accessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

disabled boolean

Whether the user is disabled.

handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

isAdmin boolean

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

name string

Name for user.

role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

roles string[]

A list a role IDs to assign to the user.

sendUserInvitation boolean

Whether an invitation email should be sent when the user is created.

email str

Email address for user.

access_role str

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

disabled bool

Whether the user is disabled.

handle str

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

is_admin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

name str

Name for user.

role str

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

roles Sequence[str]

A list a role IDs to assign to the user.

send_user_invitation bool

Whether an invitation email should be sent when the user is created.

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 Datadog 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 Datadog 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 Datadog 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 Datadog user is verified.

Look up an 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, access_role: Optional[str] = None, disabled: Optional[bool] = None, email: Optional[str] = None, handle: Optional[str] = None, is_admin: Optional[bool] = None, name: Optional[str] = None, role: 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)
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.

The following state arguments are supported:

AccessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Disabled bool

Whether the user is disabled.

Email string

Email address for user.

Handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

IsAdmin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Name string

Name for user.

Role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

Roles List<string>

A list a role IDs to assign to the user.

SendUserInvitation bool

Whether an invitation email should be sent when the user is created.

UserInvitationId string

The ID of the user invitation that was sent when creating the user.

Verified bool

Returns true if Datadog user is verified.

AccessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Disabled bool

Whether the user is disabled.

Email string

Email address for user.

Handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

IsAdmin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

Name string

Name for user.

Role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

Roles []string

A list a role IDs to assign to the user.

SendUserInvitation bool

Whether an invitation email should be sent when the user is created.

UserInvitationId string

The ID of the user invitation that was sent when creating the user.

Verified bool

Returns true if Datadog user is verified.

accessRole string

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

disabled boolean

Whether the user is disabled.

email string

Email address for user.

handle string

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

isAdmin boolean

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

name string

Name for user.

role string

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

roles string[]

A list a role IDs to assign to the user.

sendUserInvitation boolean

Whether an invitation email should be sent when the user is created.

userInvitationId string

The ID of the user invitation that was sent when creating the user.

verified boolean

Returns true if Datadog user is verified.

access_role str

Role description for user. Can be st (standard user), adm (admin user) or ro (read-only user). Default is st. access_role is ignored for new users created with this resource. New users have to use the roles attribute.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

disabled bool

Whether the user is disabled.

email str

Email address for user.

handle str

The user handle, must be a valid email.

Deprecated: This parameter is deprecated and will be removed from the next Major version

is_admin bool

Whether the user is an administrator. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter is replaced by roles and will be removed from the next Major version

name str

Name for user.

role str

Role description for user. Warning: the corresponding query parameter is ignored by the Datadog API, thus the argument would always trigger an execution plan.

Deprecated: This parameter was removed from the API and has no effect

roles Sequence[str]

A list a role IDs to assign to the user.

send_user_invitation bool

Whether an invitation email should be sent when the user is created.

user_invitation_id str

The ID of the user invitation that was sent when creating the user.

verified bool

Returns true if Datadog user is verified.

Import

Import is supported using the following syntax

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

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.