Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Snowflake

v0.2.1 published on Monday, Sep 27, 2021 by Pulumi

RoleGrants

Import

 $ pulumi import snowflake:index/roleGrants:RoleGrants example rolename

Example Usage

using Pulumi;
using Snowflake = Pulumi.Snowflake;

class MyStack : Stack
{
    public MyStack()
    {
        var role = new Snowflake.Role("role", new Snowflake.RoleArgs
        {
            Comment = "for testing",
        });
        var user = new Snowflake.User("user", new Snowflake.UserArgs
        {
            Comment = "for testing",
        });
        var user2 = new Snowflake.User("user2", new Snowflake.UserArgs
        {
            Comment = "for testing",
        });
        var otherRole = new Snowflake.Role("otherRole", new Snowflake.RoleArgs
        {
        });
        var grants = new Snowflake.RoleGrants("grants", new Snowflake.RoleGrantsArgs
        {
            RoleName = role.Name,
            Roles = 
            {
                otherRole.Name,
            },
            Users = 
            {
                user.Name,
                user2.Name,
            },
        });
    }

}
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 {
		role, err := snowflake.NewRole(ctx, "role", &snowflake.RoleArgs{
			Comment: pulumi.String("for testing"),
		})
		if err != nil {
			return err
		}
		user, err := snowflake.NewUser(ctx, "user", &snowflake.UserArgs{
			Comment: pulumi.String("for testing"),
		})
		if err != nil {
			return err
		}
		user2, err := snowflake.NewUser(ctx, "user2", &snowflake.UserArgs{
			Comment: pulumi.String("for testing"),
		})
		if err != nil {
			return err
		}
		otherRole, err := snowflake.NewRole(ctx, "otherRole", nil)
		if err != nil {
			return err
		}
		_, err = snowflake.NewRoleGrants(ctx, "grants", &snowflake.RoleGrantsArgs{
			RoleName: role.Name,
			Roles: pulumi.StringArray{
				otherRole.Name,
			},
			Users: pulumi.StringArray{
				user.Name,
				user2.Name,
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_snowflake as snowflake

role = snowflake.Role("role", comment="for testing")
user = snowflake.User("user", comment="for testing")
user2 = snowflake.User("user2", comment="for testing")
other_role = snowflake.Role("otherRole")
grants = snowflake.RoleGrants("grants",
    role_name=role.name,
    roles=[other_role.name],
    users=[
        user.name,
        user2.name,
    ])
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";

const role = new snowflake.Role("role", {
    comment: "for testing",
});
const user = new snowflake.User("user", {
    comment: "for testing",
});
const user2 = new snowflake.User("user2", {
    comment: "for testing",
});
const otherRole = new snowflake.Role("other_role", {});
const grants = new snowflake.RoleGrants("grants", {
    roleName: role.name,
    roles: [otherRole.name],
    users: [
        user.name,
        user2.name,
    ],
});

Create a RoleGrants Resource

new RoleGrants(name: string, args: RoleGrantsArgs, opts?: CustomResourceOptions);
@overload
def RoleGrants(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               role_name: Optional[str] = None,
               roles: Optional[Sequence[str]] = None,
               users: Optional[Sequence[str]] = None)
@overload
def RoleGrants(resource_name: str,
               args: RoleGrantsArgs,
               opts: Optional[ResourceOptions] = None)
func NewRoleGrants(ctx *Context, name string, args RoleGrantsArgs, opts ...ResourceOption) (*RoleGrants, error)
public RoleGrants(string name, RoleGrantsArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args RoleGrantsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args RoleGrantsArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args RoleGrantsArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args RoleGrantsArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

RoleGrants Resource Properties

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

Inputs

The RoleGrants resource accepts the following input properties:

RoleName string
The name of the role we are granting.
Roles List<string>
Grants role to this specified role.
Users List<string>
Grants role to this specified user.
RoleName string
The name of the role we are granting.
Roles []string
Grants role to this specified role.
Users []string
Grants role to this specified user.
roleName string
The name of the role we are granting.
roles string[]
Grants role to this specified role.
users string[]
Grants role to this specified user.
role_name str
The name of the role we are granting.
roles Sequence[str]
Grants role to this specified role.
users Sequence[str]
Grants role to this specified user.

Outputs

All input properties are implicitly available as output properties. Additionally, the RoleGrants 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing RoleGrants Resource

Get an existing RoleGrants 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?: RoleGrantsState, opts?: CustomResourceOptions): RoleGrants
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        role_name: Optional[str] = None,
        roles: Optional[Sequence[str]] = None,
        users: Optional[Sequence[str]] = None) -> RoleGrants
func GetRoleGrants(ctx *Context, name string, id IDInput, state *RoleGrantsState, opts ...ResourceOption) (*RoleGrants, error)
public static RoleGrants Get(string name, Input<string> id, RoleGrantsState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
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
The unique name of the resulting resource.
id
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:

RoleName string
The name of the role we are granting.
Roles List<string>
Grants role to this specified role.
Users List<string>
Grants role to this specified user.
RoleName string
The name of the role we are granting.
Roles []string
Grants role to this specified role.
Users []string
Grants role to this specified user.
roleName string
The name of the role we are granting.
roles string[]
Grants role to this specified role.
users string[]
Grants role to this specified user.
role_name str
The name of the role we are granting.
roles Sequence[str]
Grants role to this specified role.
users Sequence[str]
Grants role to this specified user.

Package Details

Repository
https://github.com/pulumi/pulumi-snowflake
License
Apache-2.0
Notes
This Pulumi package is based on the snowflake Terraform Provider.