postgresql

package
v2.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

A Pulumi package for creating and managing postgresql cloud resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PkgVersion added in v2.6.0

func PkgVersion() (semver.Version, error)

PkgVersion uses reflection to determine the version of the current package.

Types

type Database

type Database struct {
	pulumi.CustomResourceState

	// If `false` then no one can connect to this
	// database. The default is `true`, allowing connections (except as restricted by
	// other mechanisms, such as `GRANT` or `REVOKE CONNECT`).
	AllowConnections pulumi.BoolPtrOutput `pulumi:"allowConnections"`
	// How many concurrent connections can be
	// established to this database. `-1` (the default) means no limit.
	ConnectionLimit pulumi.IntPtrOutput `pulumi:"connectionLimit"`
	// Character set encoding to use in the new database
	Encoding pulumi.StringOutput `pulumi:"encoding"`
	// If `true`, then this database can be cloned by any
	// user with `CREATEDB` privileges; if `false` (the default), then only
	// superusers or the owner of the database can clone it.
	IsTemplate pulumi.BoolOutput `pulumi:"isTemplate"`
	// Collation order (LC_COLLATE) to use in the new database
	LcCollate pulumi.StringOutput `pulumi:"lcCollate"`
	// Character classification (LC_CTYPE) to use in the new database
	LcCtype pulumi.StringOutput `pulumi:"lcCtype"`
	// The name of the database. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringOutput `pulumi:"name"`
	// The role name of the user who will own the database, or
	// `DEFAULT` to use the default (namely, the user executing the command). To
	// create a database owned by another role or to change the owner of an existing
	// database, you must be a direct or indirect member of the specified role, or
	// the username in the provider is a superuser.
	Owner pulumi.StringOutput `pulumi:"owner"`
	// The name of the tablespace that will be
	// associated with the database, or `DEFAULT` to use the template database's
	// tablespace.  This tablespace will be the default tablespace used for objects
	// created in this database.
	TablespaceName pulumi.StringOutput `pulumi:"tablespaceName"`
	// The name of the template from which to create the new database
	Template pulumi.StringOutput `pulumi:"template"`
}

func GetDatabase

func GetDatabase(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *DatabaseState, opts ...pulumi.ResourceOption) (*Database, error)

GetDatabase gets an existing Database resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewDatabase

func NewDatabase(ctx *pulumi.Context,
	name string, args *DatabaseArgs, opts ...pulumi.ResourceOption) (*Database, error)

NewDatabase registers a new resource with the given unique name, arguments, and options.

func (*Database) ElementType added in v2.5.2

func (*Database) ElementType() reflect.Type

func (*Database) ToDatabaseOutput added in v2.5.2

func (i *Database) ToDatabaseOutput() DatabaseOutput

func (*Database) ToDatabaseOutputWithContext added in v2.5.2

func (i *Database) ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput

type DatabaseArgs

type DatabaseArgs struct {
	// If `false` then no one can connect to this
	// database. The default is `true`, allowing connections (except as restricted by
	// other mechanisms, such as `GRANT` or `REVOKE CONNECT`).
	AllowConnections pulumi.BoolPtrInput
	// How many concurrent connections can be
	// established to this database. `-1` (the default) means no limit.
	ConnectionLimit pulumi.IntPtrInput
	// Character set encoding to use in the new database
	Encoding pulumi.StringPtrInput
	// If `true`, then this database can be cloned by any
	// user with `CREATEDB` privileges; if `false` (the default), then only
	// superusers or the owner of the database can clone it.
	IsTemplate pulumi.BoolPtrInput
	// Collation order (LC_COLLATE) to use in the new database
	LcCollate pulumi.StringPtrInput
	// Character classification (LC_CTYPE) to use in the new database
	LcCtype pulumi.StringPtrInput
	// The name of the database. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringPtrInput
	// The role name of the user who will own the database, or
	// `DEFAULT` to use the default (namely, the user executing the command). To
	// create a database owned by another role or to change the owner of an existing
	// database, you must be a direct or indirect member of the specified role, or
	// the username in the provider is a superuser.
	Owner pulumi.StringPtrInput
	// The name of the tablespace that will be
	// associated with the database, or `DEFAULT` to use the template database's
	// tablespace.  This tablespace will be the default tablespace used for objects
	// created in this database.
	TablespaceName pulumi.StringPtrInput
	// The name of the template from which to create the new database
	Template pulumi.StringPtrInput
}

The set of arguments for constructing a Database resource.

func (DatabaseArgs) ElementType

func (DatabaseArgs) ElementType() reflect.Type

type DatabaseInput added in v2.5.2

type DatabaseInput interface {
	pulumi.Input

	ToDatabaseOutput() DatabaseOutput
	ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput
}

type DatabaseOutput added in v2.5.2

type DatabaseOutput struct {
	*pulumi.OutputState
}

func (DatabaseOutput) ElementType added in v2.5.2

func (DatabaseOutput) ElementType() reflect.Type

func (DatabaseOutput) ToDatabaseOutput added in v2.5.2

func (o DatabaseOutput) ToDatabaseOutput() DatabaseOutput

func (DatabaseOutput) ToDatabaseOutputWithContext added in v2.5.2

func (o DatabaseOutput) ToDatabaseOutputWithContext(ctx context.Context) DatabaseOutput

type DatabaseState

type DatabaseState struct {
	// If `false` then no one can connect to this
	// database. The default is `true`, allowing connections (except as restricted by
	// other mechanisms, such as `GRANT` or `REVOKE CONNECT`).
	AllowConnections pulumi.BoolPtrInput
	// How many concurrent connections can be
	// established to this database. `-1` (the default) means no limit.
	ConnectionLimit pulumi.IntPtrInput
	// Character set encoding to use in the new database
	Encoding pulumi.StringPtrInput
	// If `true`, then this database can be cloned by any
	// user with `CREATEDB` privileges; if `false` (the default), then only
	// superusers or the owner of the database can clone it.
	IsTemplate pulumi.BoolPtrInput
	// Collation order (LC_COLLATE) to use in the new database
	LcCollate pulumi.StringPtrInput
	// Character classification (LC_CTYPE) to use in the new database
	LcCtype pulumi.StringPtrInput
	// The name of the database. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringPtrInput
	// The role name of the user who will own the database, or
	// `DEFAULT` to use the default (namely, the user executing the command). To
	// create a database owned by another role or to change the owner of an existing
	// database, you must be a direct or indirect member of the specified role, or
	// the username in the provider is a superuser.
	Owner pulumi.StringPtrInput
	// The name of the tablespace that will be
	// associated with the database, or `DEFAULT` to use the template database's
	// tablespace.  This tablespace will be the default tablespace used for objects
	// created in this database.
	TablespaceName pulumi.StringPtrInput
	// The name of the template from which to create the new database
	Template pulumi.StringPtrInput
}

func (DatabaseState) ElementType

func (DatabaseState) ElementType() reflect.Type

type DefaultPrivileg deprecated

type DefaultPrivileg struct {
	pulumi.CustomResourceState

	// The database to grant default privileges for this role
	Database pulumi.StringOutput `pulumi:"database"`
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type)
	ObjectType pulumi.StringOutput `pulumi:"objectType"`
	// Target role for which to alter default privileges.
	Owner pulumi.StringOutput `pulumi:"owner"`
	// The list of privileges to apply as default privileges
	Privileges pulumi.StringArrayOutput `pulumi:"privileges"`
	// The name of the role to which grant default privileges on
	Role pulumi.StringOutput `pulumi:"role"`
	// The database schema to set default privileges for this role
	Schema pulumi.StringOutput `pulumi:"schema"`
}

