-
-
Save petoju/f83e73880a67fe88dca8aa3422f7cad9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
terraform { | |
required_providers { | |
mysql = { | |
source = "petoju/mysql" | |
version = "3.0.24" | |
} | |
} | |
} | |
provider "mysql" { | |
endpoint = "127.0.0.1:3306" | |
username = "root" | |
password = "rootpass123" | |
} | |
resource "mysql_user" "user" { | |
user = "dbusername" | |
host = "%" | |
plaintext_password = "test_pass" | |
} | |
resource "mysql_database" "app" { | |
name = "databasename" | |
} | |
resource "mysql_grant" "this" { | |
user = mysql_user.user.user | |
host = mysql_user.user.host | |
database = mysql_database.app.name | |
privileges = ["SELECT"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment