Show / Hide Table of Contents

Class User

The mysql..User resource creates and manages a user on a MySQL server.

Note: The password for the user is provided in plain text, and is obscured by an unsalted hash in the state Read more about sensitive data in state. Care is required when using this resource, to avoid disclosing the password.

Example Usage

using Pulumi;
using MySql = Pulumi.MySql;

class MyStack : Stack
{
public MyStack()
{
    var jdoe = new MySql.User("jdoe", new MySql.UserArgs
    {
        Host = "example.com",
        PlaintextPassword = "password",
        User = "jdoe",
    });
}

}

Example Usage with an Authentication Plugin

using Pulumi;
using MySql = Pulumi.MySql;

class MyStack : Stack
{
public MyStack()
{
    var nologin = new MySql.User("nologin", new MySql.UserArgs
    {
        AuthPlugin = "mysql_no_login",
        Host = "example.com",
        User = "nologin",
    });
}

}
Inheritance
System.Object
Resource
CustomResource
User
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.MySql
Assembly: Pulumi.MySql.dll
Syntax
public class User : CustomResource

Constructors

View Source

User(String, UserArgs, CustomResourceOptions)

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

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

The unique name of the resource

UserArgs 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

AuthPlugin

Use an [authentication plugin][ref-auth-plugins] to authenticate the user instead of using password authentication. Description of the fields allowed in the block below. Conflicts with password and plaintext_password.

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

Host

The source host of the user. Defaults to "localhost".

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

Password

Deprecated alias of plaintext_password, whose value is stored as plaintext in state. Prefer to use plaintext_password instead, which stores the password as an unsalted hash. Conflicts with auth_plugin.

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

PlaintextPassword

The password for the user. This must be provided in plain text, so the data source for it must be secured. An unsalted hash of the provided password is stored in state. Conflicts with auth_plugin.

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

TlsOption

An TLS-Option for the CREATE USER or ALTER USER statement. The value is suffixed to REQUIRE. A value of 'SSL' will generate a CREATE USER ... REQUIRE SSL statement. See the MYSQL CREATE USER documentation for more. Ignored if MySQL version is under 5.7.0.

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

UserName

The name of the user.

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

Methods

View Source

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

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

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

UserState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

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