Datadog v4.59.0 published on Wednesday, Oct 22, 2025 by Pulumi
datadog.getRoles
Use this data source to retrieve information about multiple roles for use in other resources.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const keyManagementRoles = datadog.getRoles({
filter: "API Key Manager",
});
import pulumi
import pulumi_datadog as datadog
key_management_roles = datadog.get_roles(filter="API Key Manager")
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 {
_, err := datadog.GetRoles(ctx, &datadog.GetRolesArgs{
Filter: pulumi.StringRef("API Key Manager"),
}, 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(() =>
{
var keyManagementRoles = Datadog.GetRoles.Invoke(new()
{
Filter = "API Key Manager",
});
});
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.GetRolesArgs;
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 keyManagementRoles = DatadogFunctions.getRoles(GetRolesArgs.builder()
.filter("API Key Manager")
.build());
}
}
variables:
keyManagementRoles:
fn::invoke:
function: datadog:getRoles
arguments:
filter: API Key Manager
Using getRoles
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 getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
function getRolesOutput(args: GetRolesOutputArgs, opts?: InvokeOptions): Output<GetRolesResult>def get_roles(filter: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetRolesResult
def get_roles_output(filter: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRolesResult]func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)
func GetRolesOutput(ctx *Context, args *GetRolesOutputArgs, opts ...InvokeOption) GetRolesResultOutput> Note: This function is named GetRoles in the Go SDK.
public static class GetRoles
{
public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
public static Output<GetRolesResult> Invoke(GetRolesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
public static Output<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
fn::invoke:
function: datadog:index/getRoles:getRoles
arguments:
# arguments dictionaryThe following arguments are supported:
- Filter string
- Filter all roles by the given string.
- Filter string
- Filter all roles by the given string.
- filter String
- Filter all roles by the given string.
- filter string
- Filter all roles by the given string.
- filter str
- Filter all roles by the given string.
- filter String
- Filter all roles by the given string.
getRoles Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Roles
List<Get
Roles Role> - List of Roles
- Filter string
- Filter all roles by the given string.
- Id string
- The provider-assigned unique ID for this managed resource.
- Roles
[]Get
Roles Role - List of Roles
- Filter string
- Filter all roles by the given string.
- id String
- The provider-assigned unique ID for this managed resource.
- roles
List<Get
Roles Role> - List of Roles
- filter String
- Filter all roles by the given string.
- id string
- The provider-assigned unique ID for this managed resource.
- roles
Get
Roles Role[] - List of Roles
- filter string
- Filter all roles by the given string.
- id str
- The provider-assigned unique ID for this managed resource.
- roles
Sequence[Get
Roles Role] - List of Roles
- filter str
- Filter all roles by the given string.
- id String
- The provider-assigned unique ID for this managed resource.
- roles List<Property Map>
- List of Roles
- filter String
- Filter all roles by the given string.
Supporting Types
GetRolesRole
- id str
- ID of the Datadog role
- name str
- Name of the Datadog role
- user_
count int - Number of users that have this role.
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
datadogTerraform Provider.
