1. Packages
  2. Snowflake Provider
  3. API Docs
  4. getDatabaseRoles
Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi

snowflake.getDatabaseRoles

Explore with Pulumi AI

Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi

Data source used to get details of filtered database roles. Filtering is aligned with the current possibilities for SHOW DATABASE ROLES query (like and limit are supported). The results of SHOW is encapsulated in show_output collection.

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>
Copy
def get_database_roles(in_database: Optional[str] = None,
                       like: Optional[str] = None,
                       limit: Optional[GetDatabaseRolesLimit] = None,
                       opts: Optional[InvokeOptions] = None) -> GetDatabaseRolesResult
def get_database_roles_output(in_database: Optional[pulumi.Input[str]] = None,
                       like: Optional[pulumi.Input[str]] = None,
                       limit: Optional[pulumi.Input[GetDatabaseRolesLimitArgs]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetDatabaseRolesResult]
Copy
func GetDatabaseRoles(ctx *Context, args *GetDatabaseRolesArgs, opts ...InvokeOption) (*GetDatabaseRolesResult, error)
func GetDatabaseRolesOutput(ctx *Context, args *GetDatabaseRolesOutputArgs, opts ...InvokeOption) GetDatabaseRolesResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetDatabaseRolesResult> getDatabaseRoles(GetDatabaseRolesArgs args, InvokeOptions options)
public static Output<GetDatabaseRolesResult> getDatabaseRoles(GetDatabaseRolesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: snowflake:index/getDatabaseRoles:getDatabaseRoles
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

InDatabase This property is required. string
The database from which to return the database roles from.
Like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
Limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
InDatabase This property is required. string
The database from which to return the database roles from.
Like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
Limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
inDatabase This property is required. String
The database from which to return the database roles from.
like String
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
inDatabase This property is required. string
The database from which to return the database roles from.
like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
in_database This property is required. str
The database from which to return the database roles from.
like str
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
inDatabase This property is required. String
The database from which to return the database roles from.
like String
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit Property Map
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.

getDatabaseRoles Result

The following output properties are available:

DatabaseRoles List<GetDatabaseRolesDatabaseRole>
Holds the aggregated output of all database role details queries.
Id string
The provider-assigned unique ID for this managed resource.
InDatabase string
The database from which to return the database roles from.
Like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
Limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
DatabaseRoles []GetDatabaseRolesDatabaseRole
Holds the aggregated output of all database role details queries.
Id string
The provider-assigned unique ID for this managed resource.
InDatabase string
The database from which to return the database roles from.
Like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
Limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
databaseRoles List<GetDatabaseRolesDatabaseRole>
Holds the aggregated output of all database role details queries.
id String
The provider-assigned unique ID for this managed resource.
inDatabase String
The database from which to return the database roles from.
like String
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
databaseRoles GetDatabaseRolesDatabaseRole[]
Holds the aggregated output of all database role details queries.
id string
The provider-assigned unique ID for this managed resource.
inDatabase string
The database from which to return the database roles from.
like string
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
database_roles Sequence[GetDatabaseRolesDatabaseRole]
Holds the aggregated output of all database role details queries.
id str
The provider-assigned unique ID for this managed resource.
in_database str
The database from which to return the database roles from.
like str
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit GetDatabaseRolesLimit
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.
databaseRoles List<Property Map>
Holds the aggregated output of all database role details queries.
id String
The provider-assigned unique ID for this managed resource.
inDatabase String
The database from which to return the database roles from.
like String
Filters the output with case-insensitive pattern, with support for SQL wildcard characters (% and _).
limit Property Map
Limits the number of rows returned. If the limit.from is set, then the limit wll start from the first element matched by the expression. The expression is only used to match with the first element, later on the elements are not matched by the prefix, but you can enforce a certain pattern with starts_with or like.

Supporting Types

GetDatabaseRolesDatabaseRole

ShowOutputs This property is required. List<GetDatabaseRolesDatabaseRoleShowOutput>
Holds the output of SHOW DATABASE ROLES.
ShowOutputs This property is required. []GetDatabaseRolesDatabaseRoleShowOutput
Holds the output of SHOW DATABASE ROLES.
showOutputs This property is required. List<GetDatabaseRolesDatabaseRoleShowOutput>
Holds the output of SHOW DATABASE ROLES.
showOutputs This property is required. GetDatabaseRolesDatabaseRoleShowOutput[]
Holds the output of SHOW DATABASE ROLES.
show_outputs This property is required. Sequence[GetDatabaseRolesDatabaseRoleShowOutput]
Holds the output of SHOW DATABASE ROLES.
showOutputs This property is required. List<Property Map>
Holds the output of SHOW DATABASE ROLES.

GetDatabaseRolesDatabaseRoleShowOutput

Comment This property is required. string
CreatedOn This property is required. string
DatabaseName This property is required. string
GrantedDatabaseRoles This property is required. int
GrantedToDatabaseRoles This property is required. int
GrantedToRoles This property is required. int
IsCurrent This property is required. bool
IsDefault This property is required. bool
IsInherited This property is required. bool
Name This property is required. string
Owner This property is required. string
OwnerRoleType This property is required. string
Comment This property is required. string
CreatedOn This property is required. string
DatabaseName This property is required. string
GrantedDatabaseRoles This property is required. int
GrantedToDatabaseRoles This property is required. int
GrantedToRoles This property is required. int
IsCurrent This property is required. bool
IsDefault This property is required. bool
IsInherited This property is required. bool
Name This property is required. string
Owner This property is required. string
OwnerRoleType This property is required. string
comment This property is required. String
createdOn This property is required. String
databaseName This property is required. String
grantedDatabaseRoles This property is required. Integer
grantedToDatabaseRoles This property is required. Integer
grantedToRoles This property is required. Integer
isCurrent This property is required. Boolean
isDefault This property is required. Boolean
isInherited This property is required. Boolean
name This property is required. String
owner This property is required. String
ownerRoleType This property is required. String
comment This property is required. string
createdOn This property is required. string
databaseName This property is required. string
grantedDatabaseRoles This property is required. number
grantedToDatabaseRoles This property is required. number
grantedToRoles This property is required. number
isCurrent This property is required. boolean
isDefault This property is required. boolean
isInherited This property is required. boolean
name This property is required. string
owner This property is required. string
ownerRoleType This property is required. string
comment This property is required. str
created_on This property is required. str
database_name This property is required. str
granted_database_roles This property is required. int
granted_to_database_roles This property is required. int
granted_to_roles This property is required. int
is_current This property is required. bool
is_default This property is required. bool
is_inherited This property is required. bool
name This property is required. str
owner This property is required. str
owner_role_type This property is required. str
comment This property is required. String
createdOn This property is required. String
databaseName This property is required. String
grantedDatabaseRoles This property is required. Number
grantedToDatabaseRoles This property is required. Number
grantedToRoles This property is required. Number
isCurrent This property is required. Boolean
isDefault This property is required. Boolean
isInherited This property is required. Boolean
name This property is required. String
owner This property is required. String
ownerRoleType This property is required. String

GetDatabaseRolesLimit

Rows This property is required. int
The maximum number of rows to return.
From string
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.
Rows This property is required. int
The maximum number of rows to return.
From string
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.
rows This property is required. Integer
The maximum number of rows to return.
from String
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.
rows This property is required. number
The maximum number of rows to return.
from string
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.
rows This property is required. int
The maximum number of rows to return.
from_ str
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.
rows This property is required. Number
The maximum number of rows to return.
from String
Specifies a case-sensitive pattern that is used to match object name. After the first match, the limit on the number of rows will be applied.

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.
Snowflake v1.2.0 published on Monday, Apr 14, 2025 by Pulumi