Class Grant
The postgresql..Grant resource creates and manages privileges given to a user for a database schema.
Note: This resource needs Postgresql version 9 or above.
Usage
using Pulumi;
using PostgreSql = Pulumi.PostgreSql;
class MyStack : Stack
{
public MyStack()
{
var readonlyTables = new PostgreSql.Grant("readonlyTables", new PostgreSql.GrantArgs
{
Database = "test_db",
ObjectType = "table",
Privileges =
{
"SELECT",
},
Role = "test_role",
Schema = "public",
});
}
}
Inherited Members
Namespace: Pulumi.PostgreSql
Assembly: Pulumi.PostgreSql.dll
Syntax
public class Grant : CustomResource
Constructors
View SourceGrant(String, GrantArgs, CustomResourceOptions)
Create a Grant resource with the given unique name, arguments, and options.
Declaration
public Grant(string name, GrantArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| GrantArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceDatabase
The database to grant privileges on for this role.
Declaration
public Output<string> Database { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
ObjectType
The PostgreSQL object type to grant the privileges on (one of: table, sequence).
Declaration
public Output<string> ObjectType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Privileges
The list of privileges to grant.
Declaration
public Output<ImmutableArray<string>> Privileges { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
Role
The name of the role to grant privileges on.
Declaration
public Output<string> Role { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Schema
The database schema to grant privileges on for this role.
Declaration
public Output<string> Schema { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
WithGrantOption
Permit the grant recipient to grant it to others
Declaration
public Output<bool?> WithGrantOption { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
Methods
View SourceGet(String, Input<String>, GrantState, CustomResourceOptions)
Get an existing Grant resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Grant Get(string name, Input<string> id, GrantState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| GrantState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Grant |