Open amosricky opened 3 years ago
I have the same problem for resources created by AKS. For example code below all nsg but without this related to aks.
data "azurerm_resources" "example" { type = "Microsoft.Network/networkSecurityGroups" }
Tested on version 2.53
I got same problem for virtualmachine scale sets resources:
data "azurerm_resources" "scale_set" {
resource_group_name = data.azurerm_kubernetes_cluster.aks_cluster.node_resource_group
type = "Microsoft.Compute/virtualMachineScaleSets"
}
The data.azurerm_resources.scale_set.resources.*.id
can't get all matched resource ids.
The azurerm version is 2.61
I have the same behavior with Microsoft.RecoveryServices
resource type :
data "azurerm_resources" "rs" {
type = "Microsoft.RecoveryServices"
}
output "rs" {
value = data.azurerm_resources.rs
}
Here is the output :
rs = {
"id" = "resource-4761bd34-dfa7-4e37-b3a6-45a4127221cb"
"resources" = []
"type" = "Microsoft.RecoveryServices"
}
Note that I have an existing Azure SIte Recovery . Thanks
This problem persists - but may be acting as expected? It only returns resources from the current providers subscription. I was expecting it go gather all resources available to the current managed identity.
If this is the intended behaviour, then perhaps updating the docs (https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resources) to indicate that would be helpful to folks like me.
On the other hand, being able to walk through all resources of a specific type, in a specified scope such as a Management Group would be amazingly helpful.
This problem persists - but may be acting as expected? It only returns resources from the current providers subscription. I was expecting it go gather all resources available to the current managed identity.
Not definitely as expected. The error is seen even on current provider subscription. It works sporadically that itself means there is an issue with this data provider. retry
option could be useful..
This is still an issue with provider 3.48.0 and is today and yesterday causing issues for us which up until now have not occurred. I don't know if a provider or Azure API change has made this more frequent and likely to happen but it seems like something has happened! We've had to stop using this data source, at least temporarily.
Hi, following conversation with Microsoft on this, this works "real-time" atm for "resource group" scoped calls, see below. Based on this, would it be possible (or even make sense anyway) for the API call to be crafted this way for azurerm_resources data source calls where the resource group is specified ?
Powershell (WORKS)
GET https://management.azure.com/subscriptions/
Terraform (where there is a huge delay in returning new resources)
GET https://management.azure.com/subscriptions/
no progress yet ?
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_resources
Terraform Configuration Files
Debug Output
Panic Output
Expected Behaviour
The output "resource_list" could show 3 vmss name something like: resource_list = tolist([ "aks-monitorpool-34450601-vmss", "aks-systempool-34450601-vmss", "aks-testpool-34450601-vmss" ])
Actual Behaviour
At the first time apply sometimes the output is empty: resource_list = tolist([])
Most of time the output only have one data resource_list = tolist([ "aks-monitorpool-34450601-vmss", ])
Steps to Reproduce
terraform apply
Important Factoids
References
7035
(In this issue the similar bug seems be fixed in azurerm version = "~> 2.11.0". I use azurerm v2.45.1, however, it still not work)