Closed kei500 closed 2 months ago
You're right, this is a bug. But it has an unintended side effect: as some grants may have grant option while other don't have it, we cannot manage all sets of resources using terraform. This was not considered.
I don't have a lot of time to fix it, but we should:
I believe this has been fixed some time ago. Please try with the latest version of provider and comment here / open another issue if it persists.
In MySQL 8.0, static privilege and dynamic privilege are represented as separate grants as below.
Currently, mysql_grant's resource id is consisted of user, host, database and table. So, in this case, Terraform cannot manage those grants because resource id is duplicated.
Farther more, about dynamic privileges, please note that grant is separated if
WITH GRANT OPTION
is specified or not.Terraform Version
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Debug Output
N/A
Panic Output
N/A
Expected Behavior
We expect that there aren't resources which will be changed after applying Terraform once.
Actual Behavior
mysql_grant.test
will be changed again.Steps to Reproduce
terraform apply
terraform plan
Important Factoids
N/A
References
N/A