vSphere
getRole
The vsphere.Role
data source can be used to discover the id and privileges associated
with a role given its name or display label in vsphere UI.
Example Usage
using Pulumi;
using VSphere = Pulumi.VSphere;
class MyStack : Stack
{
public MyStack()
{
var role1 = Output.Create(VSphere.GetRole.InvokeAsync(new VSphere.GetRoleArgs
{
Label = "Virtual machine user (sample)",
}));
}
}
package main
import (
"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := vsphere.LookupRole(ctx, &GetRoleArgs{
Label: "Virtual machine user (sample)",
}, nil)
if err != nil {
return err
}
return nil
})
}
Coming soon!
import pulumi
import pulumi_vsphere as vsphere
role1 = vsphere.get_role(label="Virtual machine user (sample)")
import * as pulumi from "@pulumi/pulumi";
import * as vsphere from "@pulumi/vsphere";
const role1 = pulumi.output(vsphere.getRole({
label: "Virtual machine user (sample)",
}));
Coming soon!
Using getRole
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 getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
def get_role(description: Optional[str] = None,
label: Optional[str] = None,
name: Optional[str] = None,
role_privileges: Optional[Sequence[str]] = None,
opts: Optional[InvokeOptions] = None) -> GetRoleResult
def get_role_output(description: Optional[pulumi.Input[str]] = None,
label: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
role_privileges: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput
> Note: This function is named LookupRole
in the Go SDK.
public static class GetRole
{
public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
Function: vsphere:index/getRole:getRole
Arguments:
# Arguments dictionary
The following arguments are supported:
- Label string
The label of the role.
- Description string
The description of the role.
- Name string
- Role
Privileges List<string> The privileges associated with the role.
- Label string
The label of the role.
- Description string
The description of the role.
- Name string
- Role
Privileges []string The privileges associated with the role.
- label String
The label of the role.
- description String
The description of the role.
- name String
- role
Privileges List The privileges associated with the role.
- label string
The label of the role.
- description string
The description of the role.
- name string
- role
Privileges string[] The privileges associated with the role.
- label str
The label of the role.
- description str
The description of the role.
- name str
- role_
privileges Sequence[str] The privileges associated with the role.
- label String
The label of the role.
- description String
The description of the role.
- name String
- role
Privileges List The privileges associated with the role.
getRole Result
The following output properties are available:
- Id string
The provider-assigned unique ID for this managed resource.
- Label string
The display label of the role.
- Description string
The description of the role.
- Name string
- Role
Privileges List<string> The privileges associated with the role.
- Id string
The provider-assigned unique ID for this managed resource.
- Label string
The display label of the role.
- Description string
The description of the role.
- Name string
- Role
Privileges []string The privileges associated with the role.
- id String
The provider-assigned unique ID for this managed resource.
- label String
The display label of the role.
- description String
The description of the role.
- name String
- role
Privileges List The privileges associated with the role.
- id string
The provider-assigned unique ID for this managed resource.
- label string
The display label of the role.
- description string
The description of the role.
- name string
- role
Privileges string[] The privileges associated with the role.
- id str
The provider-assigned unique ID for this managed resource.
- label str
The display label of the role.
- description str
The description of the role.
- name str
- role_
privileges Sequence[str] The privileges associated with the role.
- id String
The provider-assigned unique ID for this managed resource.
- label String
The display label of the role.
- description String
The description of the role.
- name String
- role
Privileges List The privileges associated with the role.
Package Details
- Repository
- https://github.com/pulumi/pulumi-vsphere
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
vsphere
Terraform Provider.