DefaultPrivileges
The postgresql..DefaultPrivileges resource creates and manages default privileges given to a user for a database schema.
Note: This resource needs Postgresql version 9 or above.
Usage
import * as pulumi from "@pulumi/pulumi";
import * as postgresql from "@pulumi/postgresql";
const readOnlyTables = new postgresql.DefaultPrivileges("read_only_tables", {
database: "test_db",
objectType: "table",
owner: "db_owner",
privileges: ["SELECT"],
role: "test_role",
schema: "public",
});import pulumi
import pulumi_postgresql as postgresql
read_only_tables = postgresql.DefaultPrivileges("readOnlyTables",
database="test_db",
object_type="table",
owner="db_owner",
privileges=["SELECT"],
role="test_role",
schema="public")using Pulumi;
using PostgreSql = Pulumi.PostgreSql;
class MyStack : Stack
{
public MyStack()
{
var readOnlyTables = new PostgreSql.DefaultPrivileges("readOnlyTables", new PostgreSql.DefaultPrivilegesArgs
{
Database = "test_db",
ObjectType = "table",
Owner = "db_owner",
Privileges =
{
"SELECT",
},
Role = "test_role",
Schema = "public",
});
}
}
Create a DefaultPrivileges Resource
new DefaultPrivileges(name: string, args: DefaultPrivilegesArgs, opts?: CustomResourceOptions);def DefaultPrivileges(resource_name, opts=None, database=None, object_type=None, owner=None, privileges=None, role=None, schema=None, __props__=None);func NewDefaultPrivileges(ctx *Context, name string, args DefaultPrivilegesArgs, opts ...ResourceOption) (*DefaultPrivileges, error)public DefaultPrivileges(string name, DefaultPrivilegesArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args DefaultPrivilegesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args DefaultPrivilegesArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DefaultPrivilegesArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
DefaultPrivileges Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The DefaultPrivileges resource accepts the following input properties:
- Database string
The database to grant default privileges for this role.
- Object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- Owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- Privileges List<string>
The list of privileges to apply as default privileges.
- Role string
The name of the role to which grant default privileges on.
- Schema string
The database schema to set default privileges for this role.
- Database string
The database to grant default privileges for this role.
- Object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- Owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- Privileges []string
The list of privileges to apply as default privileges.
- Role string
The name of the role to which grant default privileges on.
- Schema string
The database schema to set default privileges for this role.
- database string
The database to grant default privileges for this role.
- object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- privileges string[]
The list of privileges to apply as default privileges.
- role string
The name of the role to which grant default privileges on.
- schema string
The database schema to set default privileges for this role.
- database str
The database to grant default privileges for this role.
- object_
type str The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- owner str
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- privileges List[str]
The list of privileges to apply as default privileges.
- role str
The name of the role to which grant default privileges on.
- schema str
The database schema to set default privileges for this role.
Outputs
All input properties are implicitly available as output properties. Additionally, the DefaultPrivileges resource produces the following output properties:
Look up an Existing DefaultPrivileges Resource
Get an existing DefaultPrivileges 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?: DefaultPrivilegesState, opts?: CustomResourceOptions): DefaultPrivilegesstatic get(resource_name, id, opts=None, database=None, object_type=None, owner=None, privileges=None, role=None, schema=None, __props__=None);func GetDefaultPrivileges(ctx *Context, name string, id IDInput, state *DefaultPrivilegesState, opts ...ResourceOption) (*DefaultPrivileges, error)public static DefaultPrivileges Get(string name, Input<string> id, DefaultPrivilegesState? 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:
- Database string
The database to grant default privileges for this role.
- Object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- Owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- Privileges List<string>
The list of privileges to apply as default privileges.
- Role string
The name of the role to which grant default privileges on.
- Schema string
The database schema to set default privileges for this role.
- Database string
The database to grant default privileges for this role.
- Object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- Owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- Privileges []string
The list of privileges to apply as default privileges.
- Role string
The name of the role to which grant default privileges on.
- Schema string
The database schema to set default privileges for this role.
- database string
The database to grant default privileges for this role.
- object
Type string The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- owner string
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- privileges string[]
The list of privileges to apply as default privileges.
- role string
The name of the role to which grant default privileges on.
- schema string
The database schema to set default privileges for this role.
- database str
The database to grant default privileges for this role.
- object_
type str The PostgreSQL object type to set the default privileges on (one of: table, sequence).
- owner str
Role for which apply default privileges (You can change default privileges only for objects that will be created by yourself or by roles that you are a member of).
- privileges List[str]
The list of privileges to apply as default privileges.
- role str
The name of the role to which grant default privileges on.
- schema str
The database schema to set default privileges for this role.
Package Details
- Repository
- https://github.com/pulumi/pulumi-postgresql
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
postgresqlTerraform Provider.