I am getting below error, On currently deployed Kubernetes terraform from registery
https://registry.terraform.io/providers/hashicorp/azurerm/2.99.0/docs/resources/kubernetes_cluster '
it was working last week with Kubernetes version 1.27.3, two days ago MS removed 1.27.3 and now available version is 1.27.9, But even when I am trying to upgrade it giving below, I tried to use data block with azurerm 3.34.0 version but same error
'
'
;
containerservice.ManagedClustersClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="NoRegisteredProviderFound" Message="No registered resource provider found for location 'westus2' and API version '2022-01-02-preview' for type 'managedClusters'. The supported api-versions are '2017-08-31, 2018-03-31, 2019-02-01, 2019-04-01, 2019-06-01, 2019-08-01, 2019-10-01, 2019-11-01, 2020-01-01, 2020-02-01, 2020-03-01, 2020-04-01, 2020-06-01, 2020-07-01, 2020-09-01, 2020-11-01, 2020-12-01, 2021-02-01, 2021-03-01, 2021-05-01, 2021-07-01, 2021-08-01, 2021-09-01, 2021-10-01, 2022-01-01, 2022-02-01, 2022-03-01, 2022-04-01, 2022-06-01, 2022-07-01, 2022-07-02-preview, 2022-08-01, 2022-08-02-preview, 2022-08-03-preview, 2022-09-01, 2022-09-02-preview, 2022-10-02-preview, 2022-11-01, 2022-11-02-preview, 2023-01-01, 2023-01-02-preview, 2023-02-01, 2023-02-02-preview, 2023-03-01, 2023-03-02-preview, 2023-04-01, 2023-04-02-preview, 2023-05-01, 2023-05-02-preview, 2023-06-01, 2023-06-02-preview, 2023-07-01, 2023-07-02-preview, 2023-08-01, 2023-08-02-preview, 2023-09-01, 2023-09-02-preview, 2023-10-01, 2023-10-02-preview, 2023-11-01, 2023-11-02-preview, 2024-01-01, 2024-01-02-preview'. The supported locations are 'australiacentral, australiacentral2, australiaeast, australiasoutheast, brazilsouth, brazilsoutheast, canadacentral, canadaeast, centralindia, centralus, eastasia, eastus, eastus2, francecentral, francesouth, germanynorth, germanywestcentral, israelcentral, italynorth, japaneast, japanwest, jioindiacentral, jioindiawest, koreacentral, koreasouth, northcentralus, northeurope, norwayeast, norwaywest, polandcentral, qatarcentral, southafricanorth, southafricawest, southcentralus, southindia, southeastasia, swedencentral, switzerlandnorth, switzerlandwest, uaecentral, uaenorth, uksouth, ukwest, westcentralus, westeurope, westus, westus2, westus3'
How do I fix the error, AS MS ended version 1.27.3 and when I ma changing 1.27.3 to 1.27.9
It is giving same above error
Any advise where I don't need to re-create the resource??
The cause of the error is that the
westus2location does not support the Azure Kubernetes Service (AKS) API version you are using. The Azure API version (2022-01-02-preview) that you have specified in your Terraform configuration or by the Terraform AzureRM provider is the issue, not the Kubernetes version (1.27.3 to 1.27.9).To fix this issue, make sure you are using the most recent version of the Terraform AzureRM provider. You said you tried version 3.34.0, but check if there is a newer version that has updated API versions or fixes for this problem.
To prevent the error message, ensure that your Terraform configuration is compatible with one of the API versions that the
managedClustersresource accepts inwestus2. If you have specified the API version yourself, switch to a valid version from the error message and when using theazurerm_kubernetes_clusterresource, avoid setting the API version explicitly unless required and execute aterraform refreshto sync the state with the actual infrastructure.My terraform configruation:
Deployment Succeded: