mysql_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
resource "mysql_user" "jdoe" { user = "jdoe" host = "example.com" plaintext_password = "password" }
Example Usage with an Authentication Plugin
resource "mysql_user" "nologin" { user = "nologin" host = "example.com" auth_plugin = "mysql_no_login" }
Argument Reference
The following arguments are supported:
-
user
- (Required) The name of the user. -
host
- (Optional) The source host of the user. Defaults to "localhost". -
plaintext_password
- (Optional) 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 withauth_plugin
. -
password
- (Optional) Deprecated alias ofplaintext_password
, whose value is stored as plaintext in state. Prefer to useplaintext_password
instead, which stores the password as an unsalted hash. Conflicts withauth_plugin
. -
auth_plugin
- (Optional) Use an authentication plugin to authenticate the user instead of using password authentication. Description of the fields allowed in the block below. Conflicts withpassword
andplaintext_password
.
The auth_plugin
value supports:
-
AWSAuthenticationPlugin
- Allows the use of IAM authentication with Amazon Aurora. For more details on how to use IAM auth with Aurora, see here. -
mysql_no_login
- Uses the MySQL No-Login Authentication Plugin. The No-Login Authentication Plugin must be active in MySQL. For more information, see here.
Attributes Reference
No further attributes are exported.
© 2018 HashiCorpLicensed under the MPL 2.0 License.
https://www.terraform.io/docs/providers/mysql/r/user.html