postgresql

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

nolint: lll

nolint: lll

nolint: lll

Package postgresql exports types, functions, subpackages for provisioning postgresql resources.// A Pulumi package for creating and managing postgresql cloud resources.

> This provider is a derived work of the [Terraform Provider](https://github.com/terraform-providers/terraform-provider-postgresql) > distributed under [MPL 2.0](https://www.mozilla.org/en-US/MPL/2.0/). If you encounter a bug or missing feature, > first check the [`pulumi/pulumi-postgresql` repo](https://github.com/pulumi/pulumi-postgresql/issues); however, if that doesn't turn up anything, > please consult the source [`terraform-providers/terraform-provider-postgresql` repo](https://github.com/terraform-providers/terraform-provider-postgresql/issues).

nolint: lll

nolint: lll

nolint: lll

nolint: lll

nolint: lll

nolint: lll

nolint: lll

nolint: lll

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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"`
}

The “.Database“ resource creates and manages [database objects](https://www.postgresql.org/docs/current/static/managing-databases.html) within a PostgreSQL server instance.

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_database.html.markdown.

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.

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 added in v1.4.0

func (DatabaseArgs) ElementType() reflect.Type

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 added in v1.4.0

func (DatabaseState) ElementType() reflect.Type

type DefaultPrivileg

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)
	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"`
}

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.

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)
	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 added in v1.4.0

func (DefaultPrivilegArgs) ElementType() reflect.Type

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)
	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 added in v1.4.0

func (DefaultPrivilegState) ElementType() reflect.Type

type DefaultPrivileges added in v1.6.0

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

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_default_privileges.html.markdown.

func GetDefaultPrivileges added in v1.6.0

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 added in v1.6.0

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.

type DefaultPrivilegesArgs added in v1.6.0

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).
	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 added in v1.6.0

func (DefaultPrivilegesArgs) ElementType() reflect.Type

type DefaultPrivilegesState added in v1.6.0

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).
	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 added in v1.6.0

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"`
	// 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.

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_extension.html.markdown.

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.

type ExtensionArgs

type ExtensionArgs struct {
	// Which database to create the extension on. Defaults to provider database.
	Database pulumi.StringPtrInput
	// 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 added in v1.4.0

func (ExtensionArgs) ElementType() reflect.Type

type ExtensionState

type ExtensionState struct {
	// Which database to create the extension on. Defaults to provider database.
	Database pulumi.StringPtrInput
	// 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 added in v1.4.0

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: table, sequence).
	ObjectType pulumi.StringOutput `pulumi:"objectType"`
	// The list of privileges to grant.
	Privileges pulumi.StringArrayOutput `pulumi:"privileges"`
	// The name of the role to grant privileges on.
	Role pulumi.StringOutput `pulumi:"role"`
	// The database schema to grant privileges on for this role.
	Schema pulumi.StringOutput `pulumi:"schema"`
}

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

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

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_grant.html.markdown.

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.

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: table, sequence).
	ObjectType pulumi.StringInput
	// The list of privileges to grant.
	Privileges pulumi.StringArrayInput
	// The name of the role to grant privileges on.
	Role pulumi.StringInput
	// The database schema to grant privileges on for this role.
	Schema pulumi.StringInput
}

The set of arguments for constructing a Grant resource.

func (GrantArgs) ElementType added in v1.4.0

func (GrantArgs) 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: table, sequence).
	ObjectType pulumi.StringPtrInput
	// The list of privileges to grant.
	Privileges pulumi.StringArrayInput
	// The name of the role to grant privileges on.
	Role pulumi.StringPtrInput
	// The database schema to grant privileges on for this role.
	Schema pulumi.StringPtrInput
}

func (GrantState) ElementType added in v1.4.0

func (GrantState) ElementType() reflect.Type

type Provider added in v1.4.0

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.

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/index.html.markdown.

func NewProvider added in v1.4.0

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.

type ProviderArgs added in v1.4.0

type ProviderArgs struct {
	// 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
	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
	// 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 added in v1.4.0

func (ProviderArgs) ElementType() reflect.Type

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"`
	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"`
}

The “.Role“ resource creates and manages a role on a PostgreSQL server.

When a “.Role“ resource is removed, the PostgreSQL ROLE will automatically run a [`REASSIGN OWNED`](https://www.postgresql.org/docs/current/static/sql-reassign-owned.html) and [`DROP OWNED`](https://www.postgresql.org/docs/current/static/sql-drop-owned.html) to the `CURRENT_USER` (normally the connected user for the provider). If the specified PostgreSQL ROLE owns objects in multiple PostgreSQL databases in the same PostgreSQL Cluster, one PostgreSQL provider per database must be created and all but the final “.Role“ must specify a `skipDropRole`.

> **Note:** All arguments including role name and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html).

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_role.html.markdown.

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.

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
	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 added in v1.4.0

func (RoleArgs) ElementType() reflect.Type

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
	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 added in v1.4.0

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.
	Policies SchemaPolicyArrayOutput `pulumi:"policies"`
}

The “.Schema“ resource creates and manages [schema objects](https://www.postgresql.org/docs/current/static/ddl-schemas.html) within a PostgreSQL database.

> This content is derived from https://github.com/terraform-providers/terraform-provider-postgresql/blob/master/website/docs/r/postgresql_schema.html.markdown.

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.

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.
	Policies SchemaPolicyArrayInput
}

The set of arguments for constructing a Schema resource.

func (SchemaArgs) ElementType added in v1.4.0

func (SchemaArgs) ElementType() reflect.Type

type SchemaPolicy added in v1.4.0

type SchemaPolicy struct {
	Create          *bool   `pulumi:"create"`
	CreateWithGrant *bool   `pulumi:"createWithGrant"`
	Role            *string `pulumi:"role"`
	Usage           *bool   `pulumi:"usage"`
	UsageWithGrant  *bool   `pulumi:"usageWithGrant"`
}

type SchemaPolicyArgs added in v1.4.0

type SchemaPolicyArgs struct {
	Create          pulumi.BoolPtrInput   `pulumi:"create"`
	CreateWithGrant pulumi.BoolPtrInput   `pulumi:"createWithGrant"`
	Role            pulumi.StringPtrInput `pulumi:"role"`
	Usage           pulumi.BoolPtrInput   `pulumi:"usage"`
	UsageWithGrant  pulumi.BoolPtrInput   `pulumi:"usageWithGrant"`
}

func (SchemaPolicyArgs) ElementType added in v1.4.0

func (SchemaPolicyArgs) ElementType() reflect.Type

func (SchemaPolicyArgs) ToSchemaPolicyOutput added in v1.4.0

func (i SchemaPolicyArgs) ToSchemaPolicyOutput() SchemaPolicyOutput

func (SchemaPolicyArgs) ToSchemaPolicyOutputWithContext added in v1.4.0

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

type SchemaPolicyArray added in v1.4.0

type SchemaPolicyArray []SchemaPolicyInput

func (SchemaPolicyArray) ElementType added in v1.4.0

func (SchemaPolicyArray) ElementType() reflect.Type

func (SchemaPolicyArray) ToSchemaPolicyArrayOutput added in v1.4.0

func (i SchemaPolicyArray) ToSchemaPolicyArrayOutput() SchemaPolicyArrayOutput

func (SchemaPolicyArray) ToSchemaPolicyArrayOutputWithContext added in v1.4.0

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

type SchemaPolicyArrayInput added in v1.4.0

type SchemaPolicyArrayInput interface {
	pulumi.Input

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

type SchemaPolicyArrayOutput added in v1.4.0

type SchemaPolicyArrayOutput struct{ *pulumi.OutputState }

func (SchemaPolicyArrayOutput) ElementType added in v1.4.0

func (SchemaPolicyArrayOutput) ElementType() reflect.Type

func (SchemaPolicyArrayOutput) Index added in v1.4.0

func (SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutput added in v1.4.0

func (o SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutput() SchemaPolicyArrayOutput

func (SchemaPolicyArrayOutput) ToSchemaPolicyArrayOutputWithContext added in v1.4.0

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

type SchemaPolicyInput added in v1.4.0

type SchemaPolicyInput interface {
	pulumi.Input

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

type SchemaPolicyOutput added in v1.4.0

type SchemaPolicyOutput struct{ *pulumi.OutputState }

func (SchemaPolicyOutput) Create added in v1.4.0

func (SchemaPolicyOutput) CreateWithGrant added in v1.4.0

func (o SchemaPolicyOutput) CreateWithGrant() pulumi.BoolPtrOutput

func (SchemaPolicyOutput) ElementType added in v1.4.0

func (SchemaPolicyOutput) ElementType() reflect.Type

func (SchemaPolicyOutput) Role added in v1.4.0

func (SchemaPolicyOutput) ToSchemaPolicyOutput added in v1.4.0

func (o SchemaPolicyOutput) ToSchemaPolicyOutput() SchemaPolicyOutput

func (SchemaPolicyOutput) ToSchemaPolicyOutputWithContext added in v1.4.0

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

func (SchemaPolicyOutput) Usage added in v1.4.0

func (SchemaPolicyOutput) UsageWithGrant added in v1.4.0

func (o SchemaPolicyOutput) UsageWithGrant() pulumi.BoolPtrOutput

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.
	Policies SchemaPolicyArrayInput
}

func (SchemaState) ElementType added in v1.4.0

func (SchemaState) ElementType() reflect.Type

Jump to

Keyboard shortcuts

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