Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty
published on Friday, Oct 30, 2026 by zenduty
zenduty
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty
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 dictionarydata "zenduty_get_user_custom_role" "name" {
# arguments
}The following arguments are supported:
getUserCustomRole Result
The following output properties are available:
- 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
- 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
- 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
- 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
- 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
- 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
- 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
Package Details
- Repository
- zenduty zenduty/terraform-provider-zenduty
- License
- Notes
- This Pulumi package is based on the
zendutyTerraform Provider.
zenduty
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty
published on Friday, Oct 30, 2026 by zenduty