1. Packages
  2. Snowflake
  3. API Docs
  4. getRoles
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

snowflake.getRoles

Explore with Pulumi AI

snowflake logo
Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as snowflake from "@pulumi/snowflake";
    
    const this = snowflake.getRoles({});
    const ad = snowflake.getRoles({
        pattern: "SYSADMIN",
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    this = snowflake.get_roles()
    ad = snowflake.get_roles(pattern="SYSADMIN")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-snowflake/sdk/go/snowflake"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := snowflake.GetRoles(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		_, err = snowflake.GetRoles(ctx, &snowflake.GetRolesArgs{
    			Pattern: pulumi.StringRef("SYSADMIN"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Snowflake = Pulumi.Snowflake;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = Snowflake.GetRoles.Invoke();
    
        var ad = Snowflake.GetRoles.Invoke(new()
        {
            Pattern = "SYSADMIN",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.snowflake.SnowflakeFunctions;
    import com.pulumi.snowflake.inputs.GetRolesArgs;
    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 this = SnowflakeFunctions.getRoles();
    
            final var ad = SnowflakeFunctions.getRoles(GetRolesArgs.builder()
                .pattern("SYSADMIN")
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          Function: snowflake:getRoles
          Arguments: {}
      ad:
        fn::invoke:
          Function: snowflake:getRoles
          Arguments:
            pattern: SYSADMIN
    

    Using getRoles

    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 getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
    function getRolesOutput(args: GetRolesOutputArgs, opts?: InvokeOptions): Output<GetRolesResult>
    def get_roles(pattern: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetRolesResult
    def get_roles_output(pattern: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetRolesResult]
    func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)
    func GetRolesOutput(ctx *Context, args *GetRolesOutputArgs, opts ...InvokeOption) GetRolesResultOutput

    > Note: This function is named GetRoles in the Go SDK.

    public static class GetRoles 
    {
        public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
        public static Output<GetRolesResult> Invoke(GetRolesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: snowflake:index/getRoles:getRoles
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Pattern string
    Filters the command output by object name.
    Pattern string
    Filters the command output by object name.
    pattern String
    Filters the command output by object name.
    pattern string
    Filters the command output by object name.
    pattern str
    Filters the command output by object name.
    pattern String
    Filters the command output by object name.

    getRoles Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Roles List<GetRolesRole>
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    Pattern string
    Filters the command output by object name.
    Id string
    The provider-assigned unique ID for this managed resource.
    Roles []GetRolesRole
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    Pattern string
    Filters the command output by object name.
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<GetRolesRole>
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    pattern String
    Filters the command output by object name.
    id string
    The provider-assigned unique ID for this managed resource.
    roles GetRolesRole[]
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    pattern string
    Filters the command output by object name.
    id str
    The provider-assigned unique ID for this managed resource.
    roles Sequence[GetRolesRole]
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    pattern str
    Filters the command output by object name.
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<Property Map>
    List of all the roles which you can view across your entire account, including the system-defined roles and any custom roles that exist.
    pattern String
    Filters the command output by object name.

    Supporting Types

    GetRolesRole

    Comment string
    The comment on the role
    Name string
    Identifier for the role.
    Owner string
    The owner of the role
    Comment string
    The comment on the role
    Name string
    Identifier for the role.
    Owner string
    The owner of the role
    comment String
    The comment on the role
    name String
    Identifier for the role.
    owner String
    The owner of the role
    comment string
    The comment on the role
    name string
    Identifier for the role.
    owner string
    The owner of the role
    comment str
    The comment on the role
    name str
    Identifier for the role.
    owner str
    The owner of the role
    comment String
    The comment on the role
    name String
    Identifier for the role.
    owner String
    The owner of the role

    Package Details

    Repository
    Snowflake pulumi/pulumi-snowflake
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the snowflake Terraform Provider.
    snowflake logo
    Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi