-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Mysql Sql User cannot be updated or deleted if host
is blank
#3784
Comments
@chrisst Your problem statement says that update and delete will fail, but your referenced code change only sets the default host for
|
host
isn't presenthost
is blank
The referenced PR wasn't meant to fix this issue. This issue is a problem with the API since there it allows creating a user that can not be modified. We can't fix this issue until the API addresses this. In contrast the referenced PR was fixing the Update call to pass the host as a param to make normal updates succeed with a valid host present. If you have a config where you have a valid |
I see, thanks for the info.
I'll look deeper into my issue and follow up here with a reproduction case if I can't resolve it. |
Would it be possible to work around this in the provider by providing an option to force delete? Specifically, when trying to delete an entire database it doesn't actually matter if the individual users are deleted but Terraform will error out on that step. We're encountering this issue here: forseti-security/terraform-google-forseti#148 |
It's my understanding from the API team that the user shouldn't be able to be created with no host. Once the user has been created in this state it appears to be impossible to modify/delete via the rest API. Ignoring the delete errors would result in an orphaned resource. I'll ping the API team and see if there's a plan for resolution because anything we do in the provider will be some degree of broken. |
Assigning this to 4.0 so that if there still isn't any update from the API team we can make a breaking change to avoid this for future users. It will likely require manual resolution of problematic resources if we address this in the provider. |
Signed-off-by: Modular Magician <[email protected]>
Signed-off-by: Modular Magician <[email protected]>
This was resolved and verified in b/134758506 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform Version
all
Affected Resource(s)
Terraform Configuration Files
Problem
The
host
attribute of SqlUser for MySql is Optional and the empty string is the default if not passed to the rest API. However once a User is created with an empty host it can no longer be updated or deleted. The request will fail with "Error 400: Invalid request: Host required for MySQL instances."This is because the upstream API requires
host
in the url as a param, but doesn't recognize?host=
as a valid option.References
b/134505616
The text was updated successfully, but these errors were encountered: