-
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
subscription: exposing the id
field
#10598
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey @stawii
Thanks for this PR.
Taking a look through this mostly LGTM - however can we rename this nested field to id
rather than resource_manager_id
?
Thanks!
@@ -34,6 +34,11 @@ func dataSourceSubscriptions() *schema.Resource { | |||
Computed: true, | |||
Elem: &schema.Resource{ | |||
Schema: map[string]*schema.Schema{ | |||
"resource_manager_id": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this just id
to match other resources:
"resource_manager_id": { | |
"id": { |
@@ -99,6 +104,9 @@ func dataSourceSubscriptionsRead(d *schema.ResourceData, meta interface{}) error | |||
|
|||
s := make(map[string]interface{}) | |||
|
|||
if v := val.ID; v != nil { | |||
s["resource_manager_id"] = *v |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this just id
to match other resources:
s["resource_manager_id"] = *v | |
s["id"] = *v |
@@ -17,6 +17,7 @@ func TestAccDataSourceSubscriptions_basic(t *testing.T) { | |||
{ | |||
Config: SubscriptionsDataSource{}.basic(), | |||
Check: resource.ComposeTestCheckFunc( | |||
check.That(data.ResourceName).Key("subscriptions.0.resource_manager_id").Exists(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this just id
to match other resources:
check.That(data.ResourceName).Key("subscriptions.0.resource_manager_id").Exists(), | |
check.That(data.ResourceName).Key("subscriptions.0.id").Exists(), |
@@ -36,6 +36,7 @@ output "first_available_subscription_display_name" { | |||
|
|||
The `subscription` block contains: | |||
|
|||
* `resource_manager_id` - The Resource Manager ID of this subscription. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we make this just id
to match other resources:
* `resource_manager_id` - The Resource Manager ID of this subscription. | |
* `id` - The ID of this Subscription. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was a bit confused if I should use id
or resource_manager_id
;) id
fits "better" and it compatible with azurerm_subscription, but I've seen resource_manager_id
in a lot of different places too. Seems I've picked wrong.
I'll change it soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no worries - we use resource_manager_id
only where a secondary is present (e.g. data plane id) - otherwise this should be id
resource_manager_id
fieldid
field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for this @stawii
This has been released in version 2.48.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.48.0"
}
# ... other configuration ... |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Fixes #10093