1. Registry
  2. Packages
  3. Zenduty Provider
  4. API Docs
  5. getUserCustomRole
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty
zenduty
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty

    zenduty.getUserCustomRole reads the custom account role (see zenduty.AccountRole) assigned to a user. The API only serves this for members with the regular user role; account admins and owners cannot hold a custom role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as zenduty from "@pulumi/zenduty";
    
    const alice = zenduty.getUserCustomRole({
        username: aliceZendutyUser.users[0].username,
    });
    export const aliceRole = alice.then(alice => alice.roleName);
    
    import pulumi
    import pulumi_zenduty as zenduty
    
    alice = zenduty.get_user_custom_role(username=alice_zenduty_user["users"][0]["username"])
    pulumi.export("aliceRole", alice.role_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/v2/zenduty"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		alice, err := zenduty.GetUserCustomRole(ctx, &zenduty.GetUserCustomRoleArgs{
    			Username: aliceZendutyUser.Users[0].Username,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("aliceRole", alice.RoleName)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zenduty = Pulumi.Zenduty;
    
    return await Deployment.RunAsync(() => 
    {
        var alice = Zenduty.GetUserCustomRole.Invoke(new()
        {
            Username = aliceZendutyUser.Users[0].Username,
        });
    
        return new Dictionary<string, object?>
        {
            ["aliceRole"] = alice.Apply(getUserCustomRoleResult => getUserCustomRoleResult.RoleName),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zenduty.ZendutyFunctions;
    import com.pulumi.zenduty.inputs.GetUserCustomRoleArgs;
    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 alice = ZendutyFunctions.getUserCustomRole(GetUserCustomRoleArgs.builder()
                .username(aliceZendutyUser.users()[0].username())
                .build());
    
            ctx.export("aliceRole", alice.roleName());
        }
    }
    
    variables:
      alice:
        fn::invoke:
          function: zenduty:getUserCustomRole
          arguments:
            username: ${aliceZendutyUser.users[0].username}
    outputs:
      aliceRole: ${alice.roleName}
    
    Example coming soon!
    

    Using getUserCustomRole

    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 getUserCustomRole(args: GetUserCustomRoleArgs, opts?: InvokeOptions): Promise<GetUserCustomRoleResult>
    function getUserCustomRoleOutput(args: GetUserCustomRoleOutputArgs, opts?: InvokeOutputOptions): Output<GetUserCustomRoleResult>
    def get_user_custom_role(id: Optional[str] = None,
                             username: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetUserCustomRoleResult
    def get_user_custom_role_output(id: pulumi.Input[Optional[str]] = None,
                             username: pulumi.Input[Optional[str]] = None,
                             opts: Optional[InvokeOutputOptions] = None) -> Output[GetUserCustomRoleResult]
    func GetUserCustomRole(ctx *Context, args *GetUserCustomRoleArgs, opts ...InvokeOption) (*GetUserCustomRoleResult, error)
    func GetUserCustomRoleOutput(ctx *Context, args *GetUserCustomRoleOutputArgs, opts ...InvokeOption) GetUserCustomRoleResultOutput

    > Note: This function is named GetUserCustomRole in the Go SDK.

    public static class GetUserCustomRole 
    {
        public static Task<GetUserCustomRoleResult> InvokeAsync(GetUserCustomRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetUserCustomRoleResult> Invoke(GetUserCustomRoleInvokeArgs args, InvokeOptions? opts = null)
        public static Output<GetUserCustomRoleResult> Invoke(GetUserCustomRoleInvokeArgs args, InvokeOutputOptions opts)
    }
    public static CompletableFuture<GetUserCustomRoleResult> getUserCustomRole(GetUserCustomRoleArgs args, InvokeOptions options)
    public static Output<GetUserCustomRoleResult> getUserCustomRole(GetUserCustomRoleArgs args, InvokeOptions options)
    public static Output<GetUserCustomRoleResult> getUserCustomRole(GetUserCustomRoleArgs args, InvokeOutputOptions options)
    
    fn::invoke:
      function: zenduty:index/getUserCustomRole:getUserCustomRole
      arguments:
        # arguments dictionary
    data "zenduty_get_user_custom_role" "name" {
        # arguments
    }

    The following arguments are supported:

    Username string
    Username of the user.
    Id string
    Username string
    Username of the user.
    Id string
    username string
    Username of the user.
    id string
    username String
    Username of the user.
    id String
    username string
    Username of the user.
    id string
    username str
    Username of the user.
    id str
    username String
    Username of the user.
    id String

    getUserCustomRole Result

    The following output properties are available:

    AccountRole string
    The unique_id of the assigned custom role, empty when the user has none.
    Id string
    RoleName string
    The name of the assigned role.
    Username string
    AccountRole string
    The unique_id of the assigned custom role, empty when the user has none.
    Id string
    RoleName string
    The name of the assigned role.
    Username string
    account_role string
    The unique_id of the assigned custom role, empty when the user has none.
    id string
    role_name string
    The name of the assigned role.
    username string
    accountRole String
    The unique_id of the assigned custom role, empty when the user has none.
    id String
    roleName String
    The name of the assigned role.
    username String
    accountRole string
    The unique_id of the assigned custom role, empty when the user has none.
    id string
    roleName string
    The name of the assigned role.
    username string
    account_role str
    The unique_id of the assigned custom role, empty when the user has none.
    id str
    role_name str
    The name of the assigned role.
    username str
    accountRole String
    The unique_id of the assigned custom role, empty when the user has none.
    id String
    roleName String
    The name of the assigned role.
    username String

    Package Details

    Repository
    zenduty zenduty/terraform-provider-zenduty
    License
    Notes
    This Pulumi package is based on the zenduty Terraform Provider.
    zenduty
    Viewing docs for zenduty 2.2.0
    published on Friday, Oct 30, 2026 by zenduty

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial