1. Packages
  2. Cyral Provider
  3. API Docs
  4. getRole
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

cyral.getRole

Explore with Pulumi AI

cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc

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$",
});
Copy
import pulumi
import pulumi_cyral as cyral

admin_roles = cyral.get_role(name="^.*Admin$")
Copy
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
	})
}
Copy
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$",
    });

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

    }
}
Copy
variables:
  adminRoles:
    fn::invoke:
      function: cyral:getRole
      arguments:
        name: ^.*Admin$
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,
             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]
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: cyral:index/getRole:getRole
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Id string
The ID of this resource.
Name string
Filter the results by a regular expression (regex) that matches names of existing roles.
Id string
The ID of this resource.
Name string
Filter the results by a regular expression (regex) that matches names of existing roles.
id String
The ID of this resource.
name String
Filter the results by a regular expression (regex) that matches names of existing roles.
id string
The ID of this resource.
name string
Filter the results by a regular expression (regex) that matches names of existing roles.
id str
The ID of this resource.
name str
Filter the results by a regular expression (regex) that matches names of existing roles.
id String
The ID of this resource.
name String
Filter the results by a regular expression (regex) that matches names of existing roles.

getRole Result

The following output properties are available:

Id string
The ID of this resource.
RoleLists List<GetRoleRoleList>
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 []GetRoleRoleList
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<GetRoleRoleList>
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 GetRoleRoleList[]
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[GetRoleRoleList]
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 This property is required. string
Id This property is required. string
Members This property is required. List<string>
Name This property is required. string
Roles This property is required. List<string>
SsoGroups This property is required. List<GetRoleRoleListSsoGroup>
Description This property is required. string
Id This property is required. string
Members This property is required. []string
Name This property is required. string
Roles This property is required. []string
SsoGroups This property is required. []GetRoleRoleListSsoGroup
description This property is required. String
id This property is required. String
members This property is required. List<String>
name This property is required. String
roles This property is required. List<String>
ssoGroups This property is required. List<GetRoleRoleListSsoGroup>
description This property is required. string
id This property is required. string
members This property is required. string[]
name This property is required. string
roles This property is required. string[]
ssoGroups This property is required. GetRoleRoleListSsoGroup[]
description This property is required. str
id This property is required. str
members This property is required. Sequence[str]
name This property is required. str
roles This property is required. Sequence[str]
sso_groups This property is required. Sequence[GetRoleRoleListSsoGroup]
description This property is required. String
id This property is required. String
members This property is required. List<String>
name This property is required. String
roles This property is required. List<String>
ssoGroups This property is required. List<Property Map>

GetRoleRoleListSsoGroup

GroupName This property is required. string
Id This property is required. string
IdpId This property is required. string
IdpName This property is required. string
GroupName This property is required. string
Id This property is required. string
IdpId This property is required. string
IdpName This property is required. string
groupName This property is required. String
id This property is required. String
idpId This property is required. String
idpName This property is required. String
groupName This property is required. string
id This property is required. string
idpId This property is required. string
idpName This property is required. string
group_name This property is required. str
id This property is required. str
idp_id This property is required. str
idp_name This property is required. str
groupName This property is required. String
id This property is required. String
idpId This property is required. String
idpName This property is required. String

Package Details

Repository
cyral cyralinc/terraform-provider-cyral
License
Notes
This Pulumi package is based on the cyral Terraform Provider.
cyral 4.16.3 published on Monday, Apr 14, 2025 by cyralinc