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 with an Authentication Plugin
import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const nologin = new mysql.User("nologin", {
authPlugin: "mysql_no_login",
host: "example.com",
user: "nologin",
});import pulumi
import pulumi_mysql as mysql
nologin = mysql.User("nologin",
auth_plugin="mysql_no_login",
host="example.com",
user="nologin")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",
});
}
}
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",
});
}
}
Coming soon!
import pulumi
import pulumi_mysql as mysql
jdoe = mysql.User("jdoe",
host="example.com",
plaintext_password="password",
user="jdoe")import * as pulumi from "@pulumi/pulumi";
import * as mysql from "@pulumi/mysql";
const jdoe = new mysql.User("jdoe", {
host: "example.com",
plaintextPassword: "password",
user: "jdoe",
});Create a User Resource
new User(name: string, args: UserArgs, opts?: CustomResourceOptions);def User(resource_name, opts=None, auth_plugin=None, host=None, password=None, plaintext_password=None, tls_option=None, user=None, __props__=None);public User(string name, UserArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args UserArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
User Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The User resource accepts the following input properties:
- User
Name string The name of the user.
- Auth
Plugin string 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
passwordandplaintext_password.- Host string
The source host of the user. Defaults to “localhost”.
- Password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- Plaintext
Password string 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.- Tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.
- User string
The name of the user.
- Auth
Plugin string 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
passwordandplaintext_password.- Host string
The source host of the user. Defaults to “localhost”.
- Password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- Plaintext
Password string 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.- Tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.
- user string
The name of the user.
- auth
Plugin string 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
passwordandplaintext_password.- host string
The source host of the user. Defaults to “localhost”.
- password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- plaintext
Password string 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.- tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.
- user str
The name of the user.
- auth_
plugin str 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
passwordandplaintext_password.- host str
The source host of the user. Defaults to “localhost”.
- password str
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- plaintext_
password str 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.- tls_
option str An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.
Outputs
All input properties are implicitly available as output properties. Additionally, the User resource produces the following output properties:
Look up an Existing User Resource
Get an existing User resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: UserState, opts?: CustomResourceOptions): Userstatic get(resource_name, id, opts=None, auth_plugin=None, host=None, password=None, plaintext_password=None, tls_option=None, user=None, __props__=None);public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
The following state arguments are supported:
- Auth
Plugin string 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
passwordandplaintext_password.- Host string
The source host of the user. Defaults to “localhost”.
- Password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- Plaintext
Password string 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.- Tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.- User
Name string The name of the user.
- Auth
Plugin string 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
passwordandplaintext_password.- Host string
The source host of the user. Defaults to “localhost”.
- Password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- Plaintext
Password string 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.- Tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.- User string
The name of the user.
- auth
Plugin string 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
passwordandplaintext_password.- host string
The source host of the user. Defaults to “localhost”.
- password string
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- plaintext
Password string 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.- tls
Option string An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.- user string
The name of the user.
- auth_
plugin str 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
passwordandplaintext_password.- host str
The source host of the user. Defaults to “localhost”.
- password str
Deprecated alias of
plaintext_password, whose value is stored as plaintext in state. Prefer to useplaintext_passwordinstead, which stores the password as an unsalted hash. Conflicts withauth_plugin.- plaintext_
password str 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.- tls_
option str An TLS-Option for the
CREATE USERorALTER USERstatement. The value is suffixed toREQUIRE. A value of ‘SSL’ will generate aCREATE USER ... REQUIRE SSLstatement. See the MYSQLCREATE USERdocumentation for more. Ignored if MySQL version is under 5.7.0.- user str
The name of the user.
Package Details
- Repository
- https://github.com/pulumi/pulumi-mysql
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mysqlTerraform Provider.