ReplicationRecoveryPlanArgs

data class ReplicationRecoveryPlanArgs(val azureToAzureSettings: Output<ReplicationRecoveryPlanAzureToAzureSettingsArgs>? = null, val bootRecoveryGroups: Output<List<ReplicationRecoveryPlanBootRecoveryGroupArgs>>? = null, val failoverRecoveryGroup: Output<ReplicationRecoveryPlanFailoverRecoveryGroupArgs>? = null, val name: Output<String>? = null, val recoveryGroups: Output<List<ReplicationRecoveryPlanRecoveryGroupArgs>>? = null, val recoveryVaultId: Output<String>? = null, val shutdownRecoveryGroup: Output<ReplicationRecoveryPlanShutdownRecoveryGroupArgs>? = null, val sourceRecoveryFabricId: Output<String>? = null, val targetRecoveryFabricId: Output<String>? = null) : ConvertibleToJava<ReplicationRecoveryPlanArgs>

Manages a Site Recovery Replication Recovery Plan within a Recovery Services vault. A recovery plan gathers machines into recovery groups for the purpose of failover.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.network.Subnet;
import com.pulumi.azure.network.SubnetArgs;
import com.pulumi.azure.network.PublicIp;
import com.pulumi.azure.network.PublicIpArgs;
import com.pulumi.azure.network.NetworkInterface;
import com.pulumi.azure.network.NetworkInterfaceArgs;
import com.pulumi.azure.network.inputs.NetworkInterfaceIpConfigurationArgs;
import com.pulumi.azure.compute.VirtualMachine;
import com.pulumi.azure.compute.VirtualMachineArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageImageReferenceArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineStorageOsDiskArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileArgs;
import com.pulumi.azure.compute.inputs.VirtualMachineOsProfileLinuxConfigArgs;
import com.pulumi.azure.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.siterecovery.Fabric;
import com.pulumi.azure.siterecovery.FabricArgs;
import com.pulumi.azure.siterecovery.ProtectionContainer;
import com.pulumi.azure.siterecovery.ProtectionContainerArgs;
import com.pulumi.azure.siterecovery.ReplicationPolicy;
import com.pulumi.azure.siterecovery.ReplicationPolicyArgs;
import com.pulumi.azure.siterecovery.ProtectionContainerMapping;
import com.pulumi.azure.siterecovery.ProtectionContainerMappingArgs;
import com.pulumi.azure.siterecovery.NetworkMapping;
import com.pulumi.azure.siterecovery.NetworkMappingArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.siterecovery.ReplicatedVM;
import com.pulumi.azure.siterecovery.ReplicatedVMArgs;
import com.pulumi.azure.siterecovery.inputs.ReplicatedVMManagedDiskArgs;
import com.pulumi.azure.siterecovery.inputs.ReplicatedVMNetworkInterfaceArgs;
import com.pulumi.azure.siterecovery.ReplicationRecoveryPlan;
import com.pulumi.azure.siterecovery.ReplicationRecoveryPlanArgs;
import com.pulumi.azure.siterecovery.inputs.ReplicationRecoveryPlanShutdownRecoveryGroupArgs;
import com.pulumi.azure.siterecovery.inputs.ReplicationRecoveryPlanFailoverRecoveryGroupArgs;
import com.pulumi.azure.siterecovery.inputs.ReplicationRecoveryPlanBootRecoveryGroupArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primaryResourceGroup = new ResourceGroup("primaryResourceGroup", ResourceGroupArgs.builder()
.location("West US")
.build());
var secondaryResourceGroup = new ResourceGroup("secondaryResourceGroup", ResourceGroupArgs.builder()
.location("East US")
.build());
var primaryVirtualNetwork = new VirtualNetwork("primaryVirtualNetwork", VirtualNetworkArgs.builder()
.resourceGroupName(primaryResourceGroup.name())
.addressSpaces("192.168.1.0/24")
.location(primaryResourceGroup.location())
.build());
var primarySubnet = new Subnet("primarySubnet", SubnetArgs.builder()
.resourceGroupName(primaryResourceGroup.name())
.virtualNetworkName(primaryVirtualNetwork.name())
.addressPrefixes("192.168.1.0/24")
.build());
var primaryPublicIp = new PublicIp("primaryPublicIp", PublicIpArgs.builder()
.allocationMethod("Static")
.location(primaryResourceGroup.location())
.resourceGroupName(primaryResourceGroup.name())
.sku("Basic")
.build());
var vmNetworkInterface = new NetworkInterface("vmNetworkInterface", NetworkInterfaceArgs.builder()
.location(primaryResourceGroup.location())
.resourceGroupName(primaryResourceGroup.name())
.ipConfigurations(NetworkInterfaceIpConfigurationArgs.builder()
.name("vm")
.subnetId(primarySubnet.id())
.privateIpAddressAllocation("Dynamic")
.publicIpAddressId(primaryPublicIp.id())
.build())
.build());
var vmVirtualMachine = new VirtualMachine("vmVirtualMachine", VirtualMachineArgs.builder()
.location(primaryResourceGroup.location())
.resourceGroupName(primaryResourceGroup.name())
.vmSize("Standard_B1s")
.networkInterfaceIds(vmNetworkInterface.id())
.storageImageReference(VirtualMachineStorageImageReferenceArgs.builder()
.publisher("OpenLogic")
.offer("CentOS")
.sku("7.5")
.version("latest")
.build())
.storageOsDisk(VirtualMachineStorageOsDiskArgs.builder()
.name("vm-os-disk")
.osType("Linux")
.caching("ReadWrite")
.createOption("FromImage")
.managedDiskType("Premium_LRS")
.build())
.osProfile(VirtualMachineOsProfileArgs.builder()
.adminUsername("test-admin-123")
.adminPassword("test-pwd-123")
.computerName("vm")
.build())
.osProfileLinuxConfig(VirtualMachineOsProfileLinuxConfigArgs.builder()
.disablePasswordAuthentication(false)
.build())
.build());
var vault = new Vault("vault", VaultArgs.builder()
.location(secondaryResourceGroup.location())
.resourceGroupName(secondaryResourceGroup.name())
.sku("Standard")
.build());
var primaryFabric = new Fabric("primaryFabric", FabricArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.location(primaryResourceGroup.location())
.build());
var secondaryFabric = new Fabric("secondaryFabric", FabricArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.location(secondaryResourceGroup.location())
.build());
var primaryProtectionContainer = new ProtectionContainer("primaryProtectionContainer", ProtectionContainerArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.recoveryFabricName(primaryFabric.name())
.build());
var secondaryProtectionContainer = new ProtectionContainer("secondaryProtectionContainer", ProtectionContainerArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.recoveryFabricName(secondaryFabric.name())
.build());
var policy = new ReplicationPolicy("policy", ReplicationPolicyArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.recoveryPointRetentionInMinutes(24 * 60)
.applicationConsistentSnapshotFrequencyInMinutes(4 * 60)
.build());
var container_mapping = new ProtectionContainerMapping("container-mapping", ProtectionContainerMappingArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.recoveryFabricName(primaryFabric.name())
.recoverySourceProtectionContainerName(primaryProtectionContainer.name())
.recoveryTargetProtectionContainerId(secondaryProtectionContainer.id())
.recoveryReplicationPolicyId(policy.id())
.build());
var secondaryVirtualNetwork = new VirtualNetwork("secondaryVirtualNetwork", VirtualNetworkArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.addressSpaces("192.168.2.0/24")
.location(secondaryResourceGroup.location())
.build());
var network_mapping = new NetworkMapping("network-mapping", NetworkMappingArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.sourceRecoveryFabricName(primaryFabric.name())
.targetRecoveryFabricName(secondaryFabric.name())
.sourceNetworkId(primaryVirtualNetwork.id())
.targetNetworkId(secondaryVirtualNetwork.id())
.build());
var primaryAccount = new Account("primaryAccount", AccountArgs.builder()
.location(primaryResourceGroup.location())
.resourceGroupName(primaryResourceGroup.name())
.accountTier("Standard")
.accountReplicationType("LRS")
.build());
var secondarySubnet = new Subnet("secondarySubnet", SubnetArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.virtualNetworkName(secondaryVirtualNetwork.name())
.addressPrefixes("192.168.2.0/24")
.build());
var secondaryPublicIp = new PublicIp("secondaryPublicIp", PublicIpArgs.builder()
.allocationMethod("Static")
.location(secondaryResourceGroup.location())
.resourceGroupName(secondaryResourceGroup.name())
.sku("Basic")
.build());
var vm_replication = new ReplicatedVM("vm-replication", ReplicatedVMArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.sourceRecoveryFabricName(primaryFabric.name())
.sourceVmId(vmVirtualMachine.id())
.recoveryReplicationPolicyId(policy.id())
.sourceRecoveryProtectionContainerName(primaryProtectionContainer.name())
.targetResourceGroupId(secondaryResourceGroup.id())
.targetRecoveryFabricId(secondaryFabric.id())
.targetRecoveryProtectionContainerId(secondaryProtectionContainer.id())
.managedDisks(ReplicatedVMManagedDiskArgs.builder()
.diskId(vmVirtualMachine.storageOsDisk().applyValue(storageOsDisk -> storageOsDisk.managedDiskId()))
.stagingStorageAccountId(primaryAccount.id())
.targetResourceGroupId(secondaryResourceGroup.id())
.targetDiskType("Premium_LRS")
.targetReplicaDiskType("Premium_LRS")
.build())
.networkInterfaces(ReplicatedVMNetworkInterfaceArgs.builder()
.sourceNetworkInterfaceId(vmNetworkInterface.id())
.targetSubnetName(secondarySubnet.name())
.recoveryPublicIpAddressId(secondaryPublicIp.id())
.build())
.build(), CustomResourceOptions.builder()
.dependsOn(
container_mapping,
network_mapping)
.build());
var example = new ReplicationRecoveryPlan("example", ReplicationRecoveryPlanArgs.builder()
.recoveryVaultId(vault.id())
.sourceRecoveryFabricId(primaryFabric.id())
.targetRecoveryFabricId(secondaryFabric.id())
.shutdownRecoveryGroup()
.failoverRecoveryGroup()
.bootRecoveryGroups(ReplicationRecoveryPlanBootRecoveryGroupArgs.builder()
.replicatedProtectedItems(vm_replication.id())
.build())
.build());
}
}

