Open emilkor1 opened 6 months ago
@emilkor1 were you ever able to find a work-around? We are getting hit by this exact issue
This is probably an issue of terraform and not azurerm... nevertheless, no, I placed it on hold :/
This is probably an issue of terraform and not azurerm... nevertheless, no, I placed it on hold :/
Well, crud, Thanks for the update
I hit this exact same issue. I took your example config, removed the azurerm_role_assignment
resource, and just ran a terraform plan
against it to see the output.
# azurerm_kubernetes_cluster.main will be created
+ resource "azurerm_kubernetes_cluster" "main" {
+ api_server_authorized_ip_ranges = (known after apply)
+ current_kubernetes_version = (known after apply)
+ dns_prefix = "exampleaks1"
...
+ identity {
+ principal_id = (known after apply)
+ tenant_id = (known after apply)
+ type = "SystemAssigned"
}
+ kubelet_identity (known after apply)
+ network_profile (known after apply)
+ windows_profile (known after apply)
}
Using your example tftest.hcl file, again with the role assignment removed, I ran terraform test -verbose
to see what plan it was generating. Notice how the kubelet_identity
, network_profile
, etc are all missing?
# azurerm_kubernetes_cluster.main will be created
+ resource "azurerm_kubernetes_cluster" "main" {
+ api_server_authorized_ip_ranges = (known after apply)
+ current_kubernetes_version = (known after apply)
+ dns_prefix = "exampleaks1"
...
+ identity {
+ principal_id = (known after apply)
+ tenant_id = (known after apply)
+ type = "SystemAssigned"
}
}
I'm not sure if this is an issue with terraform test
or the azurerm_kubernetes_cluster
resource, but something is definitely broken here.
Is there an existing issue for this?
Community Note
Hello.
I am trying to mock/test my Terraform module.
I have this stripped down version of the module which creates a resource group, kubernetes cluster and role assignment.
I am trying to mock both providers used in the module
Which crashes with the following when running
terraform test
I have tried to mock the resources as
and
But it seems to exit with the same error no matter how the mock resources are structured.
Terraform Version
1.8.1
AzureRM Provider Version
3.99.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster, azurerm_role_assignment
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
No response
Actual Behaviour
No response
Steps to Reproduce
terraform test
Important Factoids
No response
References
No response