Skip to content

Commit

Permalink
azurerm_site_recovery_replicated_vm - Add support for `target_disk_…
Browse files Browse the repository at this point in the history
…encryption_set_id` in `managed_disk` (#12374)
  • Loading branch information
mbfrahry authored Jun 29, 2021
1 parent c4a1439 commit 592e127
Show file tree
Hide file tree
Showing 3 changed files with 430 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,13 @@ func resourceSiteRecoveryReplicatedVM() *pluginsdk.Resource {
}, true),
DiffSuppressFunc: suppress.CaseDifference,
},
"target_disk_encryption_set_id": {
Type: pluginsdk.TypeString,
Optional: true,
ForceNew: true,
ValidateFunc: azure.ValidateResourceID,
DiffSuppressFunc: suppress.CaseDifference,
},
},
},
},
Expand Down Expand Up @@ -253,13 +260,15 @@ func resourceSiteRecoveryReplicatedItemCreate(d *pluginsdk.ResourceData, meta in
recoveryResourceGroupId := diskInput["target_resource_group_id"].(string)
targetReplicaDiskType := diskInput["target_replica_disk_type"].(string)
targetDiskType := diskInput["target_disk_type"].(string)
targetEncryptionDiskSetID := diskInput["target_disk_encryption_set_id"].(string)

managedDisks = append(managedDisks, siterecovery.A2AVMManagedDiskInputDetails{
DiskID: &diskId,
PrimaryStagingAzureStorageAccountID: &primaryStagingAzureStorageAccountID,
RecoveryResourceGroupID: &recoveryResourceGroupId,
RecoveryReplicaDiskAccountType: &targetReplicaDiskType,
RecoveryTargetDiskAccountType: &targetDiskType,
RecoveryDiskEncryptionSetID: &targetEncryptionDiskSetID,
})
}

Expand Down Expand Up @@ -453,6 +462,7 @@ func resourceSiteRecoveryReplicatedItemRead(d *pluginsdk.ResourceData, meta inte
diskOutput["target_resource_group_id"] = *disk.RecoveryResourceGroupID
diskOutput["target_replica_disk_type"] = *disk.RecoveryReplicaDiskAccountType
diskOutput["target_disk_type"] = *disk.RecoveryTargetDiskAccountType
diskOutput["target_disk_encryption_set_id"] = *disk.RecoveryDiskEncryptionSetID

disksOutput = append(disksOutput, diskOutput)
}
Expand Down
Loading

0 comments on commit 592e127

Please sign in to comment.