Show / Hide Table of Contents

Class 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

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",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
DefaultPrivileges
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.PostgreSql
Assembly: Pulumi.PostgreSql.dll
Syntax
public class DefaultPrivileges : CustomResource

Constructors

View Source

DefaultPrivileges(String, DefaultPrivilegesArgs, CustomResourceOptions)

Create a DefaultPrivileges resource with the given unique name, arguments, and options.

Declaration
public DefaultPrivileges(string name, DefaultPrivilegesArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

DefaultPrivilegesArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Database

The database to grant default privileges for this role.

Declaration
public Output<string> Database { get; }
Property Value
Type Description
Output<System.String>
View Source

ObjectType

The PostgreSQL object type to set the default privileges on (one of: table, sequence).

Declaration
public Output<string> ObjectType { get; }
Property Value
Type Description
Output<System.String>
View Source

Owner

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).

Declaration
public Output<string> Owner { get; }
Property Value
Type Description
Output<System.String>
View Source

Privileges

The list of privileges to apply as default privileges.

Declaration
public Output<ImmutableArray<string>> Privileges { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<System.String>>
View Source

Role

The name of the role to which grant default privileges on.

Declaration
public Output<string> Role { get; }
Property Value
Type Description
Output<System.String>
View Source

Schema

The database schema to set default privileges for this role.

Declaration
public Output<string> Schema { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, DefaultPrivilegesState, CustomResourceOptions)

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

Declaration
public static DefaultPrivileges Get(string name, Input<string> id, DefaultPrivilegesState 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.

DefaultPrivilegesState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
DefaultPrivileges
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.