Skip to content

Commit

Permalink
rename automatic_update_extension_settings to `automatic_update_ext…
Browse files Browse the repository at this point in the history
…ension`
  • Loading branch information
ziyeqf committed Jan 5, 2023
1 parent efa02a6 commit d06c647
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func resourceSiteRecoveryProtectionContainerMapping() *pluginsdk.Resource {
ValidateFunc: azure.ValidateResourceID,
DiffSuppressFunc: suppress.CaseDifference,
},
"automatic_update_extension_settings": {
"automatic_update_extension": {
Type: pluginsdk.TypeList,
MinItems: 1,
MaxItems: 1,
Expand Down Expand Up @@ -137,7 +137,7 @@ func resourceSiteRecoveryContainerMappingCreate(d *pluginsdk.ResourceData, meta
},
}

autoUpdateEnabledValue, automationAccountArmId := expandAutoUpdateSettings(d.Get("automatic_update_extension_settings").([]interface{}))
autoUpdateEnabledValue, automationAccountArmId := expandAutoUpdateSettings(d.Get("automatic_update_extension").([]interface{}))

parameters.Properties.ProviderSpecificInput = siterecovery.A2AContainerMappingInput{
InstanceType: siterecovery.InstanceTypeBasicReplicationProviderSpecificContainerMappingInputInstanceTypeA2A,
Expand Down Expand Up @@ -208,8 +208,8 @@ func resourceSiteRecoveryContainerMappingUpdate(d *pluginsdk.ResourceData, meta
AutomationAccountArmID: detail.AutomationAccountArmID,
}

if d.HasChange("automatic_update_extension_settings") {
autoUpdateEnabledValue, automationAccountArmId := expandAutoUpdateSettings(d.Get("automatic_update_extension_settings").([]interface{}))
if d.HasChange("automatic_update_extension") {
autoUpdateEnabledValue, automationAccountArmId := expandAutoUpdateSettings(d.Get("automatic_update_extension").([]interface{}))
updateInput.AgentAutoUpdateStatus = autoUpdateEnabledValue
updateInput.AutomationAccountArmID = automationAccountArmId
}
Expand Down Expand Up @@ -259,7 +259,7 @@ func resourceSiteRecoveryContainerMappingRead(d *pluginsdk.ResourceData, meta in
d.Set("recovery_target_protection_container_id", resp.Properties.TargetProtectionContainerID)

if detail, ok := resp.Properties.ProviderSpecificDetails.AsA2AProtectionContainerMappingDetails(); ok {
d.Set("automatic_update_extension_settings", flattenAutoUpdateSettings(detail))
d.Set("automatic_update_extension", flattenAutoUpdateSettings(detail))
}

return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ resource "azurerm_site_recovery_protection_container_mapping" "test" {
recovery_target_protection_container_id = azurerm_site_recovery_protection_container.test2.id
recovery_replication_policy_id = azurerm_site_recovery_replication_policy.test.id
name = "mapping-%d"
automatic_update_extension_settings {
automatic_update_extension {
enabled = %v
automation_account_id = azurerm_automation_account.test.id
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ The following arguments are supported:

* `recovery_replication_policy_id` - (Required) Id of the policy to use for this mapping. Changing this forces a new resource to be created.

* `automatic_update_extension_settings` - (Optional) a `automatic_update_extension_settings` block defined as below.
* `automatic_update_extension` - (Optional) a `automatic_update_extension` block defined as below.

---

An `automatic_update_extension` block supports the following:

* `enabled` - (Optional) Should the Mobility service installed on Azure virtual machines be automatically updated. Defaults to `false`.

~> **Note:** The setting applies to all Azure VMs protected in the same container. For more details see [this document](https://learn.microsoft.com/en-us/azure/site-recovery/azure-to-azure-autoupdate#enable-automatic-updates)
Expand Down

0 comments on commit d06c647

Please sign in to comment.