Import

Site Recovery Fabric can be imported using the resource id, e.g.

$ pulumi import azure:siterecovery/replicationRecoveryPlan:ReplicationRecoveryPlan azurerm_site_recovery_replication_recovery_plan.example /subscriptions/00000000-0000-0000-0000-00000000000/resourceGroups/groupName/providers/Microsoft.RecoveryServices/vaults/vaultName/replicationRecoveryPlans/planName

Constructors

Link copied to clipboard
fun ReplicationRecoveryPlanArgs(azureToAzureSettings: Output<ReplicationRecoveryPlanAzureToAzureSettingsArgs>? = null, bootRecoveryGroups: Output<List<ReplicationRecoveryPlanBootRecoveryGroupArgs>>? = null, failoverRecoveryGroup: Output<ReplicationRecoveryPlanFailoverRecoveryGroupArgs>? = null, name: Output<String>? = null, recoveryGroups: Output<List<ReplicationRecoveryPlanRecoveryGroupArgs>>? = null, recoveryVaultId: Output<String>? = null, shutdownRecoveryGroup: Output<ReplicationRecoveryPlanShutdownRecoveryGroupArgs>? = null, sourceRecoveryFabricId: Output<String>? = null, targetRecoveryFabricId: Output<String>? = null)

Functions

Link copied to clipboard
open override fun toJava(): ReplicationRecoveryPlanArgs

Properties

Link copied to clipboard

An azure_to_azure_settings block defined as block.

Link copied to clipboard

One or more boot_recovery_group blocks as defined below.

Link copied to clipboard

One failover_recovery_group block as defined below.

Link copied to clipboard
val name: Output<String>? = null

The name of the Replication Plan. The name can contain only letters, numbers, and hyphens. It should start with a letter and end with a letter or a number. Can be a maximum of 63 characters. Changing this forces a new resource to be created.

Link copied to clipboard

Three or more recovery_group block defined as below. Note: The recovery_group block is deprecated in favor of shutdown_recovery_group, failover_recovery_group and boot_recovery_group. It will be removed in v4.0 of the Azure Provider.

Link copied to clipboard
val recoveryVaultId: Output<String>? = null

The ID of the vault that should be updated. Changing this forces a new resource to be created.

Link copied to clipboard

One shutdown_recovery_group block as defined below.

Link copied to clipboard
val sourceRecoveryFabricId: Output<String>? = null

ID of source fabric to be recovered from. Changing this forces a new Replication Plan to be created.

Link copied to clipboard
val targetRecoveryFabricId: Output<String>? = null

ID of target fabric to recover. Changing this forces a new Replication Plan to be created.