Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Execute ALTER USER ... DEFAULT ROLE ALL by mysql_default_roles #178

Open
kei500 opened this issue Oct 8, 2024 · 1 comment
Open

Comments

@kei500
Copy link

kei500 commented Oct 8, 2024

Provider version

Terraform v1.9.7
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.70.0
+ provider registry.terraform.io/petoju/mysql v3.0.65

MySQL version and settings

Aurora MySQL version 3.05.2, compatible with MySQL 8.0.32.
There aren't any non-standard settings.

Terraform Configuration Files

resource "mysql_default_roles" "exmaple" {
  user  = "example"
  host  = "%"
  roles = ["ALL"]
}

Debug Output

N/A

Panic Output

N/A

Expected Behavior

What expect that following SQL is executed.

ALTER USER 'example'@'%' DEFAULT ROLE ALL;

Actual Behavior

An error occured:

│ Error: failed to update user default roles: failed executing SQL: Error 3530 (HY000): `ALL`@`%` is not granted to `exmaple`@`%`

I guess that stopping to add this single quotation in the case of ALL will resolve this issue.

Steps to Reproduce

  1. terraform apply

Important Factoids

N/A

References

N/A

@petoju
Copy link
Owner

petoju commented Oct 8, 2024

Yes, this is a special case, that needs to be fixed. Could you send a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants