Skip to main content

service_role_grants

Creates, updates, deletes, gets or lists a service_role_grants resource.

Overview​

Nameservice_role_grants
TypeResource
Idsnowflake.apps.service_role_grants

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the securable
grantee_namestringThe name of the grantee
created_onstring (date-time)Date and time when the grant was created
granted_onstringThe type of of the securable
granted_tostringThe type of the grantee
privilegestringThe name of the privilege

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdatabase_name, schema_name, service, name, endpointList all the grants given to the service role

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
database_namestringIdentifier (i.e. name) for the database to which the resource belongs. You can use the /api/v2/databases GET request to get a list of available databases.
endpointstringOrganization and account identifier (orgname-accountname) (default: orgname-accountname)
namestringIdentifier (i.e. name) for the resource.
schema_namestringIdentifier (i.e. name) for the schema to which the resource belongs. You can use the /api/v2/databases/{database}/schemas GET request to get a list of available schemas for the specified database.
servicestringName of the service that contains the service role.

SELECT examples​

List all the grants given to the service role

SELECT
name,
grantee_name,
created_on,
granted_on,
granted_to,
privilege
FROM snowflake.apps.service_role_grants
WHERE database_name = '{{ database_name }}' -- required
AND schema_name = '{{ schema_name }}' -- required
AND service = '{{ service }}' -- required
AND name = '{{ name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;