terraform-provider-mysql icon indicating copy to clipboard operation
terraform-provider-mysql copied to clipboard

REVOKE ALL on AWS RDS instances

Open krogon-dp opened this issue 7 years ago • 7 comments

Hi, Is there any specific reason this provider uses REVOKE ALL statement?

https://github.com/terraform-providers/terraform-provider-mysql/blob/master/mysql/resource_grant.go#L120

Once this command is OK when used with specified database name, RDS does not like this when used with * all databases.

mysql> grant all on test.* to 'aaa'@'%';
Query OK, 0 rows affected (0.05 sec)

mysql> revoke all on test.* from 'aaa'@'%';
Query OK, 0 rows affected (0.04 sec)

mysql> grant select on *.* to 'aaa'@'%';
Query OK, 0 rows affected (0.04 sec)

mysql> grant all on *.* to 'aaa'@'%';
ERROR 1045 (28000): Access denied for user 'rdstest'@'%' (using password: YES)

Why not to remove the same privileges that resource is holding?

krogon-dp avatar Oct 19 '17 22:10 krogon-dp

@katbyte We hit same issue. Would you please review commit at https://github.com/krogon-dp/terraform-provider-mysql/commit/eed09ba7a0093018a46c2340494f31e15a29f5d3?

cemo avatar May 16 '18 12:05 cemo

We had this same issue as well. That commit looks like a great solution. LGTM!

jgpdc4u avatar Aug 23 '18 21:08 jgpdc4u

+1. I opened this issue as well.

damascenorakuten avatar Dec 10 '18 11:12 damascenorakuten

Facing the same problem.....

RTodorov avatar Jan 10 '19 16:01 RTodorov

+1 Any plan of releasing Fixes terraform-providers#19 … ?

robertomczak avatar Jan 21 '19 17:01 robertomczak

This issue still exists and is a blocker to any editing grants or removing any user on AWS RDS/Aurora databases.

The root of the issue is REVOKE ALL is not allowed and should be replaced by a comma separated list.

It should be noted that REVOKE ALL also interferes with multiple resource "mysql_grant" on the same level.

martin-walsh avatar Mar 04 '19 00:03 martin-walsh

Potential fix: https://github.com/terraform-providers/terraform-provider-mysql/pull/73

martin-walsh avatar Mar 04 '19 01:03 martin-walsh