-
Notifications
You must be signed in to change notification settings - Fork 51
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
Grants keep updating in place on every apply #39
Comments
Which MySQL version and provider version are you using? Can you reproduce it in docker? |
It's connecting to two AWS RDS instances hence the |
@vajeen could you please provide logs from such runs? I don't have RDS and it doesn't seem to be happening in Docker. Just set If you could reproduce it in Docker, then it would be really helpful. |
Hi, I have the same issue. When trying to use this provider, some mysql_grant are recreated: # module.mysql.mysql_grant.imported_users["USER.IP.*.*"] will be created
+ resource "mysql_grant" "imported_users" {
+ database = "*"
+ grant = false
+ host = "IP"
+ id = (known after apply)
+ privileges = [
+ "USAGE",
]
+ table = "*"
+ tls_option = "SSL"
+ user = "USER"
} When I try the apply, i have this error: │ Error: Provider produced inconsistent result after apply
│
│ When applying changes to module.mysql.mysql_grant.imported_users["USER.IP.*.*"], provider
│ "provider[\"registry.terraform.io/petoju/mysql\"]" produced an unexpected new value: Root resource was present, but now absent.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
Mariadb version: |
@rym-dd would you be able to provide log as described in my comment above? EDIT: Ah, sorry - you are using privilege "USAGE". That's a pseudo-grant, that's not really supported by this provider as it doesn't grant anything - it's automatic. Maybe we should document that / warn when someone tries to use that. |
The same for me. I can provide more information, if you need. |
@soar please sent the log as I described here: #39 (comment) |
I'm experiencing similar problems. The grants complete at the database level but I'm attaching a trace log file for TF. I'm using RDS mysql Aurora (mysql 8.0/Aurora 3.0.3) Terraform v1.0.11 on linux_amd64
Here is the output from the apply. `Initializing the backend... Successfully configured the backend "s3"! Terraform will automatically Initializing provider plugins...
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions: mysql_grant.rdsstoredevuseast1_2023granttestusertest_E1425180 will be created
Plan: 1 to add, 0 to change, 0 to destroy. Changes to Outputs:
Do you want to perform these actions? Enter a value: yes mysql_grant.rdsstoredevuseast1_2023granttestusertest_E1425180: Creating... ` User is created in SQL with the grant
|
@duerrt without lots of investigation, your database should be |
@petoju Thanks for the quick reply. That fixed my problem. (I feel a little foolish!) I needed to specify the database and table names separately in each of the Grant params. |
Terraform Version
Terraform Version = 1.3.0
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Expected Behavior
Nothing to update
Actual Behavior
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Every time I run terraform plan, it has an update in place for the user grants with no change
The text was updated successfully, but these errors were encountered: