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

<!–

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",
});
Copy
import pulumi
import pulumi_avi as avi

foo_role = avi.get_role(name="foo",
    uuid="role-f9cf6b3e-a411-436f-95e2-2982ba2b217b")
Copy
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
	})
}
Copy
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",
    });

});
Copy
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());

    }
}
Copy
variables:
  fooRole:
    fn::invoke:
      function: avi:getRole
      arguments:
        name: foo
        uuid: role-f9cf6b3e-a411-436f-95e2-2982ba2b217b
Copy

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>
Copy
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]
Copy
func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: avi:index/getRole:getRole
  arguments:
    # arguments dictionary
Copy

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 This property is required. string
Version This property is required. string
version This property is required. String
version This property is required. string
version This property is required. str
version This property is required. String

GetRoleFilter

Enabled This property is required. string
MatchLabels This property is required. List<GetRoleFilterMatchLabel>
MatchOperation This property is required. string
Name This property is required. string
Search Role by name.
Enabled This property is required. string
MatchLabels This property is required. []GetRoleFilterMatchLabel
MatchOperation This property is required. string
Name This property is required. string
Search Role by name.
enabled This property is required. String
matchLabels This property is required. List<GetRoleFilterMatchLabel>
matchOperation This property is required. String
name This property is required. String
Search Role by name.
enabled This property is required. string
matchLabels This property is required. GetRoleFilterMatchLabel[]
matchOperation This property is required. string
name This property is required. string
Search Role by name.
enabled This property is required. str
match_labels This property is required. Sequence[GetRoleFilterMatchLabel]
match_operation This property is required. str
name This property is required. str
Search Role by name.
enabled This property is required. String
matchLabels This property is required. List<Property Map>
matchOperation This property is required. String
name This property is required. String
Search Role by name.

GetRoleFilterMatchLabel

Key This property is required. string
Values This property is required. List<string>
Key This property is required. string
Values This property is required. []string
key This property is required. String
values This property is required. List<String>
key This property is required. string
values This property is required. string[]
key This property is required. str
values This property is required. Sequence[str]
key This property is required. String
values This property is required. List<String>

GetRolePrivilege

Resource This property is required. string
Subresources This property is required. List<GetRolePrivilegeSubresource>
Type This property is required. string
Resource This property is required. string
Subresources This property is required. []GetRolePrivilegeSubresource
Type This property is required. string
resource This property is required. String
subresources This property is required. List<GetRolePrivilegeSubresource>
type This property is required. String
resource This property is required. string
subresources This property is required. GetRolePrivilegeSubresource[]
type This property is required. string
resource This property is required. str
subresources This property is required. Sequence[GetRolePrivilegeSubresource]
type This property is required. str
resource This property is required. String
subresources This property is required. List<Property Map>
type This property is required. String

GetRolePrivilegeSubresource

ExcludeSubresources This property is required. string
Subresources This property is required. List<string>
ExcludeSubresources This property is required. string
Subresources This property is required. []string
excludeSubresources This property is required. String
subresources This property is required. List<String>
excludeSubresources This property is required. string
subresources This property is required. string[]
exclude_subresources This property is required. str
subresources This property is required. Sequence[str]
excludeSubresources This property is required. String
subresources This property is required. List<String>

Package Details

Repository
avi vmware/terraform-provider-avi
License
Notes
This Pulumi package is based on the avi Terraform Provider.