-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -34,6 +34,11 @@ func dataSourceSubscriptions() *schema.Resource { | |||||
Computed: true, | ||||||
Elem: &schema.Resource{ | ||||||
Schema: map[string]*schema.Schema{ | ||||||
"resource_manager_id": { | ||||||
Type: schema.TypeString, | ||||||
Computed: true, | ||||||
}, | ||||||
|
||||||
"subscription_id": { | ||||||
Type: schema.TypeString, | ||||||
Computed: true, | ||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. can we make this just
Suggested change
|
||||||
} | ||||||
if v := val.SubscriptionID; v != nil { | ||||||
s["subscription_id"] = *v | ||||||
} | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. can we make this just
Suggested change
|
||||||
check.That(data.ResourceName).Key("subscriptions.0.subscription_id").Exists(), | ||||||
check.That(data.ResourceName).Key("subscriptions.0.display_name").Exists(), | ||||||
check.That(data.ResourceName).Key("subscriptions.0.tenant_id").Exists(), | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. can we make this just
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was a bit confused if I should use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no worries - we use |
||||||
* `subscription_id` - The subscription GUID. | ||||||
* `display_name` - The subscription display name. | ||||||
* `tenant_id` - The subscription tenant 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: