Titan Core
  • Overview
  • Getting Started
  • Working With Resources
  • Blueprint
  • GitHub Action
  • Resources
    • APIAuthenticationSecurityIntegration
    • APIIntegration
    • AccountParameter
    • AggregationPolicy
    • Alert
    • AuthenticationPolicy
    • AzureStorageIntegration
    • ComputePool
    • Database
    • DatabaseRole
    • DynamicTable
    • EmailNotificationIntegration
    • EventTable
    • ExternalAccessIntegration
    • ExternalStage
    • FailoverGroup
    • FutureGrant
    • GCSStorageIntegration
    • GenericSecret
    • GlueCatalogIntegration
    • Grant
    • GrantOnAll
    • HybridTable
    • ImageRepository
    • InternalStage
    • JSONFileFormat
    • JavascriptUDF
    • MaterializedView
    • NetworkPolicy
    • NetworkRule
    • OAuthSecret
    • ObjectStoreCatalogIntegration
    • PackagesPolicy
    • ParquetFileFormat
    • PasswordPolicy
    • PasswordSecret
    • Pipe
    • PythonStoredProcedure
    • PythonUDF
    • ReplicationGroup
    • ResourceMonitor
    • Role
    • RoleGrant
    • S3StorageIntegration
    • Schema
    • Sequence
    • Service
    • SessionPolicy
    • Share
    • SnowflakePartnerOAuthSecurityIntegration
    • SnowservicesOAuthSecurityIntegration
    • StageStream
    • Table
    • TableStream
    • Tag
    • Task
    • User
    • View
    • ViewStream
    • Warehouse
Powered by GitBook
On this page
  • Examples
  • Python
  • YAML
  • Fields
  1. Resources

Grant

PreviousGlueCatalogIntegrationNextGrantOnAll

Last updated 10 months ago

Represents a grant of privileges on a resource to a role in Snowflake.

Examples

Python

# Global Privs:
grant = Grant(priv="CREATE WAREHOUSE", on="ACCOUNT", to="somerole")
# Warehouse Privs:
grant = Grant(priv="OPERATE", on=Warehouse(name="foo"), to="somerole")
grant = Grant(priv="OPERATE", on_warehouse="foo", to="somerole")
# Schema Privs:
grant = Grant(priv="CREATE TABLE", on=Schema(name="foo"), to="somerole")
grant = Grant(priv="CREATE TABLE", on_schema="foo", to="somerole")
# Table Privs:
grant = Grant(priv="SELECT", on_table="sometable", to="somerole")

YAML

- Grant:
    priv: "SELECT"
    on_table: "some_table"
    to: "some_role"
    grant_option: true

Fields

  • priv (string, required) - The privilege to grant. Examples include 'SELECT', 'INSERT', 'CREATE TABLE'.

  • grant_option (bool) - Specifies whether the grantee can grant the privileges to other roles. Defaults to False.

on (string or , required) - The resource on which the privilege is granted. Can be a string like 'ACCOUNT' or a specific resource object.

to (string or , required) - The role to which the privileges are granted.

owner (string or ) - The owner role of the grant. Defaults to 'SYSADMIN'.

Snowflake Documentation
Resource
Role
Role