New List Resource: azurerm_resource_group#31270
Conversation
| Attributes: map[string]listschema.Attribute{ | ||
| "subscription_id": listschema.StringAttribute{ | ||
| Optional: true, | ||
| Description: "The ID of the subscription to query. Defaults to the value specified in the Provider Configuration.", |
There was a problem hiding this comment.
Shall we stick onusing the subscription id that is configured with the provider? So far the provider is meant to work for the specified subscription, though there are a variety of requests/issues around cross subscription, we used to suggest the users to use provider alias instead.
Exposing this subscription_id seems to be an exception of the above single subscription assumption.
There was a problem hiding this comment.
For List Resources, standard practice so far has been to expose a subscription_id attribute (where the API has a List By Subscription endpoint). We also have an internal issue on expanding the provider to work properly with multiple subscriptions, however I'm not sure what the priority of that is.
Given @jackofallops implemented the initial List Resources, establishing this pattern, I'm going to have to defer this question to him.
There was a problem hiding this comment.
Thanks for the question @magodo
Allowing users to list/discover resources in another subscription they have access to is not managing those resources, but rather allowing users the option to find and optionally create import configurations for them.
You are correct that, today, those import configs will need to have a provider alias with the other subscription configured, or another config entirely, to manage the resources in the non-local config. We felt it useful/convenient to allow users this option for the purposes of discovery.
Hope that helps!
There was a problem hiding this comment.
Thank you @sreallymatt and @jackofallops for the clarifications! Regarding the usage of the listed resources, per my understanding they are only used for importing and optionally generating the configuration. For this purpose, if a user specify a provider alias A (or leave it empty) in the list block, how will those resources belonging to other subscriptions be used in the final result?
|
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
# Conflicts: # internal/services/network/network_interface_resource_list_test.go # internal/services/network/network_profile_resource_list_test.go # internal/services/network/network_security_group_resource_list_test.go # internal/services/network/route_table_resource_list_test.go # internal/services/network/virtual_network_resource_list_test.go # internal/services/privatedns/private_dns_zone_resource_list_test.go # internal/services/storage/storage_account_resource_list_test.go
be05aa0 to
6a4ac57
Compare
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
Community Note
Description
azurerm_resource_groupgithub.com/hashicorp/terraform-plugin-testingto1.14.0PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
List test result:
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource- support for thething1property [GH-00000]This is a (please select all that apply):
AI Assistance Disclosure
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the provider.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Note
If this PR changes meaningfully during the course of review please update the title and description as required.