DatabaseUserArgs

data class DatabaseUserArgs(val clusterId: Output<String>? = null, val mysqlAuthPlugin: Output<String>? = null, val name: Output<String>? = null) : ConvertibleToJava<DatabaseUserArgs>

Provides a DigitalOcean database user resource. When creating a new database cluster, a default admin user with name doadmin will be created. Then, this resource can be used to provide additional normal users inside the cluster.

NOTE: Any new users created will always have normal role, only the default user that comes with database cluster creation has primary role. Additional permissions must be managed manually.

Example Usage

Create a new PostgreSQL database user

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.digitalocean.DatabaseCluster;
import com.pulumi.digitalocean.DatabaseClusterArgs;
import com.pulumi.digitalocean.DatabaseUser;
import com.pulumi.digitalocean.DatabaseUserArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var postgres_example = new DatabaseCluster("postgres-example", DatabaseClusterArgs.builder()
.engine("pg")
.version("11")
.size("db-s-1vcpu-1gb")
.region("nyc1")
.nodeCount(1)
.build());
var user_example = new DatabaseUser("user-example", DatabaseUserArgs.builder()
.clusterId(postgres_example.id())
.build());
}
}

Import

Database user can be imported using the id of the source database cluster and the name of the user joined with a comma. For example

$ pulumi import digitalocean:index/databaseUser:DatabaseUser user-example 245bcfd0-7f31-4ce6-a2bc-475a116cca97,foobar

Constructors

Link copied to clipboard
fun DatabaseUserArgs(clusterId: Output<String>? = null, mysqlAuthPlugin: Output<String>? = null, name: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): DatabaseUserArgs

Properties

Link copied to clipboard
val clusterId: Output<String>? = null

The ID of the original source database cluster.

Link copied to clipboard
val mysqlAuthPlugin: Output<String>? = null

The authentication method to use for connections to the MySQL user account. The valid values are mysql_native_password or caching_sha2_password (this is the default).

Link copied to clipboard
val name: Output<String>? = null

The name for the database user.