From 34ad9a6ffd5cb3ba11c6266c1ff102247425d7b6 Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Fri, 16 Sep 2022 11:24:37 +0800 Subject: [PATCH 1/2] `azurerm_linux_virtual_machine` `azurerm_windows_virtual_machine` - support for `gallery_applications` --- .../compute/linux_virtual_machine_resource.go | 16 ++ ...nux_virtual_machine_resource_other_test.go | 257 ++++++++++++++++++ internal/services/compute/virtual_machine.go | 103 +++++++ .../windows_virtual_machine_resource.go | 16 ++ ...ows_virtual_machine_resource_other_test.go | 244 +++++++++++++++++ .../r/linux_virtual_machine.html.markdown | 16 ++ .../r/windows_virtual_machine.html.markdown | 16 ++ 7 files changed, 668 insertions(+) diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index 93aceda89746..b4eb25a82bf7 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -206,6 +206,8 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource { ValidateFunc: azValidate.ISO8601DurationBetween("PT15M", "PT2H"), }, + "gallery_applications": VirtualMachineGalleryApplicationsSchema(), + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), "license_type": { @@ -444,6 +446,9 @@ func resourceLinuxVirtualMachineCreate(d *pluginsdk.ResourceData, meta interface Identity: identity, Plan: plan, VirtualMachineProperties: &compute.VirtualMachineProperties{ + ApplicationProfile: &compute.ApplicationProfile{ + GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + }, HardwareProfile: &compute.HardwareProfile{ VMSize: compute.VirtualMachineSizeTypes(size), }, @@ -723,6 +728,10 @@ func resourceLinuxVirtualMachineRead(d *pluginsdk.ResourceData, meta interface{} } d.Set("capacity_reservation_group_id", capacityReservationGroupId) + if props.ApplicationProfile != nil && props.ApplicationProfile.GalleryApplications != nil { + d.Set("gallery_applications", flattenVirtualMachineGalleryApplications(props.ApplicationProfile.GalleryApplications)) + } + licenseType := "" if props.LicenseType != nil { licenseType = *props.LicenseType @@ -1039,6 +1048,13 @@ func resourceLinuxVirtualMachineUpdate(d *pluginsdk.ResourceData, meta interface update.ExtensionsTimeBudget = utils.String(d.Get("extensions_time_budget").(string)) } + if d.HasChange("gallery_applications") { + shouldUpdate = true + update.ApplicationProfile = &compute.ApplicationProfile{ + GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + } + } + if d.HasChange("max_bid_price") { shouldUpdate = true diff --git a/internal/services/compute/linux_virtual_machine_resource_other_test.go b/internal/services/compute/linux_virtual_machine_resource_other_test.go index 602a5421175b..7cb6db08e1d2 100644 --- a/internal/services/compute/linux_virtual_machine_resource_other_test.go +++ b/internal/services/compute/linux_virtual_machine_resource_other_test.go @@ -261,6 +261,44 @@ func TestAccLinuxVirtualMachine_otherCustomData(t *testing.T) { }) } +func TestAccLinuxVirtualMachine_otherGalleryApplications(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine", "test") + r := LinuxVirtualMachineResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.otherGalleryApplications(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + ), + }, + data.ImportStep(), + { + Config: r.otherGalleryApplicationsUpdated(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.otherGalleryApplicationsRemoved(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep(), + { + Config: r.otherGalleryApplications(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + ), + }, + data.ImportStep(), + }) +} + func TestAccLinuxVirtualMachine_otherEdgeZone(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine", "test") r := LinuxVirtualMachineResource{} @@ -1260,6 +1298,225 @@ resource "azurerm_linux_virtual_machine" "test" { `, r.otherBootDiagnosticsTemplate(data), data.RandomInteger) } +func (r LinuxVirtualMachineResource) otherGalleryApplications(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = local.first_public_key + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "16.04-LTS" + version = "latest" + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test.id + } +} +`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +} + +func (r LinuxVirtualMachineResource) otherGalleryApplicationsUpdated(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = local.first_public_key + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "16.04-LTS" + version = "latest" + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test.id + order = 1 + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test2.id + order = 2 + configuration_reference_blob_uri = azurerm_storage_blob.test2.id + tag = "app2" + } +} +`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +} + +func (r LinuxVirtualMachineResource) otherGalleryApplicationsRemoved(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_linux_virtual_machine" "test" { + name = "acctestVM-%d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + admin_ssh_key { + username = "adminuser" + public_key = local.first_public_key + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "UbuntuServer" + sku = "16.04-LTS" + version = "latest" + } +} +`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +} + +func (r LinuxVirtualMachineResource) otherGalleryApplicationsTemplate(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_storage_account" "test" { + name = "accteststr%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_storage_container" "test" { + name = "test" + storage_account_name = azurerm_storage_account.test.name + container_access_type = "blob" +} + +resource "azurerm_storage_blob" "test" { + name = "script" + storage_account_name = azurerm_storage_account.test.name + storage_container_name = azurerm_storage_container.test.name + type = "Block" + source_content = "script" +} + +resource "azurerm_storage_blob" "test2" { + name = "script2" + storage_account_name = azurerm_storage_account.test.name + storage_container_name = azurerm_storage_container.test.name + type = "Block" + source_content = "script2" +} + +resource "azurerm_shared_image_gallery" "test" { + name = "acctestsig%[3]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_gallery_application" "test" { + name = "acctest-app-%[3]d" + gallery_id = azurerm_shared_image_gallery.test.id + location = azurerm_shared_image_gallery.test.location + supported_os_type = "Linux" +} + +resource "azurerm_gallery_application_version" "test" { + name = "0.0.1" + gallery_application_id = azurerm_gallery_application.test.id + location = azurerm_gallery_application.test.location + + source { + media_link = azurerm_storage_blob.test.id + default_configuration_link = azurerm_storage_blob.test.id + } + + manage_action { + install = "[install command]" + remove = "[remove command]" + } + + target_region { + name = azurerm_gallery_application.test.location + regional_replica_count = 1 + storage_account_type = "Premium_LRS" + } +} + +resource "azurerm_gallery_application" "test2" { + name = "acctest-app2-%[3]d" + gallery_id = azurerm_shared_image_gallery.test.id + location = azurerm_shared_image_gallery.test.location + supported_os_type = "Linux" +} + + +resource "azurerm_gallery_application_version" "test2" { + name = "0.0.1" + gallery_application_id = azurerm_gallery_application.test2.id + location = azurerm_gallery_application.test2.location + + source { + media_link = azurerm_storage_blob.test.id + default_configuration_link = azurerm_storage_blob.test.id + } + + manage_action { + install = "[install command]" + remove = "[remove command]" + } + + target_region { + name = azurerm_gallery_application.test2.location + regional_replica_count = 1 + storage_account_type = "Premium_LRS" + } +} +`, r.template(data), data.RandomString, data.RandomInteger) +} + func (r LinuxVirtualMachineResource) otherUserData(data acceptance.TestData, userData string) string { return fmt.Sprintf(` %s diff --git a/internal/services/compute/virtual_machine.go b/internal/services/compute/virtual_machine.go index cea52921e805..ed90c8676577 100644 --- a/internal/services/compute/virtual_machine.go +++ b/internal/services/compute/virtual_machine.go @@ -485,3 +485,106 @@ func flattenVirtualMachineScheduledEventsProfile(input *compute.ScheduledEventsP }, } } + +func VirtualMachineGalleryApplicationsSchema() *pluginsdk.Schema { + return &pluginsdk.Schema{ + Type: pluginsdk.TypeList, + Optional: true, + MaxItems: 100, + Elem: &pluginsdk.Resource{ + Schema: map[string]*pluginsdk.Schema{ + "package_reference_id": { + Type: pluginsdk.TypeString, + Required: true, + ValidateFunc: validate.GalleryApplicationVersionID, + }, + + // Example: https://mystorageaccount.blob.core.windows.net/configurations/settings.config + "configuration_reference_blob_uri": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.IsURLWithHTTPorHTTPS, + }, + + "order": { + Type: pluginsdk.TypeInt, + Optional: true, + Default: 0, + ValidateFunc: validation.IntBetween(0, 2147483647), + }, + + // NOTE: Per the service team, "this is a pass through value that we just add to the model but don't depend on. It can be any string." + "tag": { + Type: pluginsdk.TypeString, + Optional: true, + ValidateFunc: validation.StringIsNotEmpty, + }, + }, + }, + } +} + +func expandVirtualMachineGalleryApplications(input []interface{}) *[]compute.VMGalleryApplication { + out := make([]compute.VMGalleryApplication, 0) + if len(input) == 0 { + return &out + } + + for _, v := range input { + packageReferenceId := v.(map[string]interface{})["package_reference_id"].(string) + configurationReference := v.(map[string]interface{})["configuration_reference_blob_uri"].(string) + order := v.(map[string]interface{})["order"].(int) + tag := v.(map[string]interface{})["tag"].(string) + + app := &compute.VMGalleryApplication{ + PackageReferenceID: utils.String(packageReferenceId), + ConfigurationReference: utils.String(configurationReference), + Order: utils.Int32(int32(order)), + Tags: utils.String(tag), + } + + out = append(out, *app) + } + + return &out +} + +func flattenVirtualMachineGalleryApplications(input *[]compute.VMGalleryApplication) []interface{} { + if len(*input) == 0 { + return nil + } + + out := make([]interface{}, 0) + + for _, v := range *input { + var packageReferenceId, configurationReference, tag string + var order int + + if v.PackageReferenceID != nil { + packageReferenceId = *v.PackageReferenceID + } + + if v.ConfigurationReference != nil { + configurationReference = *v.ConfigurationReference + } + + if v.Order != nil { + order = int(*v.Order) + } + + if v.Tags != nil { + tag = *v.Tags + } + + app := map[string]interface{}{ + "package_reference_id": packageReferenceId, + "configuration_reference_blob_uri": configurationReference, + "order": order, + "tag": tag, + } + + out = append(out, app) + } + + return out +} diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index 98c06b72d964..576bda57b3cf 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -208,6 +208,8 @@ func resourceWindowsVirtualMachine() *pluginsdk.Resource { ValidateFunc: azValidate.ISO8601DurationBetween("PT15M", "PT2H"), }, + "gallery_applications": VirtualMachineGalleryApplicationsSchema(), + "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), "license_type": { @@ -478,6 +480,9 @@ func resourceWindowsVirtualMachineCreate(d *pluginsdk.ResourceData, meta interfa Identity: identity, Plan: plan, VirtualMachineProperties: &compute.VirtualMachineProperties{ + ApplicationProfile: &compute.ApplicationProfile{ + GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + }, HardwareProfile: &compute.HardwareProfile{ VMSize: compute.VirtualMachineSizeTypes(size), }, @@ -796,6 +801,10 @@ func resourceWindowsVirtualMachineRead(d *pluginsdk.ResourceData, meta interface } d.Set("extensions_time_budget", extensionsTimeBudget) + if props.ApplicationProfile != nil && props.ApplicationProfile.GalleryApplications != nil { + d.Set("gallery_applications", flattenVirtualMachineGalleryApplications(props.ApplicationProfile.GalleryApplications)) + } + // defaulted since BillingProfile isn't returned if it's unset maxBidPrice := float64(-1.0) if props.BillingProfile != nil && props.BillingProfile.MaxPrice != nil { @@ -1133,6 +1142,13 @@ func resourceWindowsVirtualMachineUpdate(d *pluginsdk.ResourceData, meta interfa update.ExtensionsTimeBudget = utils.String(d.Get("extensions_time_budget").(string)) } + if d.HasChange("gallery_applications") { + shouldUpdate = true + update.ApplicationProfile = &compute.ApplicationProfile{ + GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + } + } + if d.HasChange("max_bid_price") { shouldUpdate = true diff --git a/internal/services/compute/windows_virtual_machine_resource_other_test.go b/internal/services/compute/windows_virtual_machine_resource_other_test.go index 689f5eceb88b..f7a9130243aa 100644 --- a/internal/services/compute/windows_virtual_machine_resource_other_test.go +++ b/internal/services/compute/windows_virtual_machine_resource_other_test.go @@ -367,6 +367,44 @@ func TestAccWindowsVirtualMachine_otherEdgeZone(t *testing.T) { }) } +func TestAccWindowsVirtualMachine_otherGalleryApplications(t *testing.T) { + data := acceptance.BuildTestData(t, "azurerm_windows_virtual_machine", "test") + r := WindowsVirtualMachineResource{} + + data.ResourceTest(t, r, []acceptance.TestStep{ + { + Config: r.otherGalleryApplications(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + ), + }, + data.ImportStep("admin_password"), + { + Config: r.otherGalleryApplicationsUpdated(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("admin_password"), + { + Config: r.otherGalleryApplicationsRemoved(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + ), + }, + data.ImportStep("admin_password"), + { + Config: r.otherGalleryApplications(data), + Check: acceptance.ComposeTestCheckFunc( + check.That(data.ResourceName).ExistsInAzure(r), + check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + ), + }, + data.ImportStep("admin_password"), + }) +} + func TestAccWindowsVirtualMachine_otherUserData(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_virtual_machine", "test") r := WindowsVirtualMachineResource{} @@ -1630,6 +1668,212 @@ resource "azurerm_windows_virtual_machine" "test" { `, r.template(data)) } +func (r WindowsVirtualMachineResource) otherGalleryApplications(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_windows_virtual_machine" "test" { + name = local.vm_name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "MicrosoftWindowsServer" + offer = "WindowsServer" + sku = "2016-Datacenter" + version = "latest" + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test.id + } +} +`, r.otherGalleryApplicationsTemplate(data)) +} + +func (r WindowsVirtualMachineResource) otherGalleryApplicationsUpdated(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_windows_virtual_machine" "test" { + name = local.vm_name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "MicrosoftWindowsServer" + offer = "WindowsServer" + sku = "2016-Datacenter" + version = "latest" + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test.id + order = 1 + } + + gallery_applications { + package_reference_id = azurerm_gallery_application_version.test2.id + order = 2 + configuration_reference_blob_uri = azurerm_storage_blob.test2.id + tag = "app2" + } +} +`, r.otherGalleryApplicationsTemplate(data)) +} + +func (r WindowsVirtualMachineResource) otherGalleryApplicationsRemoved(data acceptance.TestData) string { + return fmt.Sprintf(` +%s + +resource "azurerm_windows_virtual_machine" "test" { + name = local.vm_name + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + size = "Standard_F2" + admin_username = "adminuser" + admin_password = "P@$$w0rd1234!" + network_interface_ids = [ + azurerm_network_interface.test.id, + ] + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "MicrosoftWindowsServer" + offer = "WindowsServer" + sku = "2016-Datacenter" + version = "latest" + } +} +`, r.otherGalleryApplicationsTemplate(data)) +} + +func (r WindowsVirtualMachineResource) otherGalleryApplicationsTemplate(data acceptance.TestData) string { + return fmt.Sprintf(` +%[1]s + +resource "azurerm_storage_account" "test" { + name = "accteststr%[2]s" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location + account_tier = "Standard" + account_replication_type = "LRS" +} + +resource "azurerm_storage_container" "test" { + name = "test" + storage_account_name = azurerm_storage_account.test.name + container_access_type = "blob" +} + +resource "azurerm_storage_blob" "test" { + name = "script" + storage_account_name = azurerm_storage_account.test.name + storage_container_name = azurerm_storage_container.test.name + type = "Block" + source_content = "script" +} + +resource "azurerm_storage_blob" "test2" { + name = "script2" + storage_account_name = azurerm_storage_account.test.name + storage_container_name = azurerm_storage_container.test.name + type = "Block" + source_content = "script2" +} + +resource "azurerm_shared_image_gallery" "test" { + name = "acctestsig%[3]d" + resource_group_name = azurerm_resource_group.test.name + location = azurerm_resource_group.test.location +} + +resource "azurerm_gallery_application" "test" { + name = "acctest-app-%[3]d" + gallery_id = azurerm_shared_image_gallery.test.id + location = azurerm_shared_image_gallery.test.location + supported_os_type = "Windows" +} + +resource "azurerm_gallery_application_version" "test" { + name = "0.0.1" + gallery_application_id = azurerm_gallery_application.test.id + location = azurerm_gallery_application.test.location + + source { + media_link = azurerm_storage_blob.test.id + default_configuration_link = azurerm_storage_blob.test.id + } + + manage_action { + install = "[install command]" + remove = "[remove command]" + } + + target_region { + name = azurerm_gallery_application.test.location + regional_replica_count = 1 + storage_account_type = "Premium_LRS" + } +} + +resource "azurerm_gallery_application" "test2" { + name = "acctest-app2-%[3]d" + gallery_id = azurerm_shared_image_gallery.test.id + location = azurerm_shared_image_gallery.test.location + supported_os_type = "Windows" +} + +resource "azurerm_gallery_application_version" "test2" { + name = "0.0.1" + gallery_application_id = azurerm_gallery_application.test2.id + location = azurerm_gallery_application.test2.location + + source { + media_link = azurerm_storage_blob.test.id + default_configuration_link = azurerm_storage_blob.test.id + } + + manage_action { + install = "[install command]" + remove = "[remove command]" + } + + target_region { + name = azurerm_gallery_application.test2.location + regional_replica_count = 1 + storage_account_type = "Premium_LRS" + } +} +`, r.template(data), data.RandomString, data.RandomInteger) +} + func (r WindowsVirtualMachineResource) otherUserData(data acceptance.TestData, userData string) string { return fmt.Sprintf(` %s diff --git a/website/docs/r/linux_virtual_machine.html.markdown b/website/docs/r/linux_virtual_machine.html.markdown index 174f9145a8ac..a4bccdf6cd5a 100644 --- a/website/docs/r/linux_virtual_machine.html.markdown +++ b/website/docs/r/linux_virtual_machine.html.markdown @@ -154,6 +154,8 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to 90 minutes (`PT1H30M`). +* `gallery_applications` - (Optional) A `gallery_applications` block as defined below. + * `identity` - (Optional) An `identity` block as defined below. * `patch_mode` - (Optional) Specifies the mode of in-guest patching to this Linux Virtual Machine. Possible values are `AutomaticByPlatform` and `ImageDefault`. Defaults to `ImageDefault`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes). @@ -244,6 +246,20 @@ A `diff_disk_settings` block supports the following: --- +A `gallery_applications` block supports the following: + +* `package_reference_id` - (Required) Specifies the Gallery Application Version resource ID. + +-> **NOTE:** The `package_reference_id` should be in the form of `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/applications/application1/versions/version1`. + +* `configuration_reference_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. + +* `order` - (Optional) Specifies the order in which the packages have to be installed. Possible values are between `0` and `2,147,483,647`. + +* `tag` - (Optional) Specifies a passthrough value for more generic context. This field can be any valid `string` value. + +--- + An `identity` block supports the following: * `type` - (Required) Specifies the type of Managed Service Identity that should be configured on this Linux Virtual Machine. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both). diff --git a/website/docs/r/windows_virtual_machine.html.markdown b/website/docs/r/windows_virtual_machine.html.markdown index 21312842d9fe..b6352576c32b 100644 --- a/website/docs/r/windows_virtual_machine.html.markdown +++ b/website/docs/r/windows_virtual_machine.html.markdown @@ -143,6 +143,8 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to 90 minutes (`PT1H30M`). +* `gallery_applications` - (Optional) A `gallery_applications` block as defined below. + * `hotpatching_enabled` - (Optional) Should the VM be patched without requiring a reboot? Possible values are `true` or `false`. Defaults to `false`. For more information about hot patching please see the [product documentation](https://docs.microsoft.com/azure/automanage/automanage-hotpatch). -> **NOTE:** Hotpatching can only be enabled if the `patch_mode` is set to `AutomaticByPlatform`, the `provision_vm_agent` is set to `true`, your `source_image_reference` references a hotpatching enabled image, and the VM's `size` is set to a [Azure generation 2](https://docs.microsoft.com/azure/virtual-machines/generation-2#generation-2-vm-sizes) VM. An example of how to correctly configure a Windows Virtual Machine to use the `hotpatching_enabled` field can be found in the [`./examples/virtual-machines/windows/hotpatching-enabled`](https://github.com/hashicorp/terraform-provider-azurerm/tree/main/examples/virtual-machines/windows/hotpatching-enabled) directory within the GitHub Repository. @@ -243,6 +245,20 @@ A `diff_disk_settings` block supports the following: --- +A `gallery_applications` block supports the following: + +* `package_reference_id` - (Required) Specifies the Gallery Application Version resource ID. + +-> **NOTE:** The `package_reference_id` should be in the form of `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/applications/application1/versions/version1`. + +* `configuration_reference_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. + +* `order` - (Optional) Specifies the order in which the packages have to be installed. Possible values are between `0` and `2,147,483,647`. + +* `tag` - (Optional) Specifies a passthrough value for more generic context. This field can be any valid `string` value. + +--- + An `identity` block supports the following: * `type` - (Required) Specifies the type of Managed Service Identity that should be configured on this Windows Virtual Machine. Possible values are `SystemAssigned`, `UserAssigned`, `SystemAssigned, UserAssigned` (to enable both). From 37a4fc3bfe80216234c92d314ec7a46d1de36bba Mon Sep 17 00:00:00 2001 From: Yichun Ma Date: Wed, 28 Sep 2022 17:33:54 +0800 Subject: [PATCH 2/2] Rename properties name --- .../compute/linux_virtual_machine_resource.go | 10 ++-- ...nux_virtual_machine_resource_other_test.go | 48 +++++++++---------- internal/services/compute/virtual_machine.go | 22 ++++----- .../windows_virtual_machine_resource.go | 10 ++-- ...ows_virtual_machine_resource_other_test.go | 48 +++++++++---------- .../r/linux_virtual_machine.html.markdown | 10 ++-- .../r/windows_virtual_machine.html.markdown | 10 ++-- 7 files changed, 77 insertions(+), 81 deletions(-) diff --git a/internal/services/compute/linux_virtual_machine_resource.go b/internal/services/compute/linux_virtual_machine_resource.go index b4eb25a82bf7..7ff537fc92f1 100644 --- a/internal/services/compute/linux_virtual_machine_resource.go +++ b/internal/services/compute/linux_virtual_machine_resource.go @@ -206,7 +206,7 @@ func resourceLinuxVirtualMachine() *pluginsdk.Resource { ValidateFunc: azValidate.ISO8601DurationBetween("PT15M", "PT2H"), }, - "gallery_applications": VirtualMachineGalleryApplicationsSchema(), + "gallery_application": VirtualMachineGalleryApplicationSchema(), "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), @@ -447,7 +447,7 @@ func resourceLinuxVirtualMachineCreate(d *pluginsdk.ResourceData, meta interface Plan: plan, VirtualMachineProperties: &compute.VirtualMachineProperties{ ApplicationProfile: &compute.ApplicationProfile{ - GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + GalleryApplications: expandVirtualMachineGalleryApplication(d.Get("gallery_application").([]interface{})), }, HardwareProfile: &compute.HardwareProfile{ VMSize: compute.VirtualMachineSizeTypes(size), @@ -729,7 +729,7 @@ func resourceLinuxVirtualMachineRead(d *pluginsdk.ResourceData, meta interface{} d.Set("capacity_reservation_group_id", capacityReservationGroupId) if props.ApplicationProfile != nil && props.ApplicationProfile.GalleryApplications != nil { - d.Set("gallery_applications", flattenVirtualMachineGalleryApplications(props.ApplicationProfile.GalleryApplications)) + d.Set("gallery_application", flattenVirtualMachineGalleryApplication(props.ApplicationProfile.GalleryApplications)) } licenseType := "" @@ -1048,10 +1048,10 @@ func resourceLinuxVirtualMachineUpdate(d *pluginsdk.ResourceData, meta interface update.ExtensionsTimeBudget = utils.String(d.Get("extensions_time_budget").(string)) } - if d.HasChange("gallery_applications") { + if d.HasChange("gallery_application") { shouldUpdate = true update.ApplicationProfile = &compute.ApplicationProfile{ - GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + GalleryApplications: expandVirtualMachineGalleryApplication(d.Get("gallery_application").([]interface{})), } } diff --git a/internal/services/compute/linux_virtual_machine_resource_other_test.go b/internal/services/compute/linux_virtual_machine_resource_other_test.go index 7cb6db08e1d2..5d441bce8bfb 100644 --- a/internal/services/compute/linux_virtual_machine_resource_other_test.go +++ b/internal/services/compute/linux_virtual_machine_resource_other_test.go @@ -261,38 +261,38 @@ func TestAccLinuxVirtualMachine_otherCustomData(t *testing.T) { }) } -func TestAccLinuxVirtualMachine_otherGalleryApplications(t *testing.T) { +func TestAccLinuxVirtualMachine_otherGalleryApplication(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_linux_virtual_machine", "test") r := LinuxVirtualMachineResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.otherGalleryApplications(data), + Config: r.otherGalleryApplication(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + check.That(data.ResourceName).Key("gallery_application.0.order").HasValue("0"), ), }, data.ImportStep(), { - Config: r.otherGalleryApplicationsUpdated(data), + Config: r.otherGalleryApplicationUpdated(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep(), { - Config: r.otherGalleryApplicationsRemoved(data), + Config: r.otherGalleryApplicationRemoved(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep(), { - Config: r.otherGalleryApplications(data), + Config: r.otherGalleryApplication(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + check.That(data.ResourceName).Key("gallery_application.0.order").HasValue("0"), ), }, data.ImportStep(), @@ -1298,7 +1298,7 @@ resource "azurerm_linux_virtual_machine" "test" { `, r.otherBootDiagnosticsTemplate(data), data.RandomInteger) } -func (r LinuxVirtualMachineResource) otherGalleryApplications(data acceptance.TestData) string { +func (r LinuxVirtualMachineResource) otherGalleryApplication(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1329,14 +1329,14 @@ resource "azurerm_linux_virtual_machine" "test" { version = "latest" } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test.id + gallery_application { + version_id = azurerm_gallery_application_version.test.id } } -`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +`, r.otherGalleryApplicationTemplate(data), data.RandomInteger) } -func (r LinuxVirtualMachineResource) otherGalleryApplicationsUpdated(data acceptance.TestData) string { +func (r LinuxVirtualMachineResource) otherGalleryApplicationUpdated(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1367,22 +1367,22 @@ resource "azurerm_linux_virtual_machine" "test" { version = "latest" } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test.id - order = 1 + gallery_application { + version_id = azurerm_gallery_application_version.test.id + order = 1 } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test2.id - order = 2 - configuration_reference_blob_uri = azurerm_storage_blob.test2.id - tag = "app2" + gallery_application { + version_id = azurerm_gallery_application_version.test2.id + order = 2 + configuration_blob_uri = azurerm_storage_blob.test2.id + tag = "app2" } } -`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +`, r.otherGalleryApplicationTemplate(data), data.RandomInteger) } -func (r LinuxVirtualMachineResource) otherGalleryApplicationsRemoved(data acceptance.TestData) string { +func (r LinuxVirtualMachineResource) otherGalleryApplicationRemoved(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1413,10 +1413,10 @@ resource "azurerm_linux_virtual_machine" "test" { version = "latest" } } -`, r.otherGalleryApplicationsTemplate(data), data.RandomInteger) +`, r.otherGalleryApplicationTemplate(data), data.RandomInteger) } -func (r LinuxVirtualMachineResource) otherGalleryApplicationsTemplate(data acceptance.TestData) string { +func (r LinuxVirtualMachineResource) otherGalleryApplicationTemplate(data acceptance.TestData) string { return fmt.Sprintf(` %[1]s diff --git a/internal/services/compute/virtual_machine.go b/internal/services/compute/virtual_machine.go index ed90c8676577..80575d724a49 100644 --- a/internal/services/compute/virtual_machine.go +++ b/internal/services/compute/virtual_machine.go @@ -486,21 +486,21 @@ func flattenVirtualMachineScheduledEventsProfile(input *compute.ScheduledEventsP } } -func VirtualMachineGalleryApplicationsSchema() *pluginsdk.Schema { +func VirtualMachineGalleryApplicationSchema() *pluginsdk.Schema { return &pluginsdk.Schema{ Type: pluginsdk.TypeList, Optional: true, MaxItems: 100, Elem: &pluginsdk.Resource{ Schema: map[string]*pluginsdk.Schema{ - "package_reference_id": { + "version_id": { Type: pluginsdk.TypeString, Required: true, ValidateFunc: validate.GalleryApplicationVersionID, }, // Example: https://mystorageaccount.blob.core.windows.net/configurations/settings.config - "configuration_reference_blob_uri": { + "configuration_blob_uri": { Type: pluginsdk.TypeString, Optional: true, ValidateFunc: validation.IsURLWithHTTPorHTTPS, @@ -524,15 +524,15 @@ func VirtualMachineGalleryApplicationsSchema() *pluginsdk.Schema { } } -func expandVirtualMachineGalleryApplications(input []interface{}) *[]compute.VMGalleryApplication { +func expandVirtualMachineGalleryApplication(input []interface{}) *[]compute.VMGalleryApplication { out := make([]compute.VMGalleryApplication, 0) if len(input) == 0 { return &out } for _, v := range input { - packageReferenceId := v.(map[string]interface{})["package_reference_id"].(string) - configurationReference := v.(map[string]interface{})["configuration_reference_blob_uri"].(string) + packageReferenceId := v.(map[string]interface{})["version_id"].(string) + configurationReference := v.(map[string]interface{})["configuration_blob_uri"].(string) order := v.(map[string]interface{})["order"].(int) tag := v.(map[string]interface{})["tag"].(string) @@ -549,7 +549,7 @@ func expandVirtualMachineGalleryApplications(input []interface{}) *[]compute.VMG return &out } -func flattenVirtualMachineGalleryApplications(input *[]compute.VMGalleryApplication) []interface{} { +func flattenVirtualMachineGalleryApplication(input *[]compute.VMGalleryApplication) []interface{} { if len(*input) == 0 { return nil } @@ -577,10 +577,10 @@ func flattenVirtualMachineGalleryApplications(input *[]compute.VMGalleryApplicat } app := map[string]interface{}{ - "package_reference_id": packageReferenceId, - "configuration_reference_blob_uri": configurationReference, - "order": order, - "tag": tag, + "version_id": packageReferenceId, + "configuration_blob_uri": configurationReference, + "order": order, + "tag": tag, } out = append(out, app) diff --git a/internal/services/compute/windows_virtual_machine_resource.go b/internal/services/compute/windows_virtual_machine_resource.go index 576bda57b3cf..fca2404e52ec 100644 --- a/internal/services/compute/windows_virtual_machine_resource.go +++ b/internal/services/compute/windows_virtual_machine_resource.go @@ -208,7 +208,7 @@ func resourceWindowsVirtualMachine() *pluginsdk.Resource { ValidateFunc: azValidate.ISO8601DurationBetween("PT15M", "PT2H"), }, - "gallery_applications": VirtualMachineGalleryApplicationsSchema(), + "gallery_application": VirtualMachineGalleryApplicationSchema(), "identity": commonschema.SystemAssignedUserAssignedIdentityOptional(), @@ -481,7 +481,7 @@ func resourceWindowsVirtualMachineCreate(d *pluginsdk.ResourceData, meta interfa Plan: plan, VirtualMachineProperties: &compute.VirtualMachineProperties{ ApplicationProfile: &compute.ApplicationProfile{ - GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + GalleryApplications: expandVirtualMachineGalleryApplication(d.Get("gallery_application").([]interface{})), }, HardwareProfile: &compute.HardwareProfile{ VMSize: compute.VirtualMachineSizeTypes(size), @@ -802,7 +802,7 @@ func resourceWindowsVirtualMachineRead(d *pluginsdk.ResourceData, meta interface d.Set("extensions_time_budget", extensionsTimeBudget) if props.ApplicationProfile != nil && props.ApplicationProfile.GalleryApplications != nil { - d.Set("gallery_applications", flattenVirtualMachineGalleryApplications(props.ApplicationProfile.GalleryApplications)) + d.Set("gallery_application", flattenVirtualMachineGalleryApplication(props.ApplicationProfile.GalleryApplications)) } // defaulted since BillingProfile isn't returned if it's unset @@ -1142,10 +1142,10 @@ func resourceWindowsVirtualMachineUpdate(d *pluginsdk.ResourceData, meta interfa update.ExtensionsTimeBudget = utils.String(d.Get("extensions_time_budget").(string)) } - if d.HasChange("gallery_applications") { + if d.HasChange("gallery_application") { shouldUpdate = true update.ApplicationProfile = &compute.ApplicationProfile{ - GalleryApplications: expandVirtualMachineGalleryApplications(d.Get("gallery_applications").([]interface{})), + GalleryApplications: expandVirtualMachineGalleryApplication(d.Get("gallery_application").([]interface{})), } } diff --git a/internal/services/compute/windows_virtual_machine_resource_other_test.go b/internal/services/compute/windows_virtual_machine_resource_other_test.go index f7a9130243aa..bb6b91862a14 100644 --- a/internal/services/compute/windows_virtual_machine_resource_other_test.go +++ b/internal/services/compute/windows_virtual_machine_resource_other_test.go @@ -367,38 +367,38 @@ func TestAccWindowsVirtualMachine_otherEdgeZone(t *testing.T) { }) } -func TestAccWindowsVirtualMachine_otherGalleryApplications(t *testing.T) { +func TestAccWindowsVirtualMachine_otherGalleryApplication(t *testing.T) { data := acceptance.BuildTestData(t, "azurerm_windows_virtual_machine", "test") r := WindowsVirtualMachineResource{} data.ResourceTest(t, r, []acceptance.TestStep{ { - Config: r.otherGalleryApplications(data), + Config: r.otherGalleryApplication(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + check.That(data.ResourceName).Key("gallery_application.0.order").HasValue("0"), ), }, data.ImportStep("admin_password"), { - Config: r.otherGalleryApplicationsUpdated(data), + Config: r.otherGalleryApplicationUpdated(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep("admin_password"), { - Config: r.otherGalleryApplicationsRemoved(data), + Config: r.otherGalleryApplicationRemoved(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), ), }, data.ImportStep("admin_password"), { - Config: r.otherGalleryApplications(data), + Config: r.otherGalleryApplication(data), Check: acceptance.ComposeTestCheckFunc( check.That(data.ResourceName).ExistsInAzure(r), - check.That(data.ResourceName).Key("gallery_applications.0.order").HasValue("0"), + check.That(data.ResourceName).Key("gallery_application.0.order").HasValue("0"), ), }, data.ImportStep("admin_password"), @@ -1668,7 +1668,7 @@ resource "azurerm_windows_virtual_machine" "test" { `, r.template(data)) } -func (r WindowsVirtualMachineResource) otherGalleryApplications(data acceptance.TestData) string { +func (r WindowsVirtualMachineResource) otherGalleryApplication(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1695,14 +1695,14 @@ resource "azurerm_windows_virtual_machine" "test" { version = "latest" } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test.id + gallery_application { + version_id = azurerm_gallery_application_version.test.id } } -`, r.otherGalleryApplicationsTemplate(data)) +`, r.otherGalleryApplicationTemplate(data)) } -func (r WindowsVirtualMachineResource) otherGalleryApplicationsUpdated(data acceptance.TestData) string { +func (r WindowsVirtualMachineResource) otherGalleryApplicationUpdated(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1729,22 +1729,22 @@ resource "azurerm_windows_virtual_machine" "test" { version = "latest" } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test.id - order = 1 + gallery_application { + version_id = azurerm_gallery_application_version.test.id + order = 1 } - gallery_applications { - package_reference_id = azurerm_gallery_application_version.test2.id - order = 2 - configuration_reference_blob_uri = azurerm_storage_blob.test2.id - tag = "app2" + gallery_application { + version_id = azurerm_gallery_application_version.test2.id + order = 2 + configuration_blob_uri = azurerm_storage_blob.test2.id + tag = "app2" } } -`, r.otherGalleryApplicationsTemplate(data)) +`, r.otherGalleryApplicationTemplate(data)) } -func (r WindowsVirtualMachineResource) otherGalleryApplicationsRemoved(data acceptance.TestData) string { +func (r WindowsVirtualMachineResource) otherGalleryApplicationRemoved(data acceptance.TestData) string { return fmt.Sprintf(` %s @@ -1771,10 +1771,10 @@ resource "azurerm_windows_virtual_machine" "test" { version = "latest" } } -`, r.otherGalleryApplicationsTemplate(data)) +`, r.otherGalleryApplicationTemplate(data)) } -func (r WindowsVirtualMachineResource) otherGalleryApplicationsTemplate(data acceptance.TestData) string { +func (r WindowsVirtualMachineResource) otherGalleryApplicationTemplate(data acceptance.TestData) string { return fmt.Sprintf(` %[1]s diff --git a/website/docs/r/linux_virtual_machine.html.markdown b/website/docs/r/linux_virtual_machine.html.markdown index a4bccdf6cd5a..8b1a3be930eb 100644 --- a/website/docs/r/linux_virtual_machine.html.markdown +++ b/website/docs/r/linux_virtual_machine.html.markdown @@ -154,7 +154,7 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to 90 minutes (`PT1H30M`). -* `gallery_applications` - (Optional) A `gallery_applications` block as defined below. +* `gallery_application` - (Optional) A `gallery_application` block as defined below. * `identity` - (Optional) An `identity` block as defined below. @@ -246,13 +246,11 @@ A `diff_disk_settings` block supports the following: --- -A `gallery_applications` block supports the following: +A `gallery_application` block supports the following: -* `package_reference_id` - (Required) Specifies the Gallery Application Version resource ID. +* `version_id` - (Required) Specifies the Gallery Application Version resource ID. --> **NOTE:** The `package_reference_id` should be in the form of `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/applications/application1/versions/version1`. - -* `configuration_reference_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. +* `configuration_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. * `order` - (Optional) Specifies the order in which the packages have to be installed. Possible values are between `0` and `2,147,483,647`. diff --git a/website/docs/r/windows_virtual_machine.html.markdown b/website/docs/r/windows_virtual_machine.html.markdown index b6352576c32b..c02d329759a8 100644 --- a/website/docs/r/windows_virtual_machine.html.markdown +++ b/website/docs/r/windows_virtual_machine.html.markdown @@ -143,7 +143,7 @@ The following arguments are supported: * `extensions_time_budget` - (Optional) Specifies the duration allocated for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to 90 minutes (`PT1H30M`). -* `gallery_applications` - (Optional) A `gallery_applications` block as defined below. +* `gallery_application` - (Optional) A `gallery_application` block as defined below. * `hotpatching_enabled` - (Optional) Should the VM be patched without requiring a reboot? Possible values are `true` or `false`. Defaults to `false`. For more information about hot patching please see the [product documentation](https://docs.microsoft.com/azure/automanage/automanage-hotpatch). @@ -245,13 +245,11 @@ A `diff_disk_settings` block supports the following: --- -A `gallery_applications` block supports the following: +A `gallery_application` block supports the following: -* `package_reference_id` - (Required) Specifies the Gallery Application Version resource ID. +* `version_id` - (Required) Specifies the Gallery Application Version resource ID. --> **NOTE:** The `package_reference_id` should be in the form of `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/galleries/gallery1/applications/application1/versions/version1`. - -* `configuration_reference_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. +* `configuration_blob_uri` - (Optional) Specifies the URI to an Azure Blob that will replace the default configuration for the package if provided. * `order` - (Optional) Specifies the order in which the packages have to be installed. Possible values are between `0` and `2,147,483,647`.