Skip to content
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_virtual_machine - fix power state is null #22851

Conversation

ned1313
Copy link
Contributor

@ned1313 ned1313 commented Aug 7, 2023

The current version of the azurerm_virtual_machine data source returns a null value for the power_state attribute. This is because the API query against the resource needs to include the InstanceView parameter to get the extended attributes that include the power state.

I have updated the Get function call to include the InstanceView parameter and verified that power_state is now populated with both the running and deallocated states.

Fixes #22737

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @ned1313 LGTM 🍃

@stephybun stephybun added the bug label Aug 8, 2023
@stephybun stephybun merged commit de498c8 into hashicorp:main Aug 8, 2023
20 checks passed
@github-actions github-actions bot added this to the v3.69.0 milestone Aug 8, 2023
@ned1313 ned1313 deleted the virtual-machine-data-source-power-attribute branch August 8, 2023 13:18
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

data.azurerm_virtual_machine.power_state returns null
2 participants