-
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
Add Virtual Machine Scale Set Data Source #7141
Add Virtual Machine Scale Set Data Source #7141
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.
Hi @nickmhankins thanks for opening this PR! Overall this PR looks good, aside from some minor comments I have left inline.
return fmt.Errorf("Error making Read request on Virtual Machine Scale Set %q (Resource Group %q): %+v", name, resGroup, err) | ||
} | ||
|
||
d.SetId(*resp.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.
Could we first check if the ID is non-nil and non-empty before actually set the ID? Otherwise this would give the user a panic (if nil) or unexpected result (empty 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.
Yep, added
|
||
* `principal_id` - The ID of the System Managed Service Principal assigned to the Virtual Machine Scale Set. | ||
|
||
* `type` - The identity types of the Managed Identity assigned to the Virtual Machine Scale Set. |
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.
A minor typo
* `type` - The identity types of the Managed Identity assigned to the Virtual Machine Scale Set. | |
* `type` - The identity type of the Managed Identity assigned to the Virtual Machine Scale Set. |
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.
Fixed
}, | ||
}) | ||
} | ||
|
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.
Could we also add a test case for the azurerm_orchestrated_virtual_machine_scale_set
? I suppose it would also be useful.
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.
@ArcturusZhang Does the Orchestrated Scale Set resource set export those identity properties? I'm not sure it would be possible if not
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.
Well, orchestrated VMSS does not support the identity yet, therefore if you import an orchestrated VMSS into this data source, the identity block would be empty.
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.
@ArcturusZhang Got it, test added.
The tests have all finished and passed, not sure why it still says pending on GitHub. |
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 👍
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 @nickmhankins
This has been released in version 2.13.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.13.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! |
Exports the scale set ID as well as an identity block
Fixes #7142