Skip to content

Instantly share code, notes, and snippets.

@mclavel
Created May 24, 2018 04:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mclavel/ed4f8772fab1b13bfae7ca35100f4a21 to your computer and use it in GitHub Desktop.
Save mclavel/ed4f8772fab1b13bfae7ca35100f4a21 to your computer and use it in GitHub Desktop.
resource "random_string" "password" {
 length = 16
 special = true
}
resource "mysql_user" "root" {
 user = "root"
 host = "example.com"
 plaintext_password = "${sha256(bcrypt(random_string.password.result))}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment