Datadog v4.58.0 published on Thursday, Oct 16, 2025 by Pulumi
datadog.getRoleUsers
Use this data source to retrieve information about existing Datadog role users assignments. This data source is in beta and is subject to change.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
// Get the API Key Manager role
const apiKeyManager = datadog.getRole({
filter: "API Key Manager",
});
// List users assigned to the API Key Manager role
const apiKeyManagers = apiKeyManager.then(apiKeyManager => datadog.getRoleUsers({
roleId: apiKeyManager.id,
}));
import pulumi
import pulumi_datadog as datadog
# Get the API Key Manager role
api_key_manager = datadog.get_role(filter="API Key Manager")
# List users assigned to the API Key Manager role
api_key_managers = datadog.get_role_users(role_id=api_key_manager.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 {
// Get the API Key Manager role
apiKeyManager, err := datadog.LookupRole(ctx, &datadog.LookupRoleArgs{
Filter: "API Key Manager",
}, nil)
if err != nil {
return err
}
// List users assigned to the API Key Manager role
_, err = datadog.GetRoleUsers(ctx, &datadog.GetRoleUsersArgs{
RoleId: apiKeyManager.Id,
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
// Get the API Key Manager role
var apiKeyManager = Datadog.GetRole.Invoke(new()
{
Filter = "API Key Manager",
});
// List users assigned to the API Key Manager role
var apiKeyManagers = Datadog.GetRoleUsers.Invoke(new()
{
RoleId = apiKeyManager.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.inputs.GetRoleUsersArgs;
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) {
// Get the API Key Manager role
final var apiKeyManager = DatadogFunctions.getRole(GetRoleArgs.builder()
.filter("API Key Manager")
.build());
// List users assigned to the API Key Manager role
final var apiKeyManagers = DatadogFunctions.getRoleUsers(GetRoleUsersArgs.builder()
.roleId(apiKeyManager.id())
.build());
}
}
variables:
# Get the API Key Manager role
apiKeyManager:
fn::invoke:
function: datadog:getRole
arguments:
filter: API Key Manager
# List users assigned to the API Key Manager role
apiKeyManagers:
fn::invoke:
function: datadog:getRoleUsers
arguments:
roleId: ${apiKeyManager.id}
Using getRoleUsers
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getRoleUsers(args: GetRoleUsersArgs, opts?: InvokeOptions): Promise<GetRoleUsersResult>
function getRoleUsersOutput(args: GetRoleUsersOutputArgs, opts?: InvokeOptions): Output<GetRoleUsersResult>
def get_role_users(exact_match: Optional[bool] = None,
filter: Optional[str] = None,
role_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRoleUsersResult
def get_role_users_output(exact_match: Optional[pulumi.Input[bool]] = None,
filter: Optional[pulumi.Input[str]] = None,
role_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRoleUsersResult]
func GetRoleUsers(ctx *Context, args *GetRoleUsersArgs, opts ...InvokeOption) (*GetRoleUsersResult, error)
func GetRoleUsersOutput(ctx *Context, args *GetRoleUsersOutputArgs, opts ...InvokeOption) GetRoleUsersResultOutput
> Note: This function is named GetRoleUsers
in the Go SDK.
public static class GetRoleUsers
{
public static Task<GetRoleUsersResult> InvokeAsync(GetRoleUsersArgs args, InvokeOptions? opts = null)
public static Output<GetRoleUsersResult> Invoke(GetRoleUsersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRoleUsersResult> getRoleUsers(GetRoleUsersArgs args, InvokeOptions options)
public static Output<GetRoleUsersResult> getRoleUsers(GetRoleUsersArgs args, InvokeOptions options)
fn::invoke:
function: datadog:index/getRoleUsers:getRoleUsers
arguments:
# arguments dictionary
The following arguments are supported:
- Role
Id string - The role's identifier.
- Exact
Match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - Filter string
- Search query, can be user name.
- Role
Id string - The role's identifier.
- Exact
Match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - Filter string
- Search query, can be user name.
- role
Id String - The role's identifier.
- exact
Match Boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter String
- Search query, can be user name.
- role
Id string - The role's identifier.
- exact
Match boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter string
- Search query, can be user name.
- role_
id str - The role's identifier.
- exact_
match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - filter str
- Search query, can be user name.
- role
Id String - The role's identifier.
- exact
Match Boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter String
- Search query, can be user name.
getRoleUsers Result
The following output properties are available:
- Id string
- The ID of this resource.
- Role
Id string - The role's identifier.
- Role
Users List<GetRole Users Role User> - List of users assigned to role.
- Exact
Match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - Filter string
- Search query, can be user name.
- Id string
- The ID of this resource.
- Role
Id string - The role's identifier.
- Role
Users []GetRole Users Role User - List of users assigned to role.
- Exact
Match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - Filter string
- Search query, can be user name.
- id String
- The ID of this resource.
- role
Id String - The role's identifier.
- role
Users List<GetRole Users Role User> - List of users assigned to role.
- exact
Match Boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter String
- Search query, can be user name.
- id string
- The ID of this resource.
- role
Id string - The role's identifier.
- role
Users GetRole Users Role User[] - List of users assigned to role.
- exact
Match boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter string
- Search query, can be user name.
- id str
- The ID of this resource.
- role_
id str - The role's identifier.
- role_
users Sequence[GetRole Users Role User] - List of users assigned to role.
- exact_
match bool - When true,
filter_keyword
string is exact matched against the user'sname
. - filter str
- Search query, can be user name.
- id String
- The ID of this resource.
- role
Id String - The role's identifier.
- role
Users List<Property Map> - List of users assigned to role.
- exact
Match Boolean - When true,
filter_keyword
string is exact matched against the user'sname
. - filter String
- Search query, can be user name.
Supporting Types
GetRoleUsersRoleUser
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadog
Terraform Provider.