terraform-provider-mysql
terraform-provider-mysql copied to clipboard
Feature: Support MariaDB roles
This issue was originally opened by @taiidani as hashicorp/terraform#15007. It was migrated here as part of the provider split. The original body of the issue is below.
Terraform Version
v0.9.6
Affected Resource(s)
- mysql_grant
Although this is technically a feature request for something like mysql_grant_role
, assuming you want to reuse the existing provider for MariaDB-specific functionality.
Terraform Configuration Files
If the existing mysql_grant
were used it would look something like this:
resource "mysql_grant" "user" {
user = "user"
host = "host"
database = "app"
privileges = ["job_developer"]
}
For a brand new resource I'd expect something more like this:
resource "mysql_grant_role" "user" {
user = "user"
host = "host"
roles = ["job_developer"]
}
Expected Behavior
Terraform should issue a GRANT ROLE job_developer to user
to MariaDB.
Actual Behavior
When using mysql_grant
:
* mysql_grant.user: Received hashicorp/terraform#1064 error from MySQL server: "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'on app.* TO 'user'@'%'' at line 1"
#48 adds both a mysql_role
resource as well as adding role
and roles
to the mysql_grant
resource. I think this should address this use case. 👍