Deprecated: postgresql.DefaultPrivileg has been deprecated in favor of postgresql.DefaultPrivileges

func GetDefaultPrivileg

func GetDefaultPrivileg(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *DefaultPrivilegState, opts ...pulumi.ResourceOption) (*DefaultPrivileg, error)

GetDefaultPrivileg gets an existing DefaultPrivileg resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewDefaultPrivileg

func NewDefaultPrivileg(ctx *pulumi.Context,
	name string, args *DefaultPrivilegArgs, opts ...pulumi.ResourceOption) (*DefaultPrivileg, error)

NewDefaultPrivileg registers a new resource with the given unique name, arguments, and options.

func (*DefaultPrivileg) ElementType added in v2.5.2

func (*DefaultPrivileg) ElementType() reflect.Type

func (*DefaultPrivileg) ToDefaultPrivilegOutput added in v2.5.2

func (i *DefaultPrivileg) ToDefaultPrivilegOutput() DefaultPrivilegOutput

func (*DefaultPrivileg) ToDefaultPrivilegOutputWithContext added in v2.5.2

func (i *DefaultPrivileg) ToDefaultPrivilegOutputWithContext(ctx context.Context) DefaultPrivilegOutput

type DefaultPrivilegArgs

type DefaultPrivilegArgs struct {
	// The database to grant default privileges for this role
	Database pulumi.StringInput
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type)
	ObjectType pulumi.StringInput
	// Target role for which to alter default privileges.
	Owner pulumi.StringInput
	// The list of privileges to apply as default privileges
	Privileges pulumi.StringArrayInput
	// The name of the role to which grant default privileges on
	Role pulumi.StringInput
	// The database schema to set default privileges for this role
	Schema pulumi.StringInput
}

The set of arguments for constructing a DefaultPrivileg resource.

func (DefaultPrivilegArgs) ElementType

func (DefaultPrivilegArgs) ElementType() reflect.Type

type DefaultPrivilegInput added in v2.5.2

type DefaultPrivilegInput interface {
	pulumi.Input

	ToDefaultPrivilegOutput() DefaultPrivilegOutput
	ToDefaultPrivilegOutputWithContext(ctx context.Context) DefaultPrivilegOutput
}

type DefaultPrivilegOutput added in v2.5.2

type DefaultPrivilegOutput struct {
	*pulumi.OutputState
}

func (DefaultPrivilegOutput) ElementType added in v2.5.2

func (DefaultPrivilegOutput) ElementType() reflect.Type

func (DefaultPrivilegOutput) ToDefaultPrivilegOutput added in v2.5.2

func (o DefaultPrivilegOutput) ToDefaultPrivilegOutput() DefaultPrivilegOutput

func (DefaultPrivilegOutput) ToDefaultPrivilegOutputWithContext added in v2.5.2

func (o DefaultPrivilegOutput) ToDefaultPrivilegOutputWithContext(ctx context.Context) DefaultPrivilegOutput

type DefaultPrivilegState

type DefaultPrivilegState struct {
	// The database to grant default privileges for this role
	Database pulumi.StringPtrInput
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type)
	ObjectType pulumi.StringPtrInput
	// Target role for which to alter default privileges.
	Owner pulumi.StringPtrInput
	// The list of privileges to apply as default privileges
	Privileges pulumi.StringArrayInput
	// The name of the role to which grant default privileges on
	Role pulumi.StringPtrInput
	// The database schema to set default privileges for this role
	Schema pulumi.StringPtrInput
}

func (DefaultPrivilegState) ElementType

func (DefaultPrivilegState) ElementType() reflect.Type

type DefaultPrivileges

type DefaultPrivileges struct {
	pulumi.CustomResourceState

	// The database to grant default privileges for this role.
	Database pulumi.StringOutput `pulumi:"database"`
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
	ObjectType pulumi.StringOutput `pulumi:"objectType"`
	// 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).
	Owner pulumi.StringOutput `pulumi:"owner"`
	// The list of privileges to apply as default privileges.
	Privileges pulumi.StringArrayOutput `pulumi:"privileges"`
	// The name of the role to which grant default privileges on.
	Role pulumi.StringOutput `pulumi:"role"`
	// The database schema to set default privileges for this role.
	Schema pulumi.StringOutput `pulumi:"schema"`
}

The “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

```go package main

import (

"github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql/"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.NewDefaultPrivileges(ctx, "readOnlyTables", &postgresql.DefaultPrivilegesArgs{
			Database:   pulumi.String("test_db"),
			ObjectType: pulumi.String("table"),
			Owner:      pulumi.String("db_owner"),
			Privileges: pulumi.StringArray{
				pulumi.String("SELECT"),
			},
			Role:   pulumi.String("test_role"),
			Schema: pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

func GetDefaultPrivileges

func GetDefaultPrivileges(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *DefaultPrivilegesState, opts ...pulumi.ResourceOption) (*DefaultPrivileges, error)

GetDefaultPrivileges gets an existing DefaultPrivileges resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewDefaultPrivileges

func NewDefaultPrivileges(ctx *pulumi.Context,
	name string, args *DefaultPrivilegesArgs, opts ...pulumi.ResourceOption) (*DefaultPrivileges, error)

NewDefaultPrivileges registers a new resource with the given unique name, arguments, and options.

func (*DefaultPrivileges) ElementType added in v2.5.2

func (*DefaultPrivileges) ElementType() reflect.Type

func (*DefaultPrivileges) ToDefaultPrivilegesOutput added in v2.5.2

func (i *DefaultPrivileges) ToDefaultPrivilegesOutput() DefaultPrivilegesOutput

func (*DefaultPrivileges) ToDefaultPrivilegesOutputWithContext added in v2.5.2

func (i *DefaultPrivileges) ToDefaultPrivilegesOutputWithContext(ctx context.Context) DefaultPrivilegesOutput

type DefaultPrivilegesArgs

type DefaultPrivilegesArgs struct {
	// The database to grant default privileges for this role.
	Database pulumi.StringInput
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
	ObjectType pulumi.StringInput
	// 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).
	Owner pulumi.StringInput
	// The list of privileges to apply as default privileges.
	Privileges pulumi.StringArrayInput
	// The name of the role to which grant default privileges on.
	Role pulumi.StringInput
	// The database schema to set default privileges for this role.
	Schema pulumi.StringInput
}

The set of arguments for constructing a DefaultPrivileges resource.

func (DefaultPrivilegesArgs) ElementType

func (DefaultPrivilegesArgs) ElementType() reflect.Type

type DefaultPrivilegesInput added in v2.5.2

type DefaultPrivilegesInput interface {
	pulumi.Input

	ToDefaultPrivilegesOutput() DefaultPrivilegesOutput
	ToDefaultPrivilegesOutputWithContext(ctx context.Context) DefaultPrivilegesOutput
}

type DefaultPrivilegesOutput added in v2.5.2

type DefaultPrivilegesOutput struct {
	*pulumi.OutputState
}

func (DefaultPrivilegesOutput) ElementType added in v2.5.2

func (DefaultPrivilegesOutput) ElementType() reflect.Type

func (DefaultPrivilegesOutput) ToDefaultPrivilegesOutput added in v2.5.2

func (o DefaultPrivilegesOutput) ToDefaultPrivilegesOutput() DefaultPrivilegesOutput

func (DefaultPrivilegesOutput) ToDefaultPrivilegesOutputWithContext added in v2.5.2

func (o DefaultPrivilegesOutput) ToDefaultPrivilegesOutputWithContext(ctx context.Context) DefaultPrivilegesOutput

type DefaultPrivilegesState

type DefaultPrivilegesState struct {
	// The database to grant default privileges for this role.
	Database pulumi.StringPtrInput
	// The PostgreSQL object type to set the default privileges on (one of: table, sequence, function, type).
	ObjectType pulumi.StringPtrInput
	// 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).
	Owner pulumi.StringPtrInput
	// The list of privileges to apply as default privileges.
	Privileges pulumi.StringArrayInput
	// The name of the role to which grant default privileges on.
	Role pulumi.StringPtrInput
	// The database schema to set default privileges for this role.
	Schema pulumi.StringPtrInput
}

func (DefaultPrivilegesState) ElementType

func (DefaultPrivilegesState) ElementType() reflect.Type

type Extension

type Extension struct {
	pulumi.CustomResourceState

	// Which database to create the extension on. Defaults to provider database.
	Database pulumi.StringOutput `pulumi:"database"`
	// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
	// objects
	DropCascade pulumi.BoolPtrOutput `pulumi:"dropCascade"`
	// The name of the extension.
	Name pulumi.StringOutput `pulumi:"name"`
	// Sets the schema of an extension.
	Schema pulumi.StringOutput `pulumi:"schema"`
	// Sets the version number of the extension.
	Version pulumi.StringOutput `pulumi:"version"`
}

The “Extension“ resource creates and manages an extension on a PostgreSQL server.

## Usage

```go package main

import (

"github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql/"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.NewExtension(ctx, "myExtension", nil)
		if err != nil {
			return err
		}
		return nil
	})
}

```

func GetExtension

func GetExtension(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *ExtensionState, opts ...pulumi.ResourceOption) (*Extension, error)

GetExtension gets an existing Extension resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewExtension

func NewExtension(ctx *pulumi.Context,
	name string, args *ExtensionArgs, opts ...pulumi.ResourceOption) (*Extension, error)

NewExtension registers a new resource with the given unique name, arguments, and options.

func (*Extension) ElementType added in v2.5.2

func (*Extension) ElementType() reflect.Type

func (*Extension) ToExtensionOutput added in v2.5.2

func (i *Extension) ToExtensionOutput() ExtensionOutput

func (*Extension) ToExtensionOutputWithContext added in v2.5.2

func (i *Extension) ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput

type ExtensionArgs

type ExtensionArgs struct {
	// Which database to create the extension on. Defaults to provider database.
	Database pulumi.StringPtrInput
	// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
	// objects
	DropCascade pulumi.BoolPtrInput
	// The name of the extension.
	Name pulumi.StringPtrInput
	// Sets the schema of an extension.
	Schema pulumi.StringPtrInput
	// Sets the version number of the extension.
	Version pulumi.StringPtrInput
}

The set of arguments for constructing a Extension resource.

func (ExtensionArgs) ElementType

func (ExtensionArgs) ElementType() reflect.Type

type ExtensionInput added in v2.5.2

type ExtensionInput interface {
	pulumi.Input

	ToExtensionOutput() ExtensionOutput
	ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput
}

type ExtensionOutput added in v2.5.2

type ExtensionOutput struct {
	*pulumi.OutputState
}

func (ExtensionOutput) ElementType added in v2.5.2

func (ExtensionOutput) ElementType() reflect.Type

func (ExtensionOutput) ToExtensionOutput added in v2.5.2

func (o ExtensionOutput) ToExtensionOutput() ExtensionOutput

func (ExtensionOutput) ToExtensionOutputWithContext added in v2.5.2

func (o ExtensionOutput) ToExtensionOutputWithContext(ctx context.Context) ExtensionOutput

type ExtensionState

type ExtensionState struct {
	// Which database to create the extension on. Defaults to provider database.
	Database pulumi.StringPtrInput
	// When true, will also drop all the objects that depend on the extension, and in turn all objects that depend on those
	// objects
	DropCascade pulumi.BoolPtrInput
	// The name of the extension.
	Name pulumi.StringPtrInput
	// Sets the schema of an extension.
	Schema pulumi.StringPtrInput
	// Sets the version number of the extension.
	Version pulumi.StringPtrInput
}

func (ExtensionState) ElementType

func (ExtensionState) ElementType() reflect.Type

type Grant

type Grant struct {
	pulumi.CustomResourceState

	// The database to grant privileges on for this role.
	Database pulumi.StringOutput `pulumi:"database"`
	// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
	ObjectType pulumi.StringOutput `pulumi:"objectType"`
	// The list of privileges to grant. There are different kinds of privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE. An empty list could be provided to revoke all privileges for this role.
	Privileges pulumi.StringArrayOutput `pulumi:"privileges"`
	// The name of the role to grant privileges on, Set it to "public" for all roles.
	Role pulumi.StringOutput `pulumi:"role"`
	// The database schema to grant privileges on for this role (Required except if objectType is "database")
	Schema pulumi.StringPtrOutput `pulumi:"schema"`
	// Permit the grant recipient to grant it to others
	WithGrantOption pulumi.BoolPtrOutput `pulumi:"withGrantOption"`
}

The “Grant“ resource creates and manages privileges given to a user for a database schema.

See [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-grant.html)

> **Note:** This resource needs Postgresql version 9 or above.

## Usage

```go package main

