Error: Reference to undeclared resource │

Palthya Ramaswamy Naik 0 Reputation points
2025-02-04T09:41:09.89+00:00

│ on providers.tf line 26, in provider "kubernetes": │ 26: host = azurerm_kubernetes_cluster.aks.kube_admin_config.0.host │ │ A managed resource "azurerm_kubernetes_cluster" "aks" has not b

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,260 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Markapuram Sudheer Reddy 590 Reputation points Microsoft Vendor
    2025-02-04T16:55:58.11+00:00

    Hi Palthya Ramaswamy Naik,

    Thank You for reaching out to Microsoft Q&A forum.

    The error stated above indicates that the azurerm_kubernetes_cluster resource named aks has not been declared in the terraform configuration file or a typo error or incorrect resource reference and ensure the resource is defined properly in .tf files.

    Could you please share the complete module structure of your terraform configuration files and also please share the tf script to check the issue in detail.

    If the information is helpful, please click on "Accept Answer" and "Upvote"

    If you have any queries, please do let us know, we will help you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.