Snowflake v0.55.0 published on Friday, Jun 7, 2024 by Pulumi
snowflake.getGrants
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as snowflake from "@pulumi/snowflake";
//#################################
//## SHOW GRANTS ON ...
//#################################
// account
const exampleOnAccount = snowflake.getGrants({
    grantsOn: {
        account: true,
    },
});
// account object (e.g. database)
const exampleOnAccountObject = snowflake.getGrants({
    grantsOn: {
        objectName: "some_database",
        objectType: "DATABASE",
    },
});
// database object (e.g. schema)
const exampleOnDatabaseObject = snowflake.getGrants({
    grantsOn: {
        objectName: "\"some_database\".\"some_schema\"",
        objectType: "SCHEMA",
    },
});
// schema object (e.g. table)
const exampleOnSchemaObject = snowflake.getGrants({
    grantsOn: {
        objectName: "\"some_database\".\"some_schema\".\"some_table\"",
        objectType: "TABLE",
    },
});
// application
const exampleToApplication = snowflake.getGrants({
    grantsTo: {
        application: "some_application",
    },
});
// application role
const exampleToApplicationRole = snowflake.getGrants({
    grantsTo: {
        applicationRole: "\"some_application\".\"some_application_role\"",
    },
});
// account role
const exampleToRole = snowflake.getGrants({
    grantsTo: {
        accountRole: "some_role",
    },
});
// database role
const exampleToDatabaseRole = snowflake.getGrants({
    grantsTo: {
        databaseRole: "\"some_database\".\"some_database_role\"",
    },
});
// share
const exampleToShare = snowflake.getGrants({
    grantsTo: {
        share: {
            shareName: "some_share",
        },
    },
});
// user
const exampleToUser = snowflake.getGrants({
    grantsTo: {
        user: "some_user",
    },
});
// application role
const exampleOfApplicationRole = snowflake.getGrants({
    grantsOf: {
        applicationRole: "\"some_application\".\"some_application_role\"",
    },
});
// database role
const exampleOfDatabaseRole = snowflake.getGrants({
    grantsOf: {
        databaseRole: "\"some_database\".\"some_database_role\"",
    },
});
// account role
const exampleOfRole = snowflake.getGrants({
    grantsOf: {
        accountRole: "some_role",
    },
});
// share
const exampleOfShare = snowflake.getGrants({
    grantsOf: {
        share: "some_share",
    },
});
// database
const exampleFutureInDatabase = snowflake.getGrants({
    futureGrantsIn: {
        database: "some_database",
    },
});
// schema
const exampleFutureInSchema = snowflake.getGrants({
    futureGrantsIn: {
        schema: "\"some_database\".\"some_schema\"",
    },
});
// account role
const exampleFutureToRole = snowflake.getGrants({
    futureGrantsTo: {
        accountRole: "some_role",
    },
});
// database role
const exampleFutureToDatabaseRole = snowflake.getGrants({
    futureGrantsTo: {
        databaseRole: "\"some_database\".\"some_database_role\"",
    },
});
import pulumi
import pulumi_snowflake as snowflake
##################################
### SHOW GRANTS ON ...
##################################
# account
example_on_account = snowflake.get_grants(grants_on=snowflake.GetGrantsGrantsOnArgs(
    account=True,
))
# account object (e.g. database)
example_on_account_object = snowflake.get_grants(grants_on=snowflake.GetGrantsGrantsOnArgs(
    object_name="some_database",
    object_type="DATABASE",
))
# database object (e.g. schema)
example_on_database_object = snowflake.get_grants(grants_on=snowflake.GetGrantsGrantsOnArgs(
    object_name="\"some_database\".\"some_schema\"",
    object_type="SCHEMA",
))
# schema object (e.g. table)
example_on_schema_object = snowflake.get_grants(grants_on=snowflake.GetGrantsGrantsOnArgs(
    object_name="\"some_database\".\"some_schema\".\"some_table\"",
    object_type="TABLE",
))
# application
example_to_application = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    application="some_application",
))
# application role
example_to_application_role = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    application_role="\"some_application\".\"some_application_role\"",
))
# account role
example_to_role = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    account_role="some_role",
))
# database role
example_to_database_role = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    database_role="\"some_database\".\"some_database_role\"",
))
# share
example_to_share = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    share=snowflake.GetGrantsGrantsToShareArgs(
        share_name="some_share",
    ),
))
# user
example_to_user = snowflake.get_grants(grants_to=snowflake.GetGrantsGrantsToArgs(
    user="some_user",
))
# application role
example_of_application_role = snowflake.get_grants(grants_of=snowflake.GetGrantsGrantsOfArgs(
    application_role="\"some_application\".\"some_application_role\"",
))
# database role
example_of_database_role = snowflake.get_grants(grants_of=snowflake.GetGrantsGrantsOfArgs(
    database_role="\"some_database\".\"some_database_role\"",
))
# account role
example_of_role = snowflake.get_grants(grants_of=snowflake.GetGrantsGrantsOfArgs(
    account_role="some_role",
))
# share
example_of_share = snowflake.get_grants(grants_of=snowflake.GetGrantsGrantsOfArgs(
    share="some_share",
))
# database
example_future_in_database = snowflake.get_grants(future_grants_in=snowflake.GetGrantsFutureGrantsInArgs(
    database="some_database",
))
# schema
example_future_in_schema = snowflake.get_grants(future_grants_in=snowflake.GetGrantsFutureGrantsInArgs(
    schema="\"some_database\".\"some_schema\"",
))
# account role
example_future_to_role = snowflake.get_grants(future_grants_to=snowflake.GetGrantsFutureGrantsToArgs(
    account_role="some_role",
))
# database role
example_future_to_database_role = snowflake.get_grants(future_grants_to=snowflake.GetGrantsFutureGrantsToArgs(
    database_role="\"some_database\".\"some_database_role\"",
))
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 {
		// #################################
		// ## SHOW GRANTS ON ...
		// #################################
		// account
		_, err := snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOn: snowflake.GetGrantsGrantsOn{
				Account: pulumi.BoolRef(true),
			},
		}, nil)
		if err != nil {
			return err
		}
		// account object (e.g. database)
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOn: snowflake.GetGrantsGrantsOn{
				ObjectName: pulumi.StringRef("some_database"),
				ObjectType: pulumi.StringRef("DATABASE"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// database object (e.g. schema)
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOn: snowflake.GetGrantsGrantsOn{
				ObjectName: pulumi.StringRef("\"some_database\".\"some_schema\""),
				ObjectType: pulumi.StringRef("SCHEMA"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// schema object (e.g. table)
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOn: snowflake.GetGrantsGrantsOn{
				ObjectName: pulumi.StringRef("\"some_database\".\"some_schema\".\"some_table\""),
				ObjectType: pulumi.StringRef("TABLE"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// application
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				Application: pulumi.StringRef("some_application"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// application role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				ApplicationRole: pulumi.StringRef("\"some_application\".\"some_application_role\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		// account role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				AccountRole: pulumi.StringRef("some_role"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// database role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				DatabaseRole: pulumi.StringRef("\"some_database\".\"some_database_role\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		// share
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				Share: snowflake.GetGrantsGrantsToShare{
					ShareName: "some_share",
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		// user
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsTo: snowflake.GetGrantsGrantsTo{
				User: pulumi.StringRef("some_user"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// application role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOf: snowflake.GetGrantsGrantsOf{
				ApplicationRole: pulumi.StringRef("\"some_application\".\"some_application_role\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		// database role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOf: snowflake.GetGrantsGrantsOf{
				DatabaseRole: pulumi.StringRef("\"some_database\".\"some_database_role\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		// account role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOf: snowflake.GetGrantsGrantsOf{
				AccountRole: pulumi.StringRef("some_role"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// share
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			GrantsOf: snowflake.GetGrantsGrantsOf{
				Share: pulumi.StringRef("some_share"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// database
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			FutureGrantsIn: snowflake.GetGrantsFutureGrantsIn{
				Database: pulumi.StringRef("some_database"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// schema
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			FutureGrantsIn: snowflake.GetGrantsFutureGrantsIn{
				Schema: pulumi.StringRef("\"some_database\".\"some_schema\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		// account role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			FutureGrantsTo: snowflake.GetGrantsFutureGrantsTo{
				AccountRole: pulumi.StringRef("some_role"),
			},
		}, nil)
		if err != nil {
			return err
		}
		// database role
		_, err = snowflake.GetGrants(ctx, &snowflake.GetGrantsArgs{
			FutureGrantsTo: snowflake.GetGrantsFutureGrantsTo{
				DatabaseRole: pulumi.StringRef("\"some_database\".\"some_database_role\""),
			},
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Snowflake = Pulumi.Snowflake;
return await Deployment.RunAsync(() => 
{
    //#################################
    //## SHOW GRANTS ON ...
    //#################################
    // account
    var exampleOnAccount = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOn = new Snowflake.Inputs.GetGrantsGrantsOnInputArgs
        {
            Account = true,
        },
    });
    // account object (e.g. database)
    var exampleOnAccountObject = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOn = new Snowflake.Inputs.GetGrantsGrantsOnInputArgs
        {
            ObjectName = "some_database",
            ObjectType = "DATABASE",
        },
    });
    // database object (e.g. schema)
    var exampleOnDatabaseObject = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOn = new Snowflake.Inputs.GetGrantsGrantsOnInputArgs
        {
            ObjectName = "\"some_database\".\"some_schema\"",
            ObjectType = "SCHEMA",
        },
    });
    // schema object (e.g. table)
    var exampleOnSchemaObject = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOn = new Snowflake.Inputs.GetGrantsGrantsOnInputArgs
        {
            ObjectName = "\"some_database\".\"some_schema\".\"some_table\"",
            ObjectType = "TABLE",
        },
    });
    // application
    var exampleToApplication = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            Application = "some_application",
        },
    });
    // application role
    var exampleToApplicationRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            ApplicationRole = "\"some_application\".\"some_application_role\"",
        },
    });
    // account role
    var exampleToRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            AccountRole = "some_role",
        },
    });
    // database role
    var exampleToDatabaseRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            DatabaseRole = "\"some_database\".\"some_database_role\"",
        },
    });
    // share
    var exampleToShare = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            Share = new Snowflake.Inputs.GetGrantsGrantsToShareInputArgs
            {
                ShareName = "some_share",
            },
        },
    });
    // user
    var exampleToUser = Snowflake.GetGrants.Invoke(new()
    {
        GrantsTo = new Snowflake.Inputs.GetGrantsGrantsToInputArgs
        {
            User = "some_user",
        },
    });
    // application role
    var exampleOfApplicationRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOf = new Snowflake.Inputs.GetGrantsGrantsOfInputArgs
        {
            ApplicationRole = "\"some_application\".\"some_application_role\"",
        },
    });
    // database role
    var exampleOfDatabaseRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOf = new Snowflake.Inputs.GetGrantsGrantsOfInputArgs
        {
            DatabaseRole = "\"some_database\".\"some_database_role\"",
        },
    });
    // account role
    var exampleOfRole = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOf = new Snowflake.Inputs.GetGrantsGrantsOfInputArgs
        {
            AccountRole = "some_role",
        },
    });
    // share
    var exampleOfShare = Snowflake.GetGrants.Invoke(new()
    {
        GrantsOf = new Snowflake.Inputs.GetGrantsGrantsOfInputArgs
        {
            Share = "some_share",
        },
    });
    // database
    var exampleFutureInDatabase = Snowflake.GetGrants.Invoke(new()
    {
        FutureGrantsIn = new Snowflake.Inputs.GetGrantsFutureGrantsInInputArgs
        {
            Database = "some_database",
        },
    });
    // schema
    var exampleFutureInSchema = Snowflake.GetGrants.Invoke(new()
    {
        FutureGrantsIn = new Snowflake.Inputs.GetGrantsFutureGrantsInInputArgs
        {
            Schema = "\"some_database\".\"some_schema\"",
        },
    });
    // account role
    var exampleFutureToRole = Snowflake.GetGrants.Invoke(new()
    {
        FutureGrantsTo = new Snowflake.Inputs.GetGrantsFutureGrantsToInputArgs
        {
            AccountRole = "some_role",
        },
    });
    // database role
    var exampleFutureToDatabaseRole = Snowflake.GetGrants.Invoke(new()
    {
        FutureGrantsTo = new Snowflake.Inputs.GetGrantsFutureGrantsToInputArgs
        {
            DatabaseRole = "\"some_database\".\"some_database_role\"",
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.snowflake.SnowflakeFunctions;
import com.pulumi.snowflake.inputs.GetGrantsArgs;
import com.pulumi.snowflake.inputs.GetGrantsGrantsOnArgs;
import com.pulumi.snowflake.inputs.GetGrantsGrantsToArgs;
import com.pulumi.snowflake.inputs.GetGrantsGrantsToShareArgs;
import com.pulumi.snowflake.inputs.GetGrantsGrantsOfArgs;
import com.pulumi.snowflake.inputs.GetGrantsFutureGrantsInArgs;
import com.pulumi.snowflake.inputs.GetGrantsFutureGrantsToArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }
    public static void stack(Context ctx) {
        //#################################
        //## SHOW GRANTS ON ...
        //#################################
        // account
        final var exampleOnAccount = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOn(GetGrantsGrantsOnArgs.builder()
                .account(true)
                .build())
            .build());
        // account object (e.g. database)
        final var exampleOnAccountObject = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOn(GetGrantsGrantsOnArgs.builder()
                .objectName("some_database")
                .objectType("DATABASE")
                .build())
            .build());
        // database object (e.g. schema)
        final var exampleOnDatabaseObject = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOn(GetGrantsGrantsOnArgs.builder()
                .objectName("\"some_database\".\"some_schema\"")
                .objectType("SCHEMA")
                .build())
            .build());
        // schema object (e.g. table)
        final var exampleOnSchemaObject = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOn(GetGrantsGrantsOnArgs.builder()
                .objectName("\"some_database\".\"some_schema\".\"some_table\"")
                .objectType("TABLE")
                .build())
            .build());
        // application
        final var exampleToApplication = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .application("some_application")
                .build())
            .build());
        // application role
        final var exampleToApplicationRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .applicationRole("\"some_application\".\"some_application_role\"")
                .build())
            .build());
        // account role
        final var exampleToRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .accountRole("some_role")
                .build())
            .build());
        // database role
        final var exampleToDatabaseRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .databaseRole("\"some_database\".\"some_database_role\"")
                .build())
            .build());
        // share
        final var exampleToShare = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .share(GetGrantsGrantsToShareArgs.builder()
                    .shareName("some_share")
                    .build())
                .build())
            .build());
        // user
        final var exampleToUser = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsTo(GetGrantsGrantsToArgs.builder()
                .user("some_user")
                .build())
            .build());
        // application role
        final var exampleOfApplicationRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOf(GetGrantsGrantsOfArgs.builder()
                .applicationRole("\"some_application\".\"some_application_role\"")
                .build())
            .build());
        // database role
        final var exampleOfDatabaseRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOf(GetGrantsGrantsOfArgs.builder()
                .databaseRole("\"some_database\".\"some_database_role\"")
                .build())
            .build());
        // account role
        final var exampleOfRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOf(GetGrantsGrantsOfArgs.builder()
                .accountRole("some_role")
                .build())
            .build());
        // share
        final var exampleOfShare = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .grantsOf(GetGrantsGrantsOfArgs.builder()
                .share("some_share")
                .build())
            .build());
        // database
        final var exampleFutureInDatabase = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .futureGrantsIn(GetGrantsFutureGrantsInArgs.builder()
                .database("some_database")
                .build())
            .build());
        // schema
        final var exampleFutureInSchema = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .futureGrantsIn(GetGrantsFutureGrantsInArgs.builder()
                .schema("\"some_database\".\"some_schema\"")
                .build())
            .build());
        // account role
        final var exampleFutureToRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .futureGrantsTo(GetGrantsFutureGrantsToArgs.builder()
                .accountRole("some_role")
                .build())
            .build());
        // database role
        final var exampleFutureToDatabaseRole = SnowflakeFunctions.getGrants(GetGrantsArgs.builder()
            .futureGrantsTo(GetGrantsFutureGrantsToArgs.builder()
                .databaseRole("\"some_database\".\"some_database_role\"")
                .build())
            .build());
    }
}
variables:
  ##################################
  ### SHOW GRANTS ON ...
  ##################################
  # account
  exampleOnAccount:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOn:
          account: true
  # account object (e.g. database)
  exampleOnAccountObject:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOn:
          objectName: some_database
          objectType: DATABASE
  # database object (e.g. schema)
  exampleOnDatabaseObject:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOn:
          objectName: '"some_database"."some_schema"'
          objectType: SCHEMA
  # schema object (e.g. table)
  exampleOnSchemaObject: ##################################
  ### SHOW GRANTS TO ...
  ##################################
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOn:
          objectName: '"some_database"."some_schema"."some_table"'
          objectType: TABLE
  # application
  exampleToApplication:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          application: some_application
  # application role
  exampleToApplicationRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          applicationRole: '"some_application"."some_application_role"'
  # account role
  exampleToRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          accountRole: some_role
  # database role
  exampleToDatabaseRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          databaseRole: '"some_database"."some_database_role"'
  # share
  exampleToShare:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          share:
            shareName: some_share
  # user
  exampleToUser: ##################################
  ### SHOW GRANTS OF ...
  ##################################
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsTo:
          user: some_user
  # application role
  exampleOfApplicationRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOf:
          applicationRole: '"some_application"."some_application_role"'
  # database role
  exampleOfDatabaseRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOf:
          databaseRole: '"some_database"."some_database_role"'
  # account role
  exampleOfRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOf:
          accountRole: some_role
  # share
  exampleOfShare: ##################################
  ### SHOW FUTURE GRANTS IN ...
  ##################################
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        grantsOf:
          share: some_share
  # database
  exampleFutureInDatabase:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        futureGrantsIn:
          database: some_database
  # schema
  exampleFutureInSchema: ##################################
  ### SHOW FUTURE GRANTS TO ...
  ##################################
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        futureGrantsIn:
          schema: '"some_database"."some_schema"'
  # account role
  exampleFutureToRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        futureGrantsTo:
          accountRole: some_role
  # database role
  exampleFutureToDatabaseRole:
    fn::invoke:
      Function: snowflake:getGrants
      Arguments:
        futureGrantsTo:
          databaseRole: '"some_database"."some_database_role"'
Using getGrants
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 getGrants(args: GetGrantsArgs, opts?: InvokeOptions): Promise<GetGrantsResult>
function getGrantsOutput(args: GetGrantsOutputArgs, opts?: InvokeOptions): Output<GetGrantsResult>def get_grants(future_grants_in: Optional[GetGrantsFutureGrantsIn] = None,
               future_grants_to: Optional[GetGrantsFutureGrantsTo] = None,
               grants_of: Optional[GetGrantsGrantsOf] = None,
               grants_on: Optional[GetGrantsGrantsOn] = None,
               grants_to: Optional[GetGrantsGrantsTo] = None,
               opts: Optional[InvokeOptions] = None) -> GetGrantsResult
def get_grants_output(future_grants_in: Optional[pulumi.Input[GetGrantsFutureGrantsInArgs]] = None,
               future_grants_to: Optional[pulumi.Input[GetGrantsFutureGrantsToArgs]] = None,
               grants_of: Optional[pulumi.Input[GetGrantsGrantsOfArgs]] = None,
               grants_on: Optional[pulumi.Input[GetGrantsGrantsOnArgs]] = None,
               grants_to: Optional[pulumi.Input[GetGrantsGrantsToArgs]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetGrantsResult]func GetGrants(ctx *Context, args *GetGrantsArgs, opts ...InvokeOption) (*GetGrantsResult, error)
func GetGrantsOutput(ctx *Context, args *GetGrantsOutputArgs, opts ...InvokeOption) GetGrantsResultOutput> Note: This function is named GetGrants in the Go SDK.
public static class GetGrants 
{
    public static Task<GetGrantsResult> InvokeAsync(GetGrantsArgs args, InvokeOptions? opts = null)
    public static Output<GetGrantsResult> Invoke(GetGrantsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetGrantsResult> getGrants(GetGrantsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: snowflake:index/getGrants:getGrants
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - Future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - Grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - Grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - Grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- Future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - Future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - Grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - Grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - Grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- future_
grants_ Getin Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future_
grants_ Getto Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants_
of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants_
on GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants_
to GetGrants Grants To  - Lists all privileges granted to the object.
 
- future
Grants Property MapIn  - Lists all privileges on new (i.e. future) objects.
 - future
Grants Property MapTo  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of Property Map - Lists all objects to which the given object has been granted.
 - grants
On Property Map - Lists all privileges that have been granted on an object or on an account.
 - grants
To Property Map - Lists all privileges granted to the object.
 
getGrants Result
The following output properties are available:
- Grants
List<Get
Grants Grant>  - The list of grants
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - Future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - Grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - Grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - Grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- Grants
[]Get
Grants Grant  - The list of grants
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - Future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - Grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - Grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - Grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- grants
List<Get
Grants Grant>  - The list of grants
 - id String
 - The provider-assigned unique ID for this managed resource.
 - future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- grants
Get
Grants Grant[]  - The list of grants
 - id string
 - The provider-assigned unique ID for this managed resource.
 - future
Grants GetIn Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future
Grants GetTo Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants
On GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants
To GetGrants Grants To  - Lists all privileges granted to the object.
 
- grants
Sequence[Get
Grants Grant]  - The list of grants
 - id str
 - The provider-assigned unique ID for this managed resource.
 - future_
grants_ Getin Grants Future Grants In  - Lists all privileges on new (i.e. future) objects.
 - future_
grants_ Getto Grants Future Grants To  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants_
of GetGrants Grants Of  - Lists all objects to which the given object has been granted.
 - grants_
on GetGrants Grants On  - Lists all privileges that have been granted on an object or on an account.
 - grants_
to GetGrants Grants To  - Lists all privileges granted to the object.
 
- grants List<Property Map>
 - The list of grants
 - id String
 - The provider-assigned unique ID for this managed resource.
 - future
Grants Property MapIn  - Lists all privileges on new (i.e. future) objects.
 - future
Grants Property MapTo  - Lists all privileges granted to the object on new (i.e. future) objects.
 - grants
Of Property Map - Lists all objects to which the given object has been granted.
 - grants
On Property Map - Lists all privileges that have been granted on an object or on an account.
 - grants
To Property Map - Lists all privileges granted to the object.
 
Supporting Types
GetGrantsFutureGrantsIn    
- Database string
 - Lists all privileges on new (i.e. future) objects of a specified type in the database granted to a role.
 - Schema string
 - Lists all privileges on new (i.e. future) objects of a specified type in the schema granted to a role. Schema must be a fully qualified name ("<dbname>"."<schemaname>").
 
- Database string
 - Lists all privileges on new (i.e. future) objects of a specified type in the database granted to a role.
 - Schema string
 - Lists all privileges on new (i.e. future) objects of a specified type in the schema granted to a role. Schema must be a fully qualified name ("<dbname>"."<schemaname>").
 
- database String
 - Lists all privileges on new (i.e. future) objects of a specified type in the database granted to a role.
 - schema String
 - Lists all privileges on new (i.e. future) objects of a specified type in the schema granted to a role. Schema must be a fully qualified name ("<dbname>"."<schemaname>").
 
- database string
 - Lists all privileges on new (i.e. future) objects of a specified type in the database granted to a role.
 - schema string
 - Lists all privileges on new (i.e. future) objects of a specified type in the schema granted to a role. Schema must be a fully qualified name ("<dbname>"."<schemaname>").
 
- database String
 - Lists all privileges on new (i.e. future) objects of a specified type in the database granted to a role.
 - schema String
 - Lists all privileges on new (i.e. future) objects of a specified type in the schema granted to a role. Schema must be a fully qualified name ("<dbname>"."<schemaname>").
 
GetGrantsFutureGrantsTo    
- Account
Role string - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - Database
Role string - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
- Account
Role string - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - Database
Role string - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
- account
Role String - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - database
Role String - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
- account
Role string - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - database
Role string - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
- account_
role str - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - database_
role str - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
- account
Role String - Lists all privileges on new (i.e. future) objects of a specified type in a database or schema granted to the account role.
 - database
Role String - Lists all privileges on new (i.e. future) objects granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 
GetGrantsGrant  
- Created
On string - The date and time the grant was created.
 - Grant
Option bool - Whether the grantee can grant the privilege to others.
 - Granted
By string - The role that granted the privilege.
 - Granted
On string - The object on which the privilege was granted.
 - Granted
To string - The role to which the privilege was granted.
 - Grantee
Name string - The name of the role to which the privilege was granted.
 - Name string
 - The name of the object on which the privilege was granted.
 - Privilege string
 - The privilege granted.
 
- Created
On string - The date and time the grant was created.
 - Grant
Option bool - Whether the grantee can grant the privilege to others.
 - Granted
By string - The role that granted the privilege.
 - Granted
On string - The object on which the privilege was granted.
 - Granted
To string - The role to which the privilege was granted.
 - Grantee
Name string - The name of the role to which the privilege was granted.
 - Name string
 - The name of the object on which the privilege was granted.
 - Privilege string
 - The privilege granted.
 
- created
On String - The date and time the grant was created.
 - grant
Option Boolean - Whether the grantee can grant the privilege to others.
 - granted
By String - The role that granted the privilege.
 - granted
On String - The object on which the privilege was granted.
 - granted
To String - The role to which the privilege was granted.
 - grantee
Name String - The name of the role to which the privilege was granted.
 - name String
 - The name of the object on which the privilege was granted.
 - privilege String
 - The privilege granted.
 
- created
On string - The date and time the grant was created.
 - grant
Option boolean - Whether the grantee can grant the privilege to others.
 - granted
By string - The role that granted the privilege.
 - granted
On string - The object on which the privilege was granted.
 - granted
To string - The role to which the privilege was granted.
 - grantee
Name string - The name of the role to which the privilege was granted.
 - name string
 - The name of the object on which the privilege was granted.
 - privilege string
 - The privilege granted.
 
- created_
on str - The date and time the grant was created.
 - grant_
option bool - Whether the grantee can grant the privilege to others.
 - granted_
by str - The role that granted the privilege.
 - granted_
on str - The object on which the privilege was granted.
 - granted_
to str - The role to which the privilege was granted.
 - grantee_
name str - The name of the role to which the privilege was granted.
 - name str
 - The name of the object on which the privilege was granted.
 - privilege str
 - The privilege granted.
 
- created
On String - The date and time the grant was created.
 - grant
Option Boolean - Whether the grantee can grant the privilege to others.
 - granted
By String - The role that granted the privilege.
 - granted
On String - The object on which the privilege was granted.
 - granted
To String - The role to which the privilege was granted.
 - grantee
Name String - The name of the role to which the privilege was granted.
 - name String
 - The name of the object on which the privilege was granted.
 - privilege String
 - The privilege granted.
 
GetGrantsGrantsOf   
- Account
Role string - Lists all users and roles to which the account role has been granted.
 - Application
Role string - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - Database
Role string - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - string
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
- Account
Role string - Lists all users and roles to which the account role has been granted.
 - Application
Role string - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - Database
Role string - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - string
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
- account
Role String - Lists all users and roles to which the account role has been granted.
 - application
Role String - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - database
Role String - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - String
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
- account
Role string - Lists all users and roles to which the account role has been granted.
 - application
Role string - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - database
Role string - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - string
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
- account_
role str - Lists all users and roles to which the account role has been granted.
 - application_
role str - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - database_
role str - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - str
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
- account
Role String - Lists all users and roles to which the account role has been granted.
 - application
Role String - Lists all the users and roles to which the application role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - database
Role String - Lists all users and roles to which the database role has been granted. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - String
 - Lists all the accounts for the share and indicates the accounts that are using the share.
 
GetGrantsGrantsOn   
- Account bool
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - Object
Name string - Name of object to list privileges on.
 - Object
Type string - Type of object to list privileges on.
 
- Account bool
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - Object
Name string - Name of object to list privileges on.
 - Object
Type string - Type of object to list privileges on.
 
- account Boolean
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - object
Name String - Name of object to list privileges on.
 - object
Type String - Type of object to list privileges on.
 
- account boolean
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - object
Name string - Name of object to list privileges on.
 - object
Type string - Type of object to list privileges on.
 
- account bool
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - object_
name str - Name of object to list privileges on.
 - object_
type str - Type of object to list privileges on.
 
- account Boolean
 - Object hierarchy to list privileges on. The only valid value is: ACCOUNT. Setting this attribute lists all the account-level (i.e. global) privileges that have been granted to roles.
 - object
Name String - Name of object to list privileges on.
 - object
Type String - Type of object to list privileges on.
 
GetGrantsGrantsTo   
- Account
Role string - Lists all privileges and roles granted to the role.
 - Application string
 - Lists all the privileges and roles granted to the application.
 - Application
Role string - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - Database
Role string - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - 
Get
Grants Grants To Share  - Lists all the privileges granted to the share.
 - User string
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
- Account
Role string - Lists all privileges and roles granted to the role.
 - Application string
 - Lists all the privileges and roles granted to the application.
 - Application
Role string - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - Database
Role string - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - 
Get
Grants Grants To Share  - Lists all the privileges granted to the share.
 - User string
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
- account
Role String - Lists all privileges and roles granted to the role.
 - application String
 - Lists all the privileges and roles granted to the application.
 - application
Role String - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - database
Role String - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - 
Get
Grants Grants To Share  - Lists all the privileges granted to the share.
 - user String
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
- account
Role string - Lists all privileges and roles granted to the role.
 - application string
 - Lists all the privileges and roles granted to the application.
 - application
Role string - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - database
Role string - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - 
Get
Grants Grants To Share  - Lists all the privileges granted to the share.
 - user string
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
- account_
role str - Lists all privileges and roles granted to the role.
 - application str
 - Lists all the privileges and roles granted to the application.
 - application_
role str - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - database_
role str - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - 
Get
Grants Grants To Share  - Lists all the privileges granted to the share.
 - user str
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
- account
Role String - Lists all privileges and roles granted to the role.
 - application String
 - Lists all the privileges and roles granted to the application.
 - application
Role String - Lists all the privileges and roles granted to the application role. Must be a fully qualified name ("<appname>"."<approle_name>").
 - database
Role String - Lists all privileges and roles granted to the database role. Must be a fully qualified name ("<dbname>"."<databaserole_name>").
 - Property Map
 - Lists all the privileges granted to the share.
 - user String
 - Lists all the roles granted to the user. Note that the PUBLIC role, which is automatically available to every user, is not listed.
 
GetGrantsGrantsToShare    
- string
 - Lists all of the privileges and roles granted to the specified share.
 
- string
 - Lists all of the privileges and roles granted to the specified share.
 
- String
 - Lists all of the privileges and roles granted to the specified share.
 
- string
 - Lists all of the privileges and roles granted to the specified share.
 
- str
 - Lists all of the privileges and roles granted to the specified share.
 
- String
 - Lists all of the privileges and roles granted to the specified share.
 
Package Details
- Repository
 - Snowflake pulumi/pulumi-snowflake
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
snowflakeTerraform Provider.