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

Changing geo_redundant_backup_enabled for azurerm_mysql_server is not allowed by azure after creation. #13223

Open
hatvik opened this issue Sep 3, 2021 · 1 comment

Comments

@hatvik
Copy link

hatvik commented Sep 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform (and AzureRM Provider) Version

  • azurerm v2.74.0
  • Terraform v1.0.5

Affected Resource(s)

  • azurerm_mysql_server
  • azurerm_mariadb_server

Terraform Configuration Files

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/mariadb_server#example-usage

Expected Behaviour

   module.test.azurerm_mysql_server.this[0] will be updated in-place
  ~ resource "azurerm_mysql_server" "this" {
      ~ geo_redundant_backup_enabled      = false -> true
        id                                = "/subscriptions/xxxxx/resourceGroups/test-tfazdb-yj0nr/providers/Microsoft.DBforMySQL/servers/testtfazdbyj0nr01"
        name                              = "testtfazdbyj0nr01"
        tags                              = {}
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Actual Behaviour

Error: updating Server: (Name "testtfazdbyj0nr01" / Resource Group "test-tfazdb-yj0nr"): mysql.ServersClient#Update: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="UnsupportedUpdate" Message="Cannot update GeoRedundantBackup for server"

Steps to Reproduce

  1. Create mysql or maria server with geo_redundant_backup_enabled=false
  2. Change geo_redundant_backup_enabled to true
  3. Apply again

Important Factoids

References

Configuring locally redundant or geo-redundant storage for backup is only allowed during server create. Once the server is provisioned, you cannot change the backup storage redundancy option. In order to move your backup storage from locally redundant storage to geo-redundant storage, creating a new server and migrating the data using dump and restore is the only supported option

@mahalel
Copy link
Contributor

mahalel commented Aug 14, 2022

I can confirm the behaviour as well. Expect for it to be recreated but I just get this error:

module.maria_db.azurerm_mariadb_server.moodle: Modifying... [id=/subscriptions/<REDACTED>/resourceGroups/ae-prod-rg-moodle/providers/Microsoft.DBforMariaDB/servers/ae-prod-maria-moodle-xxx]

Error: updating Server: (Name "ae-prod-maria-moodle-xxx" / Resource Group "ae-prod-rg-moodle"): mariadb.ServersClient#Update: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="UnsupportedUpdate" Message="Cannot update GeoRedundantBackup for server"

  with module.maria_db.azurerm_mariadb_server.moodle,
  on moodle/maria_db/main.tf line 43, in resource "azurerm_mariadb_server" "moodle":
  43: resource "azurerm_mariadb_server" "moodle" {

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

No branches or pull requests

4 participants