-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azapi_resource_list can return incomplete results #617
Comments
Hi @lewis-jackson-bots , Thank you for taking time to report this issue. Yes, it could be the latency in the Azure API caused this issue. A workaround is adding a https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep |
@ms-henglu do you mean a If not, can you give an example of |
Hi @lewis-jackson-bots , I'm not sure if I understand the scenario correctly, if it's about getting the list of flexible servers after creating some and it returns incomplete results, please refer to below example: resource "azapi_resource" "flexibleServer" {
type = "Microsoft.DBforMySQL/flexibleServers@2021-05-01"
parent_id = azapi_resource.resourceGroup.id
name = "henglu624"
location = azapi_resource.resourceGroup.location
body = {
...
}
}
resource "time_sleep" "wait_1_min" {
create_duration = "1m"
depends_on = [azapi_resource.flexibleServer]
}
data "azapi_resource_list" "subscription__postgresql_flexible_servers" {
type = "Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01"
parent_id = data.azurerm_subscription.current.id
response_export_values = ["*"]
depends_on = [ time_sleep.wait_1_min ]
} |
Apologies for being unclear, but it's not a scenario like that. The servers have existed for years and we're using this When I tried to open the server list in the Azure portal it was also very slow there, so my hunch was that the Azure API was experiencing high latency / errors. In this scenario I would expect the |
@lewis-jackson-bots you can specify a reads time out block per the Terraform registry docs. |
I think the What if I had a known slow query that I was happy to wait for as long as the full results were correct at the end? |
Thanks @lewis-jackson-bots , I'll check and improve the behavior that it should return an error in this case. |
We encountered an issue today with this data block:
Where it returned all of our east US DBs and no UK south DBs. It looks like the cause of this is high latency in the Azure API.
This behaviour is undesirable as we'd want the data source to return an error if no UK DBs were found.
The text was updated successfully, but these errors were encountered: