cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc
cyral.getRole
Retrieve and filter roles that exist in the Cyral Control Plane.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cyral from "@pulumi/cyral";
const adminRoles = cyral.getRole({
    name: "^.*Admin$",
});
import pulumi
import pulumi_cyral as cyral
admin_roles = cyral.get_role(name="^.*Admin$")
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/cyral/v4/cyral"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cyral.LookupRole(ctx, &cyral.LookupRoleArgs{
			Name: pulumi.StringRef("^.*Admin$"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cyral = Pulumi.Cyral;
return await Deployment.RunAsync(() => 
{
    var adminRoles = Cyral.GetRole.Invoke(new()
    {
        Name = "^.*Admin$",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cyral.CyralFunctions;
import com.pulumi.cyral.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 adminRoles = CyralFunctions.getRole(GetRoleArgs.builder()
            .name("^.*Admin$")
            .build());
    }
}
variables:
  adminRoles:
    fn::invoke:
      function: cyral:getRole
      arguments:
        name: ^.*Admin$
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,
             opts: Optional[InvokeOptions] = None) -> GetRoleResult
def get_role_output(id: Optional[pulumi.Input[str]] = None,
             name: 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: cyral:index/getRole:getRole
  arguments:
    # arguments dictionaryThe following arguments are supported:
getRole Result
The following output properties are available:
- Id string
- The ID of this resource.
- RoleLists List<GetRole Role List> 
- List of existing roles satisfying the filter criteria.
- Name string
- Filter the results by a regular expression (regex) that matches names of existing roles.
- Id string
- The ID of this resource.
- RoleLists []GetRole Role List 
- List of existing roles satisfying the filter criteria.
- Name string
- Filter the results by a regular expression (regex) that matches names of existing roles.
- id String
- The ID of this resource.
- roleLists List<GetRole Role List> 
- List of existing roles satisfying the filter criteria.
- name String
- Filter the results by a regular expression (regex) that matches names of existing roles.
- id string
- The ID of this resource.
- roleLists GetRole Role List[] 
- List of existing roles satisfying the filter criteria.
- name string
- Filter the results by a regular expression (regex) that matches names of existing roles.
- id str
- The ID of this resource.
- role_lists Sequence[GetRole Role List] 
- List of existing roles satisfying the filter criteria.
- name str
- Filter the results by a regular expression (regex) that matches names of existing roles.
- id String
- The ID of this resource.
- roleLists List<Property Map>
- List of existing roles satisfying the filter criteria.
- name String
- Filter the results by a regular expression (regex) that matches names of existing roles.
Supporting Types
GetRoleRoleList   
- Description string
- Id string
- Members List<string>
- Name string
- Roles List<string>
- SsoGroups List<GetRole Role List Sso Group> 
- Description string
- Id string
- Members []string
- Name string
- Roles []string
- SsoGroups []GetRole Role List Sso Group 
- description String
- id String
- members List<String>
- name String
- roles List<String>
- ssoGroups List<GetRole Role List Sso Group> 
- description string
- id string
- members string[]
- name string
- roles string[]
- ssoGroups GetRole Role List Sso Group[] 
- description str
- id str
- members Sequence[str]
- name str
- roles Sequence[str]
- sso_groups Sequence[GetRole Role List Sso Group] 
- description String
- id String
- members List<String>
- name String
- roles List<String>
- ssoGroups List<Property Map>
GetRoleRoleListSsoGroup     
- group_name str
- id str
- idp_id str
- idp_name str
Package Details
- Repository
- cyral cyralinc/terraform-provider-cyral
- License
- Notes
- This Pulumi package is based on the cyralTerraform Provider.
