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

snowflake.GrantDatabaseRole

Explore with Pulumi AI

Import

format is database_role_name (string) | object_type (ROLE|DATABASE ROLE|SHARE) | grantee_name (string)

$ pulumi import snowflake:index/grantDatabaseRole:GrantDatabaseRole example '"ABC"."test_db_role"|ROLE|"test_parent_role"'
Copy

Create GrantDatabaseRole Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new GrantDatabaseRole(name: string, args: GrantDatabaseRoleArgs, opts?: CustomResourceOptions);
@overload
def GrantDatabaseRole(resource_name: str,
                      args: GrantDatabaseRoleArgs,
                      opts: Optional[ResourceOptions] = None)

@overload
def GrantDatabaseRole(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      database_role_name: Optional[str] = None,
                      parent_database_role_name: Optional[str] = None,
                      parent_role_name: Optional[str] = None,
                      share_name: Optional[str] = None)
func NewGrantDatabaseRole(ctx *Context, name string, args GrantDatabaseRoleArgs, opts ...ResourceOption) (*GrantDatabaseRole, error)
public GrantDatabaseRole(string name, GrantDatabaseRoleArgs args, CustomResourceOptions? opts = null)
public GrantDatabaseRole(String name, GrantDatabaseRoleArgs args)
public GrantDatabaseRole(String name, GrantDatabaseRoleArgs args, CustomResourceOptions options)
type: snowflake:GrantDatabaseRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. GrantDatabaseRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. GrantDatabaseRoleArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. GrantDatabaseRoleArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. GrantDatabaseRoleArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. GrantDatabaseRoleArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var grantDatabaseRoleResource = new Snowflake.GrantDatabaseRole("grantDatabaseRoleResource", new()
{
    DatabaseRoleName = "string",
    ParentDatabaseRoleName = "string",
    ParentRoleName = "string",
    ShareName = "string",
});
Copy
example, err := snowflake.NewGrantDatabaseRole(ctx, "grantDatabaseRoleResource", &snowflake.GrantDatabaseRoleArgs{
	DatabaseRoleName:       pulumi.String("string"),
	ParentDatabaseRoleName: pulumi.String("string"),
	ParentRoleName:         pulumi.String("string"),
	ShareName:              pulumi.String("string"),
})
Copy
var grantDatabaseRoleResource = new GrantDatabaseRole("grantDatabaseRoleResource", GrantDatabaseRoleArgs.builder()
    .databaseRoleName("string")
    .parentDatabaseRoleName("string")
    .parentRoleName("string")
    .shareName("string")
    .build());
Copy
grant_database_role_resource = snowflake.GrantDatabaseRole("grantDatabaseRoleResource",
    database_role_name="string",
    parent_database_role_name="string",
    parent_role_name="string",
    share_name="string")
Copy
const grantDatabaseRoleResource = new snowflake.GrantDatabaseRole("grantDatabaseRoleResource", {
    databaseRoleName: "string",
    parentDatabaseRoleName: "string",
    parentRoleName: "string",
    shareName: "string",
});
Copy
type: snowflake:GrantDatabaseRole
properties:
    databaseRoleName: string
    parentDatabaseRoleName: string
    parentRoleName: string
    shareName: string
Copy

GrantDatabaseRole Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The GrantDatabaseRole resource accepts the following input properties:

DatabaseRoleName
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
ParentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ParentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ShareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
DatabaseRoleName
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
ParentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ParentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ShareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName
This property is required.
Changes to this property will trigger replacement.
String
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. String
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName
This property is required.
Changes to this property will trigger replacement.
string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
database_role_name
This property is required.
Changes to this property will trigger replacement.
str
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parent_database_role_name Changes to this property will trigger replacement. str
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parent_role_name Changes to this property will trigger replacement. str
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
share_name Changes to this property will trigger replacement. str
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName
This property is required.
Changes to this property will trigger replacement.
String
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. String
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.

Outputs

All input properties are implicitly available as output properties. Additionally, the GrantDatabaseRole resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing GrantDatabaseRole Resource

Get an existing GrantDatabaseRole resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: GrantDatabaseRoleState, opts?: CustomResourceOptions): GrantDatabaseRole
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        database_role_name: Optional[str] = None,
        parent_database_role_name: Optional[str] = None,
        parent_role_name: Optional[str] = None,
        share_name: Optional[str] = None) -> GrantDatabaseRole
func GetGrantDatabaseRole(ctx *Context, name string, id IDInput, state *GrantDatabaseRoleState, opts ...ResourceOption) (*GrantDatabaseRole, error)
public static GrantDatabaseRole Get(string name, Input<string> id, GrantDatabaseRoleState? state, CustomResourceOptions? opts = null)
public static GrantDatabaseRole get(String name, Output<String> id, GrantDatabaseRoleState state, CustomResourceOptions options)
resources:  _:    type: snowflake:GrantDatabaseRole    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
DatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
ParentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ParentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ShareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
DatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
ParentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ParentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
ShareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. String
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. string
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. string
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
database_role_name Changes to this property will trigger replacement. str
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parent_database_role_name Changes to this property will trigger replacement. str
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parent_role_name Changes to this property will trigger replacement. str
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
share_name Changes to this property will trigger replacement. str
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.
databaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the database role which will be granted to share or parent role. For more information about this resource, see docs.
parentDatabaseRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent database role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
parentRoleName Changes to this property will trigger replacement. String
The fully qualified name of the parent account role which will create a parent-child relationship between the roles. For more information about this resource, see docs.
shareName Changes to this property will trigger replacement. String
The fully qualified name of the share on which privileges will be granted. For more information about this resource, see docs.

Package Details

Repository
Snowflake pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.