1. Packages
  2. Avi Provider
  3. API Docs
  4. getRole
avi 31.1.1 published on Monday, Apr 14, 2025 by vmware

avi.getRole

Explore with Pulumi AI

avi logo
avi 31.1.1 published on Monday, Apr 14, 2025 by vmware

    <!–

    Copyright 2021 VMware, Inc.
    SPDX-License-Identifier: Mozilla Public License 2.0
    

    –>

    layout: “avi”

    page_title: “AVI: avi.Role” sidebar_current: “docs-avi-datasource-role” description: |- Get information of Avi Role.

    avi.Role

    This data source is used to to get avi.Role objects.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as avi from "@pulumi/avi";
    
    const fooRole = avi.getRole({
        name: "foo",
        uuid: "role-f9cf6b3e-a411-436f-95e2-2982ba2b217b",
    });
    
    import pulumi
    import pulumi_avi as avi
    
    foo_role = avi.get_role(name="foo",
        uuid="role-f9cf6b3e-a411-436f-95e2-2982ba2b217b")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/avi/v31/avi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := avi.LookupRole(ctx, &avi.LookupRoleArgs{
    			Name: pulumi.StringRef("foo"),
    			Uuid: pulumi.StringRef("role-f9cf6b3e-a411-436f-95e2-2982ba2b217b"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Avi = Pulumi.Avi;
    
    return await Deployment.RunAsync(() => 
    {
        var fooRole = Avi.GetRole.Invoke(new()
        {
            Name = "foo",
            Uuid = "role-f9cf6b3e-a411-436f-95e2-2982ba2b217b",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.avi.AviFunctions;
    import com.pulumi.avi.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 fooRole = AviFunctions.getRole(GetRoleArgs.builder()
                .name("foo")
                .uuid("role-f9cf6b3e-a411-436f-95e2-2982ba2b217b")
                .build());
    
        }
    }
    
    variables:
      fooRole:
        fn::invoke:
          function: avi:getRole
          arguments:
            name: foo
            uuid: role-f9cf6b3e-a411-436f-95e2-2982ba2b217b
    

    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,
                 tenant_ref: Optional[str] = None,
                 uuid: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 tenant_ref: Optional[pulumi.Input[str]] = None,
                 uuid: 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: avi:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    Search Role by name.
    TenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Search Role by uuid.
    Id string
    Name string
    Search Role by name.
    TenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Search Role by uuid.
    id String
    name String
    Search Role by name.
    tenantRef String
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Search Role by uuid.
    id string
    name string
    Search Role by name.
    tenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid string
    Search Role by uuid.
    id str
    name str
    Search Role by name.
    tenant_ref str
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid str
    Search Role by uuid.
    id String
    name String
    Search Role by name.
    tenantRef String
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Search Role by uuid.

    getRole Result

    The following output properties are available:

    AllowUnlabelledAccess string
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    ConfigpbAttributes List<GetRoleConfigpbAttribute>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Filters List<GetRoleFilter>
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    Id string
    Name string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Privileges List<GetRolePrivilege>
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    TenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    AllowUnlabelledAccess string
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    ConfigpbAttributes []GetRoleConfigpbAttribute
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Filters []GetRoleFilter
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    Id string
    Name string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Privileges []GetRolePrivilege
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    TenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    Uuid string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    allowUnlabelledAccess String
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    configpbAttributes List<GetRoleConfigpbAttribute>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    filters List<GetRoleFilter>
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    id String
    name String
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    privileges List<GetRolePrivilege>
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef String
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    allowUnlabelledAccess string
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    configpbAttributes GetRoleConfigpbAttribute[]
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    filters GetRoleFilter[]
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    id string
    name string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    privileges GetRolePrivilege[]
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef string
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid string
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    allow_unlabelled_access str
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    configpb_attributes Sequence[GetRoleConfigpbAttribute]
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    filters Sequence[GetRoleFilter]
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    id str
    name str
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    privileges Sequence[GetRolePrivilege]
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenant_ref str
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid str
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    allowUnlabelledAccess String
    Allow access to unlabelled objects. Field introduced in 20.1.5. Allowed with any value in enterprise, enterprise with cloud services edition.
    configpbAttributes List<Property Map>
    Protobuf versioning for config pbs. Field introduced in 21.1.1. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    filters List<Property Map>
    Filters for granular object access control based on object labels. Multiple filters are merged using the and operator. If empty, all objects according to the privileges will be accessible to the user. Field introduced in 20.1.3. Maximum of 4 items allowed. Allowed with any value in enterprise, enterprise with cloud services edition.
    id String
    name String
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    privileges List<Property Map>
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    tenantRef String
    It is a reference to an object of type tenant. Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.
    uuid String
    Allowed with any value in enterprise, essentials, basic, enterprise with cloud services edition.

    Supporting Types

    GetRoleConfigpbAttribute

    Version string
    Version string
    version String
    version string
    version String

    GetRoleFilter

    Enabled string
    MatchLabels []GetRoleFilterMatchLabel
    MatchOperation string
    Name string
    Search Role by name.
    enabled string
    matchLabels GetRoleFilterMatchLabel[]
    matchOperation string
    name string
    Search Role by name.
    enabled String
    matchLabels List<Property Map>
    matchOperation String
    name String
    Search Role by name.

    GetRoleFilterMatchLabel

    Key string
    Values List<string>
    Key string
    Values []string
    key String
    values List<String>
    key string
    values string[]
    key str
    values Sequence[str]
    key String
    values List<String>

    GetRolePrivilege

    GetRolePrivilegeSubresource

    Package Details

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