You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
# mysql_database.test_db will be created
+ resource "mysql_database" "test_db" {
+ default_character_set = "utf8"
+ default_collation = "utf8_general_ci"
+ id = (known after apply)
+ name = "test_db"
}
# mysql_grant.test_role_grant will be created
+ resource "mysql_grant" "test_role_grant" {
+ database = "test_db"
+ grant = false
+ host = "localhost"
+ id = (known after apply)
+ privileges = [
+ "SELECT",
]
+ role = "test_role"
+ table = "*"
+ tls_option = "NONE"
}
# mysql_grant.test_user_grant_roles will be created
+ resource "mysql_grant" "test_user_grant_roles" {
+ database = "test_db"
+ grant = false
+ host = "localhost"
+ id = (known after apply)
+ roles = [
+ "test_role",
]
+ table = "*"
+ tls_option = "NONE"
+ user = "test_user"
}
# mysql_role.test_role will be created
+ resource "mysql_role" "test_role" {
+ id = (known after apply)
+ name = "test_role"
}
# mysql_user.test_user will be created
+ resource "mysql_user" "test_user" {
+ host = "localhost"
+ id = (known after apply)
+ tls_option = "NONE"
+ user = "test_user"
}
Resulting GRANTs
MariaDB [(none)]> show grants for 'test_role';
+--------------------------------------------+
| Grants for test_role |
+--------------------------------------------+
| GRANT USAGE ON*.* TO 'test_role' |
| GRANTSELECTON`test_db`.* TO 'test_role' |
+--------------------------------------------+
MariaDB [(none)]> show grants for 'test_user'@'localhost';
+-----------------------------------------------+
| Grants for test_user@localhost |
+-----------------------------------------------+
| GRANT test_role TO 'test_user'@'localhost' |
| GRANT USAGE ON*.* TO 'test_user'@'localhost' |
+-----------------------------------------------+
Expected Behavior
The mysql_grant resource should not require database attribute when roles attribute is being set. The database and table attributes probably should also be disallowed (like privileges) when roles is present.
Actual Behavior
The mysql_grant resource is requiring the unnecessary (and unused) database attribute when the roles attribute is being set.
As An Aside...
The MySQL Terraform provider's host default of localhost does not match MySQL/MariaDB's default of % when host is not specified.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Terraform Version
MariaDB 10.4.12
Affected Resource(s)
mysql_grant
(when granting roles to user)Terraform Configuration Files
Plan Output
Resulting GRANTs
Expected Behavior
The
mysql_grant
resource should not require database attribute when roles attribute is being set. The database and table attributes probably should also be disallowed (like privileges) when roles is present.Actual Behavior
The
mysql_grant
resource is requiring the unnecessary (and unused) database attribute when the roles attribute is being set.As An Aside...
The MySQL Terraform provider's host default of
localhost
does not match MySQL/MariaDB's default of%
when host is not specified.The text was updated successfully, but these errors were encountered: