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 logo
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$",
    });
    
    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 dictionary

    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 string
    Id string
    Members List<string>
    Name string
    Roles List<string>
    SsoGroups List<GetRoleRoleListSsoGroup>
    description String
    id String
    members List<String>
    name String
    roles List<String>
    ssoGroups List<GetRoleRoleListSsoGroup>
    description String
    id String
    members List<String>
    name String
    roles List<String>
    ssoGroups List<Property Map>

    GetRoleRoleListSsoGroup

    GroupName string
    Id string
    IdpId string
    IdpName string
    GroupName string
    Id string
    IdpId string
    IdpName string
    groupName String
    id String
    idpId String
    idpName String
    groupName string
    id string
    idpId string
    idpName string
    groupName String
    id String
    idpId String
    idpName String

    Package Details

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