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

snowflake.getDatabaseRoles

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 dbRoles = snowflake.getDatabaseRoles({
        database: "MYDB",
    });
    
    import pulumi
    import pulumi_snowflake as snowflake
    
    db_roles = snowflake.get_database_roles(database="MYDB")
    
    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.GetDatabaseRoles(ctx, &snowflake.GetDatabaseRolesArgs{
    			Database: "MYDB",
    		}, 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 dbRoles = Snowflake.GetDatabaseRoles.Invoke(new()
        {
            Database = "MYDB",
        });
    
    });
    
    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.GetDatabaseRolesArgs;
    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 dbRoles = SnowflakeFunctions.getDatabaseRoles(GetDatabaseRolesArgs.builder()
                .database("MYDB")
                .build());
    
        }
    }
    
    variables:
      dbRoles:
        fn::invoke:
          Function: snowflake:getDatabaseRoles
          Arguments:
            database: MYDB
    

    Using getDatabaseRoles

    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 getDatabaseRoles(args: GetDatabaseRolesArgs, opts?: InvokeOptions): Promise<GetDatabaseRolesResult>
    function getDatabaseRolesOutput(args: GetDatabaseRolesOutputArgs, opts?: InvokeOptions): Output<GetDatabaseRolesResult>
    def get_database_roles(database: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetDatabaseRolesResult
    def get_database_roles_output(database: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseRolesResult]
    func GetDatabaseRoles(ctx *Context, args *GetDatabaseRolesArgs, opts ...InvokeOption) (*GetDatabaseRolesResult, error)
    func GetDatabaseRolesOutput(ctx *Context, args *GetDatabaseRolesOutputArgs, opts ...InvokeOption) GetDatabaseRolesResultOutput

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

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

    The following arguments are supported:

    Database string
    The database from which to return the database roles from.
    Database string
    The database from which to return the database roles from.
    database String
    The database from which to return the database roles from.
    database string
    The database from which to return the database roles from.
    database str
    The database from which to return the database roles from.
    database String
    The database from which to return the database roles from.

    getDatabaseRoles Result

    The following output properties are available:

    Database string
    The database from which to return the database roles from.
    DatabaseRoles List<GetDatabaseRolesDatabaseRole>
    Lists all the database roles in a specified database.
    Id string
    The provider-assigned unique ID for this managed resource.
    Database string
    The database from which to return the database roles from.
    DatabaseRoles []GetDatabaseRolesDatabaseRole
    Lists all the database roles in a specified database.
    Id string
    The provider-assigned unique ID for this managed resource.
    database String
    The database from which to return the database roles from.
    databaseRoles List<GetDatabaseRolesDatabaseRole>
    Lists all the database roles in a specified database.
    id String
    The provider-assigned unique ID for this managed resource.
    database string
    The database from which to return the database roles from.
    databaseRoles GetDatabaseRolesDatabaseRole[]
    Lists all the database roles in a specified database.
    id string
    The provider-assigned unique ID for this managed resource.
    database str
    The database from which to return the database roles from.
    database_roles Sequence[GetDatabaseRolesDatabaseRole]
    Lists all the database roles in a specified database.
    id str
    The provider-assigned unique ID for this managed resource.
    database String
    The database from which to return the database roles from.
    databaseRoles List<Property Map>
    Lists all the database roles in a specified database.
    id String
    The provider-assigned unique ID for this managed resource.

    Supporting Types

    GetDatabaseRolesDatabaseRole

    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