Open r4kh1m opened 3 months ago
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.
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]
}
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"
This issue is blocking: https://github.com/hashicorp/terraform-provider-azurerm/issues/26658