datadog.User
Explore with Pulumi AI
Provides a Datadog user resource. This can be used to create and manage Datadog users.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
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 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 {
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
})
}
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) {
final var roRole = DatadogFunctions.getRole(GetRoleArgs.builder()
.filter("Datadog Read Only Role")
.build());
var foo = new User("foo", UserArgs.builder()
.email("new@example.com")
.roles(roRole.applyValue(getRoleResult -> getRoleResult.id()))
.build());
}
}
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)],
});
resources:
# Create a new Datadog user
foo:
type: datadog:User
properties:
email: new@example.com
roles:
- ${roRole.id}
variables:
roRole:
fn::invoke:
Function: datadog:getRole
Arguments:
filter: Datadog Read Only Role
Create User Resource
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: 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)
@overload
def User(resource_name: str,
args: UserArgs,
opts: Optional[ResourceOptions] = None)
func NewUser(ctx *Context, name string, args UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs args, CustomResourceOptions? opts = null)
type: datadog:User
properties: # The arguments to resource properties.
options: # 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.
- 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.
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
The User resource accepts the following input properties:
- Email string
Email address for user.
- Disabled bool
Whether the user is disabled.
- Name string
Name for user.
- Roles List<string>
A list a role IDs to assign to the user.
- Send
User boolInvitation Whether an invitation email should be sent when the user is created.
- Email string
Email address for user.
- Disabled bool
Whether the user is disabled.
- Name string
Name for user.
- Roles []string
A list a role IDs to assign to the user.
- Send
User boolInvitation Whether an invitation email should be sent when the user is created.
- email String
Email address for user.
- disabled Boolean
Whether the user is disabled.
- name String
Name for user.
- roles List<String>
A list a role IDs to assign to the user.
- send
User BooleanInvitation Whether an invitation email should be sent when the user is created.
- email string
Email address for user.
- disabled boolean
Whether the user is disabled.
- name string
Name for user.
- roles string[]
A list a role IDs to assign to the user.
- send
User booleanInvitation Whether an invitation email should be sent when the user is created.
- email str
Email address for user.
- disabled bool
Whether the user is disabled.
- name str
Name for user.
- roles Sequence[str]
A list a role IDs to assign to the user.
- send_
user_ boolinvitation Whether an invitation email should be sent when the user is created.
- email String
Email address for user.
- disabled Boolean
Whether the user is disabled.
- name String
Name for user.
- roles List<String>
A list a role IDs to assign to the user.
- send
User BooleanInvitation 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.
- User
Invitation stringId 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.
- User
Invitation stringId 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.
- user
Invitation StringId 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.
- user
Invitation stringId 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_ strid 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.
- user
Invitation StringId 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.
- Disabled bool
Whether the user is disabled.
- Email string
Email address for user.
- Name string
Name for user.
- Roles List<string>
A list a role IDs to assign to the user.
- Send
User boolInvitation Whether an invitation email should be sent when the user is created.
- User
Invitation stringId 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.
- Email string
Email address for user.
- Name string
Name for user.
- Roles []string
A list a role IDs to assign to the user.
- Send
User boolInvitation Whether an invitation email should be sent when the user is created.
- User
Invitation stringId 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.
- email String
Email address for user.
- name String
Name for user.
- roles List<String>
A list a role IDs to assign to the user.
- send
User BooleanInvitation Whether an invitation email should be sent when the user is created.
- user
Invitation StringId 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.
- email string
Email address for user.
- name string
Name for user.
- roles string[]
A list a role IDs to assign to the user.
- send
User booleanInvitation Whether an invitation email should be sent when the user is created.
- user
Invitation stringId 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.
- email str
Email address for user.
- name str
Name for user.
- roles Sequence[str]
A list a role IDs to assign to the user.
- send_
user_ boolinvitation Whether an invitation email should be sent when the user is created.
- user_
invitation_ strid 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.
- email String
Email address for user.
- name String
Name for user.
- roles List<String>
A list a role IDs to assign to the user.
- send
User BooleanInvitation Whether an invitation email should be sent when the user is created.
- user
Invitation StringId 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
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
datadog
Terraform Provider.