-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
data source azurerm_resources
can no longer query the existence of resource group
#24154
Comments
hi @herquan-docusign, could you please make sure that you are using the coccret authentication and the right subscription? This is not a scenario I can reproduce locally. If the subscription is right, could you please grab and share the debug log from terraform with command: |
@wuxu92 there are too much information dumped and it may contain sensitive information. What do you need to check?
You can see the difference between version 3.55.0 and 3.56.0
What do you see from your local environment? |
@herquan-docusign, I apologize for my previous misunderstanding. It appears that the behavior changed with version 3.56.0, as noted in this pull request: #21661. In my opinion, we should not rely on undefined behavior by querying a resource from a non-existent resource group to check if the resource group exists. |
If we want to let the data source |
Indeed, FWIW if a Since the error message in question should be clearer however, can we check whether the Resource Group exists prior to listing Resources within it? That'd allow us to output an error along the lines of We could look to introduce a new data source to list the Resource Groups (e.g. to cover "find all resource groups with a name matching Thanks! |
@tombuildsstuff we do not have any data source to "check whether the Resource Group exists prior to..." but if we all agree to have one we should add a feature request somewhere. |
Is there an existing issue for this?
Community Note
Since this change, we no longer put resource group in the filter but we always assume resource group should exist if it is specified. This data source is supposed "to access information about existing resources." and I think whether resource group exists or not should also be part of the job of this data source.
If we do want to assume resource group always exists, we should also provide a data source to check if a resource group exists or not. It could be named
azurerm_resource_groups
Terraform Version
1.5.5
AzureRM Provider Version
3.56.0
Affected Resource(s)/Data Source(s)
azurerm_resources
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Actual Behaviour
No response
Steps to Reproduce
No response
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: