new resource azurerm_stack_hci_extension#26929
Conversation
…m into stackhci_extension
ms-zhenhua
left a comment
There was a problem hiding this comment.
Hi @teowa,
Thanks for this PR - I've taken a look through and left some comments inline. If we can fix those up, this should be good to go 👍
| existing, err := client.Get(ctx, *id) | ||
| if err != nil { | ||
| if response.WasNotFound(existing.HttpResponse) { | ||
| return fmt.Errorf("%s was not found", id) |
There was a problem hiding this comment.
| return fmt.Errorf("%s was not found", id) | |
| return metadata.MarkAsGone(*id) |
| if response.WasNotFound(existing.HttpResponse) { | ||
| return fmt.Errorf("%s was not found", id) | ||
| } | ||
| return fmt.Errorf("reading %s: %+v", id, err) |
There was a problem hiding this comment.
| return fmt.Errorf("reading %s: %+v", id, err) | |
| return fmt.Errorf("retrieving %s: %+v", *id, err) |
There was a problem hiding this comment.
sorry for missing this one, updated
|
|
||
| model := resp.Model | ||
| if model == nil || model.Properties == nil || model.Properties.ExtensionParameters == nil { | ||
| return fmt.Errorf("retrieving %s: `model` was nil", id) |
There was a problem hiding this comment.
| return fmt.Errorf("retrieving %s: `model` was nil", id) | |
| return fmt.Errorf("retrieving %s: `model` was nil", *id) |
| model.Properties.ExtensionParameters.TypeHandlerVersion = pointer.To(config.TypeHandlerVersion) | ||
| } | ||
|
|
||
| if err := client.CreateThenPoll(ctx, *id, *model); err != nil { |
There was a problem hiding this comment.
update should use UpdateThenPoll or CreateOrUpdateThenPoll
| publisher = "Microsoft.EnterpriseCloud.Monitoring" | ||
| type = "MicrosoftMonitoringAgent" | ||
|
|
||
| protected_settings = <<PROTECTED_SETTINGS |
There was a problem hiding this comment.
basic should not contain optional properties: protected_settings and settings
|
|
||
| * `type` - (Required) Specifies the type of the extension. For example `CustomScriptExtension` or `AzureMonitorLinuxAgent`. Changing this forces a new resource to be created. | ||
|
|
||
| * `auto_upgrade_minor_version_enabled` - (Optional) Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. Possible values are `true` and `false`. |
There was a problem hiding this comment.
what are the differences between auto_upgrade_minor_version_enabled and automatic_upgrade_enabled?
There was a problem hiding this comment.
The auto_upgrade_minor_version_enabled is about minor version, and it only works in creation stage. This two properties are available in similar resource like azurerm_virtual_machine_extension
| -> **NOTE:** Possible values for `type_handler_version` can be found using the Azure CLI, e.g.: | ||
|
|
||
| ```shell | ||
| az vm extension image list --publisher Microsoft.Azure.Monitor -n AzureMonitorWindowsAgent --location westus -o table |
There was a problem hiding this comment.
Shall we provide a link to this Azure CLI instead of directly providing the shell command?
There was a problem hiding this comment.
Removed because this cannot be found in doc, and it might be inaccurate.
|
Hi @ms-zhenhua , thanks for reviewing this, please kindly take another look. |
ms-zhenhua
left a comment
There was a problem hiding this comment.
Hi @teowa ,
Thank you for your updates. LGTM~
|
@teowa - could we fix up the merge conflicts please? |
…m into stackhci_extension
|
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
new resource
azurerm_stack_hci_extensionazure doc: https://learn.microsoft.com/en-us/azure-stack/hci/manage/arc-extension-management?tabs=azureportal
rest api: https://github.com/Azure/azure-rest-api-specs/blob/c7b98b36e4023331545051284d8500adf98f02fe/specification/azurestackhci/resource-manager/Microsoft.AzureStackHCI/stable/2024-01-01/extensions.json
PR Checklist
For example: “
resource_name_here- description of change e.g. adding propertynew_property_name_here”Changes to existing Resource / Data Source
Testing
Tests depends on Stack HCI Arc Setting resource generated during HCI deployment, the HCI deployment steps is included in PR #25646, my local tests can pass with a existing Arc Setting resource.
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_stack_hci_extensionThis is a (please select all that apply):
Related Issue(s)
Fixes #0000
Note
If this PR changes meaningfully during the course of review please update the title and description as required.