Show / Hide Table of Contents

Class Schema

The postgresql..Schema resource creates and manages schema objects within a PostgreSQL database.

Usage

using Pulumi;
using PostgreSql = Pulumi.PostgreSql;

class MyStack : Stack
{
public MyStack()
{
    var appWww = new PostgreSql.Role("appWww", new PostgreSql.RoleArgs
    {
    });
    var appDba = new PostgreSql.Role("appDba", new PostgreSql.RoleArgs
    {
    });
    var appReleng = new PostgreSql.Role("appReleng", new PostgreSql.RoleArgs
    {
    });
    var mySchema = new PostgreSql.Schema("mySchema", new PostgreSql.SchemaArgs
    {
        Owner = "postgres",
        Policies = 
        {
            new PostgreSql.Inputs.SchemaPolicyArgs
            {
                Role = appWww.Name,
                Usage = true,
            },
            new PostgreSql.Inputs.SchemaPolicyArgs
            {
                Create = true,
                Role = appReleng.Name,
                Usage = true,
            },
            new PostgreSql.Inputs.SchemaPolicyArgs
            {
                CreateWithGrant = true,
                Role = appDba.Name,
                UsageWithGrant = true,
            },
        },
    });
}

}
Inheritance
System.Object
Resource
CustomResource
Schema
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 Schema : CustomResource

Constructors

View Source

Schema(String, SchemaArgs, CustomResourceOptions)

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

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

The unique name of the resource

SchemaArgs 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 in which where this schema will be created. (Default: The database used by your provider configuration)

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

DropCascade

When true, will also drop all the objects that are contained in the schema. (Default: false)

Declaration
public Output<bool?> DropCascade { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

IfNotExists

When true, use the existing schema if it exists. (Default: true)

Declaration
public Output<bool?> IfNotExists { get; }
Property Value
Type Description
Output<System.Nullable<System.Boolean>>
View Source

Name

The name of the schema. Must be unique in the PostgreSQL database instance where it is configured.

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

Owner

The ROLE who owns the schema.

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

Policies

Can be specified multiple times for each policy. Each policy block supports fields documented below.

Declaration
public Output<ImmutableArray<SchemaPolicy>> Policies { get; }
Property Value
Type Description
Output<System.Collections.Immutable.ImmutableArray<SchemaPolicy>>

Methods

View Source

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

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

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

SchemaState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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