Show / Hide Table of Contents

Class DatabaseUser

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

using Pulumi;
using DigitalOcean = Pulumi.DigitalOcean;

class MyStack : Stack
{
public MyStack()
{
    var postgres_example = new DigitalOcean.DatabaseCluster("postgres-example", new DigitalOcean.DatabaseClusterArgs
    {
        Engine = "pg",
        Version = "11",
        Size = "db-s-1vcpu-1gb",
        Region = "nyc1",
        NodeCount = 1,
    });
    var user_example = new DigitalOcean.DatabaseUser("user-example", new DigitalOcean.DatabaseUserArgs
    {
        ClusterId = postgres_example.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
DatabaseUser
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.DigitalOcean
Assembly: Pulumi.DigitalOcean.dll
Syntax
public class DatabaseUser : CustomResource

Constructors

View Source

DatabaseUser(String, DatabaseUserArgs, CustomResourceOptions)

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

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

The unique name of the resource

DatabaseUserArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

ClusterId

The ID of the original source database cluster.

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

MysqlAuthPlugin

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

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

Name

The name for the database user.

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

Password

Password for the database user.

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

Role

Role for the database user. The value will be either "primary" or "normal".

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

Methods

View Source

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

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

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

DatabaseUserState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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