1. Packages
  2. Vcd Provider
  3. API Docs
  4. getRole
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getRole

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a VMware Cloud Director role data source. This can be used to read roles.

    Supported in provider v3.3+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    const vapp_author = vcd.getRole({
        name: "vApp Author",
        org: "my-org",
    });
    
    import pulumi
    import pulumi_vcd as vcd
    
    vapp_author = vcd.get_role(name="vApp Author",
        org="my-org")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vcd.LookupRole(ctx, &vcd.LookupRoleArgs{
    			Name: "vApp Author",
    			Org:  pulumi.StringRef("my-org"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var vapp_author = Vcd.GetRole.Invoke(new()
        {
            Name = "vApp Author",
            Org = "my-org",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.VcdFunctions;
    import com.pulumi.vcd.inputs.GetRoleArgs;
    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 vapp-author = VcdFunctions.getRole(GetRoleArgs.builder()
                .name("vApp Author")
                .org("my-org")
                .build());
    
        }
    }
    
    variables:
      vapp-author:
        fn::invoke:
          function: vcd:getRole
          arguments:
            name: vApp Author
            org: my-org
    
    Sample output:
    
    vapp-author = {
      "bundle_key" = "ROLE_VAPP_AUTHOR"
      "description" = "Rights given to a user who uses catalogs and creates vApps"
      "id" = "urn:vcloud:role:53256466-221f-3f1f-8cea-2fcfc7ab9ef7"
      "name" = "vApp Author"
      "org" = "datacloud"
      "read_only" = true
      "rights" = toset([
        "Catalog: Add vApp from My Cloud",
        "Catalog: View Private and Shared Catalogs",
        "Organization vDC Compute Policy: View",
        "Organization vDC Named Disk: Create",
        "Organization vDC Named Disk: Delete",
        "Organization vDC Named Disk: Edit Properties",
        "Organization vDC Named Disk: View Properties",
        "Organization vDC Network: View Properties",
        "Organization vDC: VM-VM Affinity Edit",
        "Organization: View",
        "UI Plugins: View",
        "VAPP_VM_METADATA_TO_VCENTER",
        "vApp Template / Media: Copy",
        "vApp Template / Media: Edit",
        "vApp Template / Media: View",
        "vApp Template: Checkout",
        "vApp: Copy",
        "vApp: Create / Reconfigure",
        "vApp: Delete",
        "vApp: Download",
        "vApp: Edit Properties",
        "vApp: Edit VM CPU",
        "vApp: Edit VM Hard Disk",
        "vApp: Edit VM Memory",
        "vApp: Edit VM Network",
        "vApp: Edit VM Properties",
        "vApp: Manage VM Password Settings",
        "vApp: Power Operations",
        "vApp: Sharing",
        "vApp: Snapshot Operations",
        "vApp: Upload",
        "vApp: Use Console",
        "vApp: VM Boot Options",
        "vApp: View ACL",
        "vApp: View VM metrics",
      ])
    }
    

    More information

    See Roles management for a broader description of how roles and rights work together.

    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(id: Optional[str] = None,
                 name: Optional[str] = None,
                 org: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 org: Optional[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)
    public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the role.
    Id string
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    Name string
    The name of the role.
    Id string
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    name String
    The name of the role.
    id String
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    name string
    The name of the role.
    id string
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    name str
    The name of the role.
    id str
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    name String
    The name of the role.
    id String
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations

    getRole Result

    The following output properties are available:

    BundleKey string
    Key used for internationalization.
    Description string
    A description of the role
    Id string
    Name string
    ReadOnly bool
    Whether this role is read-only
    Rights List<string>
    Set of rights assigned to this role
    Org string
    BundleKey string
    Key used for internationalization.
    Description string
    A description of the role
    Id string
    Name string
    ReadOnly bool
    Whether this role is read-only
    Rights []string
    Set of rights assigned to this role
    Org string
    bundleKey String
    Key used for internationalization.
    description String
    A description of the role
    id String
    name String
    readOnly Boolean
    Whether this role is read-only
    rights List<String>
    Set of rights assigned to this role
    org String
    bundleKey string
    Key used for internationalization.
    description string
    A description of the role
    id string
    name string
    readOnly boolean
    Whether this role is read-only
    rights string[]
    Set of rights assigned to this role
    org string
    bundle_key str
    Key used for internationalization.
    description str
    A description of the role
    id str
    name str
    read_only bool
    Whether this role is read-only
    rights Sequence[str]
    Set of rights assigned to this role
    org str
    bundleKey String
    Key used for internationalization.
    description String
    A description of the role
    id String
    name String
    readOnly Boolean
    Whether this role is read-only
    rights List<String>
    Set of rights assigned to this role
    org String

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware