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

Mysql Flexible server admin user does not support hyphen character #287

Open
r4kh1m opened this issue Jul 17, 2024 · 2 comments
Open

Mysql Flexible server admin user does not support hyphen character #287

r4kh1m opened this issue Jul 17, 2024 · 2 comments

Comments

@r4kh1m
Copy link

r4kh1m commented Jul 17, 2024

After in-place auto-migration from single to Flexible server, the Server admin login name moved to the Flexible one containing hyphen (-).

Now, we need to import the migrated Flexible server to the Terraform.

The validation is happening on the API side because I am not able to create the sample server with the hyphen:

az mysql flexible-server create --location westeurope --resource-group test-rg --name example1232453534653 --admin-user "with-hyphen"

(InvalidParameterValue) Invalid value given for parameter administratorLogin. Specify a valid parameter value.
Code: InvalidParameterValue
Message: Invalid value given for parameter administratorLogin. Specify a valid parameter value.

This issue is blocking:
hashicorp/terraform-provider-azurerm#26658

@derekrprice
Copy link

Yes. Terraform refuses the original admin username and wants to destroy the new mirror server and all its data if you try to change it. This is somewhat urgent since all the Single Server deployments become inoperable on September 16th, 2024 (12 days from this posting). The workaround is to not manage the new server via Terraform, but that's pretty inconvenient for those who already built and manage their infrastructure that way.

@derekrprice
Copy link

Ok, this works as a workaround too:

    lifecycle {
        # The API rejects the pre-existing hyphen in our username and changing the administrator_login
        # recreates the resource, destroying its data.  Just ignore this difference.
        ignore_changes = [administrator_login]
    }

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