Please vote on this issue by adding a :thumbsup: 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
When trying to upgrade from azurerm 2.x(tested 2.73.0 and 2.99.0) to 3.x(all current releases tested), resource output with count index stopped working. This does NOT happen when upgrading within 2.x(tested from 2.73.0 to 2.99.0) or creating new resource using 3.x(tested 3.0.0 to 3.4.0)
Error:
value = azurerm_kubernetes_cluster.aks[0].kube_config.0.host
│ ├────────────────
│ │ azurerm_kubernetes_cluster.aks is empty tuple
Error: Get "http://localhost/api/v1/namespaces/testnamespace": dial tcp [::1]:80: connect: connection refused
│
│ with kubernetes_namespace.namespaces[0],
│ on main.tf line 44, in resource "kubernetes_namespace" "namespaces":
│ 44: resource "kubernetes_namespace" "namespaces" {
Expected Behaviour
since the same code works when upgrading resource from 2.73.0 to 2.99.0 AND works when creating brand new resource using 3.x(3.0.0-3.4.0) providers, it should work when upgrading the provider version from 2.x to 3.x
Actual Behaviour
failed with the following error. It seems that when upgrading from 2.x to 3.x, if the resource has a count.index, the outputs are not working correctly. after removing the count index for testing, upgrade from 2.x to 3.x went fine.
Error:
value = azurerm_kubernetes_cluster.aks[0].kube_config.0.host
│ ├────────────────
│ │ azurerm_kubernetes_cluster.aks is empty tuple
Error: Get "http://localhost/api/v1/namespaces/testnamespace": dial tcp [::1]:80: connect: connection refused
│
│ with kubernetes_namespace.namespaces[0],
│ on main.tf line 44, in resource "kubernetes_namespace" "namespaces":
│ 44: resource "kubernetes_namespace" "namespaces" {
Steps to Reproduce
use the code(providers.tf and main.tf) in the configuration file section above,
set the azurerm provider version to anything below 2.99.0 to create a new aks
(OPTIONAL). set the azurerm provider version to 2.99.0 and run plan/apply. this will WORK fine
set the azurerm provider version to 3.x(tested from 3.0.0 to 3.4.0 with same results), both plan and apply will fail with the error mentioned above.
Is there an existing issue for this?
Community Note
When trying to upgrade from azurerm 2.x(tested 2.73.0 and 2.99.0) to 3.x(all current releases tested), resource output with count index stopped working. This does NOT happen when upgrading within 2.x(tested from 2.73.0 to 2.99.0) or creating new resource using 3.x(tested 3.0.0 to 3.4.0)
Terraform Version
1.1.9
AzureRM Provider Version
3.0.0-3.4.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
since the same code works when upgrading resource from 2.73.0 to 2.99.0 AND works when creating brand new resource using 3.x(3.0.0-3.4.0) providers, it should work when upgrading the provider version from 2.x to 3.x
Actual Behaviour
failed with the following error. It seems that when upgrading from 2.x to 3.x, if the resource has a count.index, the outputs are not working correctly. after removing the count index for testing, upgrade from 2.x to 3.x went fine.
Error:
value = azurerm_kubernetes_cluster.aks[0].kube_config.0.host │ ├──────────────── │ │ azurerm_kubernetes_cluster.aks is empty tuple
Error: Get "http://localhost/api/v1/namespaces/testnamespace": dial tcp [::1]:80: connect: connection refused │ │ with kubernetes_namespace.namespaces[0], │ on main.tf line 44, in resource "kubernetes_namespace" "namespaces": │ 44: resource "kubernetes_namespace" "namespaces" {
Steps to Reproduce
use the code(providers.tf and main.tf) in the configuration file section above,
Important Factoids
No response
References
No response