Class Database
The postgresql..Database resource creates and manages database
objects
within a PostgreSQL server instance.
Usage
using Pulumi;
using PostgreSql = Pulumi.PostgreSql;
class MyStack : Stack
{
public MyStack()
{
var myDb = new PostgreSql.Database("myDb", new PostgreSql.DatabaseArgs
{
AllowConnections = true,
ConnectionLimit = -1,
LcCollate = "C",
Owner = "my_role",
Template = "template0",
});
}
}
Inherited Members
Namespace: Pulumi.PostgreSql
Assembly: Pulumi.PostgreSql.dll
Syntax
public class Database : CustomResource
Constructors
View SourceDatabase(String, DatabaseArgs, CustomResourceOptions)
Create a Database resource with the given unique name, arguments, and options.
Declaration
public Database(string name, DatabaseArgs args = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| DatabaseArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAllowConnections
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).
Declaration
public Output<bool?> AllowConnections { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ConnectionLimit
How many concurrent connections can be
established to this database. -1 (the default) means no limit.
Declaration
public Output<int?> ConnectionLimit { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Int32>> |
Encoding
Character set encoding to use in the new database
Declaration
public Output<string> Encoding { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
IsTemplate
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.
Declaration
public Output<bool> IsTemplate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Boolean> |
LcCollate
Collation order (LC_COLLATE) to use in the new database
Declaration
public Output<string> LcCollate { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
LcCtype
Character classification (LC_CTYPE) to use in the new database
Declaration
public Output<string> LcCtype { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Name
The name of the database. Must be unique on the PostgreSQL server instance where it is configured.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Owner
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.
Declaration
public Output<string> Owner { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TablespaceName
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.
Declaration
public Output<string> TablespaceName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Template
The name of the template from which to create the new database
Declaration
public Output<string> Template { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, DatabaseState, CustomResourceOptions)
Get an existing Database resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static Database Get(string name, Input<string> id, DatabaseState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| DatabaseState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| Database |