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 8.0.21 required even though it's not the latest #25964

Open
1 task done
simaotwx opened this issue May 14, 2024 · 3 comments
Open
1 task done

MySQL 8.0.21 required even though it's not the latest #25964

simaotwx opened this issue May 14, 2024 · 3 comments
Labels
enhancement service/mysql upstream/microsoft/blocking-swagger-issue This label is applicable when waiting on Microsoft for an issue with the Swagger definition. v/3.x

Comments

@simaotwx
Copy link
Contributor

simaotwx commented May 14, 2024

Is there an existing issue for this?

  • I have searched the existing issues

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 and review the contribution guide to help.

Terraform Version

1.8.3

AzureRM Provider Version

3.103.1

Affected Resource(s)/Data Source(s)

azurerm_mysql_flexible_server

Terraform Configuration Files

provider "azurerm" {
  features {}
}

resource "azurerm_resource_group" "example" {
  name     = "example-resources"
  location = "West Europe"
}

resource "azurerm_virtual_network" "example" {
  name                = "example-vn"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  address_space       = ["10.0.0.0/16"]
}

resource "azurerm_subnet" "example" {
  name                 = "example-sn"
  resource_group_name  = azurerm_resource_group.example.name
  virtual_network_name = azurerm_virtual_network.example.name
  address_prefixes     = ["10.0.2.0/24"]
  service_endpoints    = ["Microsoft.Storage"]
  delegation {
    name = "fs"
    service_delegation {
      name = "Microsoft.DBforMySQL/flexibleServers"
      actions = [
        "Microsoft.Network/virtualNetworks/subnets/join/action",
      ]
    }
  }
}

resource "azurerm_private_dns_zone" "example" {
  name                = "example.mysql.database.azure.com"
  resource_group_name = azurerm_resource_group.example.name
}

resource "azurerm_private_dns_zone_virtual_network_link" "example" {
  name                  = "exampleVnetZone.com"
  private_dns_zone_name = azurerm_private_dns_zone.example.name
  virtual_network_id    = azurerm_virtual_network.example.id
  resource_group_name   = azurerm_resource_group.example.name
}

resource "azurerm_mysql_flexible_server" "example" {
  name                   = "example-fs"
  resource_group_name    = azurerm_resource_group.example.name
  location               = azurerm_resource_group.example.location
  administrator_login    = "psqladmin"
  administrator_password = "H@Sh1CoR3!"
  backup_retention_days  = 7
  version                = "8.0"
  delegated_subnet_id    = azurerm_subnet.example.id
  private_dns_zone_id    = azurerm_private_dns_zone.example.id
  sku_name               = "GP_Standard_D2ds_v4"

  depends_on = [azurerm_private_dns_zone_virtual_network_link.example]
}

Debug Output/Panic Output

╷
│ Error: expected version to be one of ["5.7" "8.0.21"], got 8.0
│ 
│   with azurerm_mysql_flexible_server.example,
│   on db.tf line 43, in resource "azurerm_mysql_flexible_server" "example":
│   43:   version                = "8.0"

Expected Behaviour

8.0 should be accepted because the latest version is 8.0.35 (see https://learn.microsoft.com/en-us/azure/mysql/flexible-server/concepts-supported-versions#mysql-version-8) and 5.7 also works. 8.0.21 is not the latest so specifying it seems to not be useful. Also, automatic maintenance is performed on these databases anyway so the purpose of specifying a patch version is not clear to me.

Actual Behaviour

An error during validation

Steps to Reproduce

  1. terraform init
  2. terraform validate

Important Factoids

No response

References

No response

@tombuildsstuff
Copy link
Member

hey @simaotwx

Thanks for opening this issue.

Taking a look through here the validation on our side is coming from the values defined within the Azure API Definition which list 8.0.21 specifically (which then get generated into hashicorp/go-azure-sdk, which we use in the Provider) - so whilst I'd agree with you that it'd make more sense for us to expose 8.0 here, the value 8.0.21 has been exposed by the Service Team instead of 8.0, so we'd need this value added to the API Definition in order for us to expose this value here.

As such I'm going to mark this issue as upstream/microsoft/blocking-swagger-issue, but once support for this becomes available for this within the Azure/azure-rest-api-specs repository then we should be able to support this new value.

Thanks!

@tombuildsstuff tombuildsstuff added the upstream/microsoft/blocking-swagger-issue This label is applicable when waiting on Microsoft for an issue with the Swagger definition. label May 14, 2024
@Chambras
Copy link
Contributor

I will see If I can submit a PR internally to add support for 8.0

@simaotwx
Copy link
Contributor Author

hey @tombuildsstuff @Chambras

thanks a lot for explaining and outlining how this can be solved in the future. Looking forward to the support for 8.0. I'm going to use 8.0.21 in the meantime then. As I understand from your explanation, while 8.0.21 is specified in the API definition, it will actually use 8.0.* for the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement service/mysql upstream/microsoft/blocking-swagger-issue This label is applicable when waiting on Microsoft for an issue with the Swagger definition. v/3.x
Projects
None yet
Development

No branches or pull requests

4 participants