import (

"github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql/"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.NewGrant(ctx, "readonlyTables", &postgresql.GrantArgs{
			Database:   pulumi.String("test_db"),
			ObjectType: pulumi.String("table"),
			Privileges: pulumi.StringArray{
				pulumi.String("SELECT"),
			},
			Role:   pulumi.String("test_role"),
			Schema: pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

## Examples

Revoke default accesses for public schema:

```go package main

import (

"github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql/"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.NewGrant(ctx, "revokePublic", &postgresql.GrantArgs{
			Database:   pulumi.String("test_db"),
			ObjectType: pulumi.String("schema"),
			Privileges: []interface{}{},
			Role:       pulumi.String("public"),
			Schema:     pulumi.String("public"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

func GetGrant

func GetGrant(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *GrantState, opts ...pulumi.ResourceOption) (*Grant, error)

GetGrant gets an existing Grant resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewGrant

func NewGrant(ctx *pulumi.Context,
	name string, args *GrantArgs, opts ...pulumi.ResourceOption) (*Grant, error)

NewGrant registers a new resource with the given unique name, arguments, and options.

func (*Grant) ElementType added in v2.5.2

func (*Grant) ElementType() reflect.Type

func (*Grant) ToGrantOutput added in v2.5.2

func (i *Grant) ToGrantOutput() GrantOutput

func (*Grant) ToGrantOutputWithContext added in v2.5.2

func (i *Grant) ToGrantOutputWithContext(ctx context.Context) GrantOutput

type GrantArgs

type GrantArgs struct {
	// The database to grant privileges on for this role.
	Database pulumi.StringInput
	// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
	ObjectType pulumi.StringInput
	// The list of privileges to grant. There are different kinds of privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE. An empty list could be provided to revoke all privileges for this role.
	Privileges pulumi.StringArrayInput
	// The name of the role to grant privileges on, Set it to "public" for all roles.
	Role pulumi.StringInput
	// The database schema to grant privileges on for this role (Required except if objectType is "database")
	Schema pulumi.StringPtrInput
	// Permit the grant recipient to grant it to others
	WithGrantOption pulumi.BoolPtrInput
}

The set of arguments for constructing a Grant resource.

func (GrantArgs) ElementType

func (GrantArgs) ElementType() reflect.Type

type GrantInput added in v2.5.2

type GrantInput interface {
	pulumi.Input

	ToGrantOutput() GrantOutput
	ToGrantOutputWithContext(ctx context.Context) GrantOutput
}

type GrantOutput added in v2.5.2

type GrantOutput struct {
	*pulumi.OutputState
}

func (GrantOutput) ElementType added in v2.5.2

func (GrantOutput) ElementType() reflect.Type

func (GrantOutput) ToGrantOutput added in v2.5.2

func (o GrantOutput) ToGrantOutput() GrantOutput

func (GrantOutput) ToGrantOutputWithContext added in v2.5.2

func (o GrantOutput) ToGrantOutputWithContext(ctx context.Context) GrantOutput

type GrantRole added in v2.7.0

type GrantRole struct {
	pulumi.CustomResourceState

	// The name of the role that is added to `role`.
	GrantRole pulumi.StringOutput `pulumi:"grantRole"`
	// The name of the role that is granted a new membership.
	Role pulumi.StringOutput `pulumi:"role"`
	// Giving ability to grant membership to others or not for `role`. (Default: false)
	WithAdminOption pulumi.BoolPtrOutput `pulumi:"withAdminOption"`
}

The “GrantRole“ resource creates and manages membership in a role to one or more other roles in a non-authoritative way.

When using “GrantRole“ resource it is likely because the PostgreSQL role you are modifying was created outside of this provider.

> **Note:** This resource needs PostgreSQL version 9 or above.

> **Note:** `GrantRole` **cannot** be used in conjunction with `Role` or they will fight over what your role grants should be.

## Usage

```go package main

import (

"github.com/pulumi/pulumi-postgresql/sdk/v2/go/postgresql/"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := postgresql.NewGrantRole(ctx, "grantRoot", &postgresql.GrantRoleArgs{
			GrantRole:       pulumi.String("application"),
			Role:            pulumi.String("root"),
			WithAdminOption: pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

func GetGrantRole added in v2.7.0

func GetGrantRole(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *GrantRoleState, opts ...pulumi.ResourceOption) (*GrantRole, error)

GetGrantRole gets an existing GrantRole resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewGrantRole added in v2.7.0

func NewGrantRole(ctx *pulumi.Context,
	name string, args *GrantRoleArgs, opts ...pulumi.ResourceOption) (*GrantRole, error)

NewGrantRole registers a new resource with the given unique name, arguments, and options.

func (*GrantRole) ElementType added in v2.7.0

func (*GrantRole) ElementType() reflect.Type

func (*GrantRole) ToGrantRoleOutput added in v2.7.0

func (i *GrantRole) ToGrantRoleOutput() GrantRoleOutput

func (*GrantRole) ToGrantRoleOutputWithContext added in v2.7.0

func (i *GrantRole) ToGrantRoleOutputWithContext(ctx context.Context) GrantRoleOutput

type GrantRoleArgs added in v2.7.0

type GrantRoleArgs struct {
	// The name of the role that is added to `role`.
	GrantRole pulumi.StringInput
	// The name of the role that is granted a new membership.
	Role pulumi.StringInput
	// Giving ability to grant membership to others or not for `role`. (Default: false)
	WithAdminOption pulumi.BoolPtrInput
}

The set of arguments for constructing a GrantRole resource.

func (GrantRoleArgs) ElementType added in v2.7.0

func (GrantRoleArgs) ElementType() reflect.Type

type GrantRoleInput added in v2.7.0

type GrantRoleInput interface {
	pulumi.Input

	ToGrantRoleOutput() GrantRoleOutput
	ToGrantRoleOutputWithContext(ctx context.Context) GrantRoleOutput
}

type GrantRoleOutput added in v2.7.0

type GrantRoleOutput struct {
	*pulumi.OutputState
}

func (GrantRoleOutput) ElementType added in v2.7.0

func (GrantRoleOutput) ElementType() reflect.Type

func (GrantRoleOutput) ToGrantRoleOutput added in v2.7.0

func (o GrantRoleOutput) ToGrantRoleOutput() GrantRoleOutput

func (GrantRoleOutput) ToGrantRoleOutputWithContext added in v2.7.0

func (o GrantRoleOutput) ToGrantRoleOutputWithContext(ctx context.Context) GrantRoleOutput

type GrantRoleState added in v2.7.0

type GrantRoleState struct {
	// The name of the role that is added to `role`.
	GrantRole pulumi.StringPtrInput
	// The name of the role that is granted a new membership.
	Role pulumi.StringPtrInput
	// Giving ability to grant membership to others or not for `role`. (Default: false)
	WithAdminOption pulumi.BoolPtrInput
}

func (GrantRoleState) ElementType added in v2.7.0

func (GrantRoleState) ElementType() reflect.Type

type GrantState

type GrantState struct {
	// The database to grant privileges on for this role.
	Database pulumi.StringPtrInput
	// The PostgreSQL object type to grant the privileges on (one of: database, schema, table, sequence,function).
	ObjectType pulumi.StringPtrInput
	// The list of privileges to grant. There are different kinds of privileges: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, CREATE, CONNECT, TEMPORARY, EXECUTE, and USAGE. An empty list could be provided to revoke all privileges for this role.
	Privileges pulumi.StringArrayInput
	// The name of the role to grant privileges on, Set it to "public" for all roles.
	Role pulumi.StringPtrInput
	// The database schema to grant privileges on for this role (Required except if objectType is "database")
	Schema pulumi.StringPtrInput
	// Permit the grant recipient to grant it to others
	WithGrantOption pulumi.BoolPtrInput
}

func (GrantState) ElementType

func (GrantState) ElementType() reflect.Type

type Provider

type Provider struct {
	pulumi.ProviderResourceState
}

The provider type for the postgresql package. By default, resources use package-wide configuration settings, however an explicit `Provider` instance may be created and passed during resource construction to achieve fine-grained programmatic control over provider settings. See the [documentation](https://www.pulumi.com/docs/reference/programming-model/#providers) for more information.

func NewProvider

func NewProvider(ctx *pulumi.Context,
	name string, args *ProviderArgs, opts ...pulumi.ResourceOption) (*Provider, error)

NewProvider registers a new resource with the given unique name, arguments, and options.

func (*Provider) ElementType added in v2.5.2

func (*Provider) ElementType() reflect.Type

func (*Provider) ToProviderOutput added in v2.5.2

func (i *Provider) ToProviderOutput() ProviderOutput

func (*Provider) ToProviderOutputWithContext added in v2.5.2

func (i *Provider) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type ProviderArgs

type ProviderArgs struct {
	// SSL client certificate if required by the database.
	Clientcert ProviderClientcertPtrInput
	// Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely.
	ConnectTimeout pulumi.IntPtrInput
	// The name of the database to connect to in order to conenct to (defaults to `postgres`).
	Database pulumi.StringPtrInput
	// Database username associated to the connected user (for user name maps)
	DatabaseUsername pulumi.StringPtrInput
	// Specify the expected version of PostgreSQL.
	ExpectedVersion pulumi.StringPtrInput
	// Name of PostgreSQL server address to connect to
	Host pulumi.StringPtrInput
	// Maximum number of connections to establish to the database. Zero means unlimited.
	MaxConnections pulumi.IntPtrInput
	// Password to be used if the PostgreSQL server demands password authentication
	Password pulumi.StringPtrInput
	// The PostgreSQL port number to connect to at the server host, or socket file name extension for Unix-domain connections
	Port   pulumi.IntPtrInput
	Scheme pulumi.StringPtrInput
	// Deprecated: Rename PostgreSQL provider `ssl_mode` attribute to `sslmode`
	SslMode pulumi.StringPtrInput
	// This option determines whether or with what priority a secure SSL TCP/IP connection will be negotiated with the
	// PostgreSQL server
	Sslmode pulumi.StringPtrInput
	// The SSL server root certificate file path. The file must contain PEM encoded data.
	Sslrootcert pulumi.StringPtrInput
	// Specify if the user to connect as is a Postgres superuser or not.If not, some feature might be disabled (e.g.:
	// Refreshing state password from Postgres)
	Superuser pulumi.BoolPtrInput
	// PostgreSQL user name to connect as
	Username pulumi.StringPtrInput
}

The set of arguments for constructing a Provider resource.

func (ProviderArgs) ElementType

func (ProviderArgs) ElementType() reflect.Type

type ProviderClientcert added in v2.2.0

type ProviderClientcert struct {
	Cert string `pulumi:"cert"`
	Key  string `pulumi:"key"`
}

type ProviderClientcertArgs added in v2.2.0

type ProviderClientcertArgs struct {
	Cert pulumi.StringInput `pulumi:"cert"`
	Key  pulumi.StringInput `pulumi:"key"`
}

func (ProviderClientcertArgs) ElementType added in v2.2.0

func (ProviderClientcertArgs) ElementType() reflect.Type

func (ProviderClientcertArgs) ToProviderClientcertOutput added in v2.2.0

func (i ProviderClientcertArgs) ToProviderClientcertOutput() ProviderClientcertOutput

func (ProviderClientcertArgs) ToProviderClientcertOutputWithContext added in v2.2.0

func (i ProviderClientcertArgs) ToProviderClientcertOutputWithContext(ctx context.Context) ProviderClientcertOutput

func (ProviderClientcertArgs) ToProviderClientcertPtrOutput added in v2.2.0

func (i ProviderClientcertArgs) ToProviderClientcertPtrOutput() ProviderClientcertPtrOutput

func (ProviderClientcertArgs) ToProviderClientcertPtrOutputWithContext added in v2.2.0

func (i ProviderClientcertArgs) ToProviderClientcertPtrOutputWithContext(ctx context.Context) ProviderClientcertPtrOutput

type ProviderClientcertInput added in v2.2.0

type ProviderClientcertInput interface {
	pulumi.Input

	ToProviderClientcertOutput() ProviderClientcertOutput
	ToProviderClientcertOutputWithContext(context.Context) ProviderClientcertOutput
}

ProviderClientcertInput is an input type that accepts ProviderClientcertArgs and ProviderClientcertOutput values. You can construct a concrete instance of `ProviderClientcertInput` via:

ProviderClientcertArgs{...}

type ProviderClientcertOutput added in v2.2.0

type ProviderClientcertOutput struct{ *pulumi.OutputState }

func (ProviderClientcertOutput) Cert added in v2.2.0

func (ProviderClientcertOutput) ElementType added in v2.2.0

func (ProviderClientcertOutput) ElementType() reflect.Type

func (ProviderClientcertOutput) Key added in v2.2.0

func (ProviderClientcertOutput) ToProviderClientcertOutput added in v2.2.0

func (o ProviderClientcertOutput) ToProviderClientcertOutput() ProviderClientcertOutput

func (ProviderClientcertOutput) ToProviderClientcertOutputWithContext added in v2.2.0

func (o ProviderClientcertOutput) ToProviderClientcertOutputWithContext(ctx context.Context) ProviderClientcertOutput

func (ProviderClientcertOutput) ToProviderClientcertPtrOutput added in v2.2.0

func (o ProviderClientcertOutput) ToProviderClientcertPtrOutput() ProviderClientcertPtrOutput

func (ProviderClientcertOutput) ToProviderClientcertPtrOutputWithContext added in v2.2.0

func (o ProviderClientcertOutput) ToProviderClientcertPtrOutputWithContext(ctx context.Context) ProviderClientcertPtrOutput

type ProviderClientcertPtrInput added in v2.2.0

type ProviderClientcertPtrInput interface {
	pulumi.Input

	ToProviderClientcertPtrOutput() ProviderClientcertPtrOutput
	ToProviderClientcertPtrOutputWithContext(context.Context) ProviderClientcertPtrOutput
}

ProviderClientcertPtrInput is an input type that accepts ProviderClientcertArgs, ProviderClientcertPtr and ProviderClientcertPtrOutput values. You can construct a concrete instance of `ProviderClientcertPtrInput` via:

        ProviderClientcertArgs{...}

or:

        nil

func ProviderClientcertPtr added in v2.2.0

func ProviderClientcertPtr(v *ProviderClientcertArgs) ProviderClientcertPtrInput

type ProviderClientcertPtrOutput added in v2.2.0

type ProviderClientcertPtrOutput struct{ *pulumi.OutputState }

func (ProviderClientcertPtrOutput) Cert added in v2.2.0

func (ProviderClientcertPtrOutput) Elem added in v2.2.0

func (ProviderClientcertPtrOutput) ElementType added in v2.2.0

func (ProviderClientcertPtrOutput) Key added in v2.2.0

func (ProviderClientcertPtrOutput) ToProviderClientcertPtrOutput added in v2.2.0

func (o ProviderClientcertPtrOutput) ToProviderClientcertPtrOutput() ProviderClientcertPtrOutput

func (ProviderClientcertPtrOutput) ToProviderClientcertPtrOutputWithContext added in v2.2.0

func (o ProviderClientcertPtrOutput) ToProviderClientcertPtrOutputWithContext(ctx context.Context) ProviderClientcertPtrOutput

type ProviderInput added in v2.5.2

type ProviderInput interface {
	pulumi.Input

	ToProviderOutput() ProviderOutput
	ToProviderOutputWithContext(ctx context.Context) ProviderOutput
}

type ProviderOutput added in v2.5.2

type ProviderOutput struct {
	*pulumi.OutputState
}

func (ProviderOutput) ElementType added in v2.5.2

func (ProviderOutput) ElementType() reflect.Type

func (ProviderOutput) ToProviderOutput added in v2.5.2

func (o ProviderOutput) ToProviderOutput() ProviderOutput

func (ProviderOutput) ToProviderOutputWithContext added in v2.5.2

func (o ProviderOutput) ToProviderOutputWithContext(ctx context.Context) ProviderOutput

type Role

type Role struct {
	pulumi.CustomResourceState

	// Defines whether a role bypasses every
	// row-level security (RLS) policy.  Default value is `false`.
	BypassRowLevelSecurity pulumi.BoolPtrOutput `pulumi:"bypassRowLevelSecurity"`
	// If this role can log in, this specifies how
	// many concurrent connections the role can establish. `-1` (the default) means no
	// limit.
	ConnectionLimit pulumi.IntPtrOutput `pulumi:"connectionLimit"`
	// Defines a role's ability to execute `CREATE
	// DATABASE`.  Default value is `false`.
	CreateDatabase pulumi.BoolPtrOutput `pulumi:"createDatabase"`
	// Defines a role's ability to execute `CREATE ROLE`.
	// A role with this privilege can also alter and drop other roles.  Default value
	// is `false`.
	CreateRole pulumi.BoolPtrOutput `pulumi:"createRole"`
	// Deprecated: Rename PostgreSQL role resource attribute "encrypted" to "encrypted_password"
	Encrypted pulumi.StringPtrOutput `pulumi:"encrypted"`
	// Defines whether the password is stored
	// encrypted in the system catalogs.  Default value is `true`.  NOTE: this value
	// is always set (to the conservative and safe value), but may interfere with the
	// behavior of
	// [PostgreSQL's `passwordEncryption` setting](https://www.postgresql.org/docs/current/static/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION).
	EncryptedPassword pulumi.BoolPtrOutput `pulumi:"encryptedPassword"`
	// Defines whether a role "inherits" the privileges of
	// roles it is a member of.  Default value is `true`.
	Inherit pulumi.BoolPtrOutput `pulumi:"inherit"`
	// Defines whether role is allowed to log in.  Roles without
	// this attribute are useful for managing database privileges, but are not users
	// in the usual sense of the word.  Default value is `false`.
	Login pulumi.BoolPtrOutput `pulumi:"login"`
	// The name of the role. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringOutput `pulumi:"name"`
	// Sets the role's password. A password is only of use
	// for roles having the `login` attribute set to true.
	Password pulumi.StringPtrOutput `pulumi:"password"`
	// Defines whether a role is allowed to initiate
	// streaming replication or put the system in and out of backup mode.  Default
	// value is `false`
	Replication pulumi.BoolPtrOutput `pulumi:"replication"`
	// Defines list of roles which will be granted to this new role.
	Roles pulumi.StringArrayOutput `pulumi:"roles"`
	// Alters the search path of this new role. Note that
	// due to limitations in the implementation, values cannot contain the substring
	// `", "`.
	SearchPaths pulumi.StringArrayOutput `pulumi:"searchPaths"`
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, the
	// [cleanup of ownership of objects](https://www.postgresql.org/docs/current/static/role-removal.html)
	// in each of the respective databases must occur before the ROLE can be dropped
	// from the catalog.  Set this option to true when there are multiple databases
	// in a PostgreSQL cluster using the same PostgreSQL ROLE for object ownership.
	// This is the third and final step taken when removing a ROLE from a database.
	SkipDropRole pulumi.BoolPtrOutput `pulumi:"skipDropRole"`
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, a
	// [`REASSIGN OWNED`](https://www.postgresql.org/docs/current/static/sql-reassign-owned.html) in
	// must be executed on each of the respective databases before the `DROP ROLE`
	// can be executed to dropped the ROLE from the catalog.  This is the first and
	// second steps taken when removing a ROLE from a database (the second step being
	// an implicit
	// [`DROP OWNED`](https://www.postgresql.org/docs/current/static/sql-drop-owned.html)).
	SkipReassignOwned pulumi.BoolPtrOutput `pulumi:"skipReassignOwned"`
	// Defines [`statementTimeout`](https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT) setting for this role which allows to abort any statement that takes more than the specified amount of time.
	StatementTimeout pulumi.IntPtrOutput `pulumi:"statementTimeout"`
	// Defines whether the role is a "superuser", and
	// therefore can override all access restrictions within the database.  Default
	// value is `false`.
	Superuser pulumi.BoolPtrOutput `pulumi:"superuser"`
	// Defines the date and time after which the role's
	// password is no longer valid.  Established connections past this `validTime`
	// will have to be manually terminated.  This value corresponds to a PostgreSQL
	// datetime. If omitted or the magic value `NULL` is used, `validUntil` will be
	// set to `infinity`.  Default is `NULL`, therefore `infinity`.
	ValidUntil pulumi.StringPtrOutput `pulumi:"validUntil"`
}

func GetRole

func GetRole(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *RoleState, opts ...pulumi.ResourceOption) (*Role, error)

GetRole gets an existing Role resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewRole

func NewRole(ctx *pulumi.Context,
	name string, args *RoleArgs, opts ...pulumi.ResourceOption) (*Role, error)

NewRole registers a new resource with the given unique name, arguments, and options.

func (*Role) ElementType added in v2.5.2

func (*Role) ElementType() reflect.Type

func (*Role) ToRoleOutput added in v2.5.2

func (i *Role) ToRoleOutput() RoleOutput

func (*Role) ToRoleOutputWithContext added in v2.5.2

func (i *Role) ToRoleOutputWithContext(ctx context.Context) RoleOutput

type RoleArgs

type RoleArgs struct {
	// Defines whether a role bypasses every
	// row-level security (RLS) policy.  Default value is `false`.
	BypassRowLevelSecurity pulumi.BoolPtrInput
	// If this role can log in, this specifies how
	// many concurrent connections the role can establish. `-1` (the default) means no
	// limit.
	ConnectionLimit pulumi.IntPtrInput
	// Defines a role's ability to execute `CREATE
	// DATABASE`.  Default value is `false`.
	CreateDatabase pulumi.BoolPtrInput
	// Defines a role's ability to execute `CREATE ROLE`.
	// A role with this privilege can also alter and drop other roles.  Default value
	// is `false`.
	CreateRole pulumi.BoolPtrInput
	// Deprecated: Rename PostgreSQL role resource attribute "encrypted" to "encrypted_password"
	Encrypted pulumi.StringPtrInput
	// Defines whether the password is stored
	// encrypted in the system catalogs.  Default value is `true`.  NOTE: this value
	// is always set (to the conservative and safe value), but may interfere with the
	// behavior of
	// [PostgreSQL's `passwordEncryption` setting](https://www.postgresql.org/docs/current/static/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION).
	EncryptedPassword pulumi.BoolPtrInput
	// Defines whether a role "inherits" the privileges of
	// roles it is a member of.  Default value is `true`.
	Inherit pulumi.BoolPtrInput
	// Defines whether role is allowed to log in.  Roles without
	// this attribute are useful for managing database privileges, but are not users
	// in the usual sense of the word.  Default value is `false`.
	Login pulumi.BoolPtrInput
	// The name of the role. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringPtrInput
	// Sets the role's password. A password is only of use
	// for roles having the `login` attribute set to true.
	Password pulumi.StringPtrInput
	// Defines whether a role is allowed to initiate
	// streaming replication or put the system in and out of backup mode.  Default
	// value is `false`
	Replication pulumi.BoolPtrInput
	// Defines list of roles which will be granted to this new role.
	Roles pulumi.StringArrayInput
	// Alters the search path of this new role. Note that
	// due to limitations in the implementation, values cannot contain the substring
	// `", "`.
	SearchPaths pulumi.StringArrayInput
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, the
	// [cleanup of ownership of objects](https://www.postgresql.org/docs/current/static/role-removal.html)
	// in each of the respective databases must occur before the ROLE can be dropped
	// from the catalog.  Set this option to true when there are multiple databases
	// in a PostgreSQL cluster using the same PostgreSQL ROLE for object ownership.
	// This is the third and final step taken when removing a ROLE from a database.
	SkipDropRole pulumi.BoolPtrInput
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, a
	// [`REASSIGN OWNED`](https://www.postgresql.org/docs/current/static/sql-reassign-owned.html) in
	// must be executed on each of the respective databases before the `DROP ROLE`
	// can be executed to dropped the ROLE from the catalog.  This is the first and
	// second steps taken when removing a ROLE from a database (the second step being
	// an implicit
	// [`DROP OWNED`](https://www.postgresql.org/docs/current/static/sql-drop-owned.html)).
	SkipReassignOwned pulumi.BoolPtrInput
	// Defines [`statementTimeout`](https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT) setting for this role which allows to abort any statement that takes more than the specified amount of time.
	StatementTimeout pulumi.IntPtrInput
	// Defines whether the role is a "superuser", and
	// therefore can override all access restrictions within the database.  Default
	// value is `false`.
	Superuser pulumi.BoolPtrInput
	// Defines the date and time after which the role's
	// password is no longer valid.  Established connections past this `validTime`
	// will have to be manually terminated.  This value corresponds to a PostgreSQL
	// datetime. If omitted or the magic value `NULL` is used, `validUntil` will be
	// set to `infinity`.  Default is `NULL`, therefore `infinity`.
	ValidUntil pulumi.StringPtrInput
}

The set of arguments for constructing a Role resource.

func (RoleArgs) ElementType

func (RoleArgs) ElementType() reflect.Type

type RoleInput added in v2.5.2

type RoleInput interface {
	pulumi.Input

	ToRoleOutput() RoleOutput
	ToRoleOutputWithContext(ctx context.Context) RoleOutput
}

type RoleOutput added in v2.5.2

type RoleOutput struct {
	*pulumi.OutputState
}

func (RoleOutput) ElementType added in v2.5.2

func (RoleOutput) ElementType() reflect.Type

func (RoleOutput) ToRoleOutput added in v2.5.2

func (o RoleOutput) ToRoleOutput() RoleOutput

func (RoleOutput) ToRoleOutputWithContext added in v2.5.2

func (o RoleOutput) ToRoleOutputWithContext(ctx context.Context) RoleOutput

type RoleState

type RoleState struct {
	// Defines whether a role bypasses every
	// row-level security (RLS) policy.  Default value is `false`.
	BypassRowLevelSecurity pulumi.BoolPtrInput
	// If this role can log in, this specifies how
	// many concurrent connections the role can establish. `-1` (the default) means no
	// limit.
	ConnectionLimit pulumi.IntPtrInput
	// Defines a role's ability to execute `CREATE
	// DATABASE`.  Default value is `false`.
	CreateDatabase pulumi.BoolPtrInput
	// Defines a role's ability to execute `CREATE ROLE`.
	// A role with this privilege can also alter and drop other roles.  Default value
	// is `false`.
	CreateRole pulumi.BoolPtrInput
	// Deprecated: Rename PostgreSQL role resource attribute "encrypted" to "encrypted_password"
	Encrypted pulumi.StringPtrInput
	// Defines whether the password is stored
	// encrypted in the system catalogs.  Default value is `true`.  NOTE: this value
	// is always set (to the conservative and safe value), but may interfere with the
	// behavior of
	// [PostgreSQL's `passwordEncryption` setting](https://www.postgresql.org/docs/current/static/runtime-config-connection.html#GUC-PASSWORD-ENCRYPTION).
	EncryptedPassword pulumi.BoolPtrInput
	// Defines whether a role "inherits" the privileges of
	// roles it is a member of.  Default value is `true`.
	Inherit pulumi.BoolPtrInput
	// Defines whether role is allowed to log in.  Roles without
	// this attribute are useful for managing database privileges, but are not users
	// in the usual sense of the word.  Default value is `false`.
	Login pulumi.BoolPtrInput
	// The name of the role. Must be unique on the PostgreSQL
	// server instance where it is configured.
	Name pulumi.StringPtrInput
	// Sets the role's password. A password is only of use
	// for roles having the `login` attribute set to true.
	Password pulumi.StringPtrInput
	// Defines whether a role is allowed to initiate
	// streaming replication or put the system in and out of backup mode.  Default
	// value is `false`
	Replication pulumi.BoolPtrInput
	// Defines list of roles which will be granted to this new role.
	Roles pulumi.StringArrayInput
	// Alters the search path of this new role. Note that
	// due to limitations in the implementation, values cannot contain the substring
	// `", "`.
	SearchPaths pulumi.StringArrayInput
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, the
	// [cleanup of ownership of objects](https://www.postgresql.org/docs/current/static/role-removal.html)
	// in each of the respective databases must occur before the ROLE can be dropped
	// from the catalog.  Set this option to true when there are multiple databases
	// in a PostgreSQL cluster using the same PostgreSQL ROLE for object ownership.
	// This is the third and final step taken when removing a ROLE from a database.
	SkipDropRole pulumi.BoolPtrInput
	// When a PostgreSQL ROLE exists in multiple
	// databases and the ROLE is dropped, a
	// [`REASSIGN OWNED`](https://www.postgresql.org/docs/current/static/sql-reassign-owned.html) in
	// must be executed on each of the respective databases before the `DROP ROLE`
	// can be executed to dropped the ROLE from the catalog.  This is the first and
	// second steps taken when removing a ROLE from a database (the second step being
	// an implicit
	// [`DROP OWNED`](https://www.postgresql.org/docs/current/static/sql-drop-owned.html)).
	SkipReassignOwned pulumi.BoolPtrInput
	// Defines [`statementTimeout`](https://www.postgresql.org/docs/current/runtime-config-client.html#RUNTIME-CONFIG-CLIENT-STATEMENT) setting for this role which allows to abort any statement that takes more than the specified amount of time.
	StatementTimeout pulumi.IntPtrInput
	// Defines whether the role is a "superuser", and
	// therefore can override all access restrictions within the database.  Default
	// value is `false`.
	Superuser pulumi.BoolPtrInput
	// Defines the date and time after which the role's
	// password is no longer valid.  Established connections past this `validTime`
	// will have to be manually terminated.  This value corresponds to a PostgreSQL
	// datetime. If omitted or the magic value `NULL` is used, `validUntil` will be
	// set to `infinity`.  Default is `NULL`, therefore `infinity`.
	ValidUntil pulumi.StringPtrInput
}

func (RoleState) ElementType

func (RoleState) ElementType() reflect.Type

type Schema

type Schema struct {
	pulumi.CustomResourceState

	// The DATABASE in which where this schema will be created. (Default: The database used by your `provider` configuration)
	Database pulumi.StringOutput `pulumi:"database"`
	// When true, will also drop all the objects that are contained in the schema. (Default: false)
	DropCascade pulumi.BoolPtrOutput `pulumi:"dropCascade"`
	// When true, use the existing schema if it exists. (Default: true)
	IfNotExists pulumi.BoolPtrOutput `pulumi:"ifNotExists"`
	// The name of the schema. Must be unique in the PostgreSQL
	// database instance where it is configured.
	Name pulumi.StringOutput `pulumi:"name"`
	// The ROLE who owns the schema.
	Owner pulumi.StringOutput `pulumi:"owner"`
	// Can be specified multiple times for each policy.  Each
	// policy block supports fields documented below.
	//
	// Deprecated: Use postgresql_grant resource instead (with object_type="schema")
	Policies SchemaPolicyArrayOutput `pulumi:"policies"`
}

func GetSchema

func GetSchema(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *SchemaState, opts ...pulumi.ResourceOption) (*Schema, error)

GetSchema gets an existing Schema resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewSchema

func NewSchema(ctx *pulumi.Context,
	name string, args *SchemaArgs, opts ...pulumi.ResourceOption) (*Schema, error)

NewSchema registers a new resource with the given unique name, arguments, and options.

func (*Schema) ElementType added in v2.5.2

func (*Schema) ElementType() reflect.Type

func (*Schema) ToSchemaOutput added in v2.5.2

func (i *Schema) ToSchemaOutput() SchemaOutput

func (*Schema) ToSchemaOutputWithContext added in v2.5.2

func (i *Schema) ToSchemaOutputWithContext(ctx context.Context) SchemaOutput

type SchemaArgs

type SchemaArgs struct {
	// The DATABASE in which where this schema will be created. (Default: The database used by your `provider` configuration)
	Database pulumi.StringPtrInput
	// When true, will also drop all the objects that are contained in the schema. (Default: false)
	DropCascade pulumi.BoolPtrInput
	// When true, use the existing schema if it exists. (Default: true)
	IfNotExists pulumi.BoolPtrInput
	// The name of the schema. Must be unique in the PostgreSQL
	// database instance where it is configured.
	Name pulumi.StringPtrInput
	// The ROLE who owns the schema.
	Owner pulumi.StringPtrInput
	// Can be specified multiple times for each policy.  Each
	// policy block supports fields documented below.
	//
	// Deprecated: Use postgresql_grant resource instead (with object_type="schema")
	Policies SchemaPolicyArrayInput
}

The set of arguments for constructing a Schema resource.

func (SchemaArgs) ElementType

func (SchemaArgs) ElementType() reflect.Type

type SchemaInput added in v2.5.2

type SchemaInput interface {
	pulumi.Input

	ToSchemaOutput() SchemaOutput
	ToSchemaOutputWithContext(ctx context.Context) SchemaOutput
}

type SchemaOutput added in v2.5.2

type SchemaOutput struct {
	*pulumi.OutputState
}

func (SchemaOutput) ElementType added in v2.5.2

func (SchemaOutput) ElementType() reflect.Type

func (SchemaOutput) ToSchemaOutput added in v2.5.2

func (o SchemaOutput) ToSchemaOutput() SchemaOutput

func (SchemaOutput) ToSchemaOutputWithContext added in v2.5.2

func (o SchemaOutput) ToSchemaOutputWithContext(ctx context.Context) SchemaOutput

type SchemaPolicy

type SchemaPolicy struct {
	// Should the specified ROLE have CREATE privileges to the specified SCHEMA.
	Create *bool `pulumi:"create"`
	// Should the specified ROLE have CREATE privileges to the specified SCHEMA and the ability to GRANT the CREATE privilege to other ROLEs.
	CreateWithGrant *bool `pulumi:"createWithGrant"`
	// The ROLE who is receiving the policy.  If this value is empty or not specified it implies the policy is referring to the [`PUBLIC` role](https://www.postgresql.org/docs/current/static/sql-grant.html).
	Role *string `pulumi:"role"`
	// Should the specified ROLE have USAGE privileges to the specified SCHEMA.
	Usage *bool `pulumi:"usage"`
	// Should the specified ROLE have USAGE privileges to the specified SCHEMA and the ability to GRANT the USAGE privilege to other ROLEs.
	UsageWithGrant *bool `pulumi:"usageWithGrant"`
}

type SchemaPolicyArgs

type SchemaPolicyArgs struct {
	// Should the specified ROLE have CREATE privileges to the specified SCHEMA.
	Create pulumi.BoolPtrInput `pulumi:"create"`
	// Should the specified ROLE have CREATE privileges to the specified SCHEMA and the ability to GRANT the CREATE privilege to other ROLEs.
	CreateWithGrant pulumi.BoolPtrInput `pulumi:"createWithGrant"`
	// The ROLE who is receiving the policy.  If this value is empty or not specified it implies the policy is referring to the [`PUBLIC` role](https://www.postgresql.org/docs/current/static/sql-grant.html).
	Role pulumi.StringPtrInput `pulumi:"role"`
	// Should the specified ROLE have USAGE privileges to the specified SCHEMA.
	Usage pulumi.BoolPtrInput `pulumi:"usage"`
	// Should the specified ROLE have USAGE privileges to the specified SCHEMA and the ability to GRANT the USAGE privilege to other ROLEs.
	UsageWithGrant pulumi.BoolPtrInput `pulumi:"usageWithGrant"`
}

func (SchemaPolicyArgs) ElementType

func (SchemaPolicyArgs) ElementType() reflect.Type

func (SchemaPolicyArgs) ToSchemaPolicyOutput

func (i SchemaPolicyArgs) ToSchemaPolicyOutput() SchemaPolicyOutput

func (SchemaPolicyArgs) ToSchemaPolicyOutputWithContext

func (i SchemaPolicyArgs) ToSchemaPolicyOutputWithContext(ctx context.Context) SchemaPolicyOutput

type SchemaPolicyArray

type SchemaPolicyArray []SchemaPolicyInput

func (SchemaPolicyArray) ElementType

func (SchemaPolicyArray) ElementType() reflect.Type

func (SchemaPolicyArray) ToSchemaPolicyArrayOutput

func (i SchemaPolicyArray) ToSchemaPolicyArrayOutput() SchemaPolicyArrayOutput

func (SchemaPolicyArray) ToSchemaPolicyArrayOutputWithContext

func (i SchemaPolicyArray) ToSchemaPolicyArrayOutputWithContext(ctx context.Context) SchemaPolicyArrayOutput

type SchemaPolicyArrayInput

type SchemaPolicyArrayInput interface {
	pulumi.Input

	ToSchemaPolicyArrayOutput() SchemaPolicyArrayOutput
	ToSchemaPolicyArrayOutputWithContext(context.Context) SchemaPolicyArrayOutput
}

SchemaPolicyArrayInput is an input type that accepts SchemaPolicyArray and SchemaPolicyArrayOutput values. You can construct a concrete instance of `SchemaPolicyArrayInput` via:

SchemaPolicyArray{ SchemaPolicyArgs{...} }

type SchemaPolicyArrayOutput

type SchemaPolicyArrayOutput struct{ *pulumi.OutputState }

func (SchemaPolicyArrayOutput) ElementType

func (SchemaPolicyArrayOutput) ElementType() reflect.Type

func (SchemaPolicyArrayOutput) Index

func (SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutput

func (o SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutput() SchemaPolicyArrayOutput

func (SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutputWithContext

func (o SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutputWithContext(ctx context.Context) SchemaPolicyArrayOutput

type SchemaPolicyInput

type SchemaPolicyInput interface {
	pulumi.Input

	ToSchemaPolicyOutput() SchemaPolicyOutput
	ToSchemaPolicyOutputWithContext(context.Context) SchemaPolicyOutput
}

SchemaPolicyInput is an input type that accepts SchemaPolicyArgs and SchemaPolicyOutput values. You can construct a concrete instance of `SchemaPolicyInput` via:

SchemaPolicyArgs{...}

type SchemaPolicyOutput

type SchemaPolicyOutput struct{ *pulumi.OutputState }

func (SchemaPolicyOutput) Create

Should the specified ROLE have CREATE privileges to the specified SCHEMA.

func (SchemaPolicyOutput) CreateWithGrant

func (o SchemaPolicyOutput) CreateWithGrant() pulumi.BoolPtrOutput

Should the specified ROLE have CREATE privileges to the specified SCHEMA and the ability to GRANT the CREATE privilege to other ROLEs.

func (SchemaPolicyOutput) ElementType

func (SchemaPolicyOutput) ElementType() reflect.Type

func (SchemaPolicyOutput) Role

The ROLE who is receiving the policy. If this value is empty or not specified it implies the policy is referring to the [`PUBLIC` role](https://www.postgresql.org/docs/current/static/sql-grant.html).

func (SchemaPolicyOutput) ToSchemaPolicyOutput

func (o SchemaPolicyOutput) ToSchemaPolicyOutput() SchemaPolicyOutput

func (SchemaPolicyOutput) ToSchemaPolicyOutputWithContext

func (o SchemaPolicyOutput) ToSchemaPolicyOutputWithContext(ctx context.Context) SchemaPolicyOutput

func (SchemaPolicyOutput) Usage

Should the specified ROLE have USAGE privileges to the specified SCHEMA.

func (SchemaPolicyOutput) UsageWithGrant

func (o SchemaPolicyOutput) UsageWithGrant() pulumi.BoolPtrOutput

Should the specified ROLE have USAGE privileges to the specified SCHEMA and the ability to GRANT the USAGE privilege to other ROLEs.

type SchemaState

type SchemaState struct {
	// The DATABASE in which where this schema will be created. (Default: The database used by your `provider` configuration)
	Database pulumi.StringPtrInput
	// When true, will also drop all the objects that are contained in the schema. (Default: false)
	DropCascade pulumi.BoolPtrInput
	// When true, use the existing schema if it exists. (Default: true)
	IfNotExists pulumi.BoolPtrInput
	// The name of the schema. Must be unique in the PostgreSQL
	// database instance where it is configured.
	Name pulumi.StringPtrInput
	// The ROLE who owns the schema.
	Owner pulumi.StringPtrInput
	// Can be specified multiple times for each policy.  Each
	// policy block supports fields documented below.
	//
	// Deprecated: Use postgresql_grant resource instead (with object_type="schema")
	Policies SchemaPolicyArrayInput
}

func (SchemaState) ElementType

func (SchemaState) ElementType() reflect.Type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL