1. Packages
  2. Azure Classic
  3. API Docs
  4. siterecovery
  5. ReplicatedVM

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages a VM replicated using Azure Site Recovery (Azure to Azure only). A replicated VM keeps a copiously updated image of the VM in another region in order to be able to start the VM in that region in case of a disaster.

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var primaryResourceGroup = new Azure.Core.ResourceGroup("primaryResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "West US",
            });
            var secondaryResourceGroup = new Azure.Core.ResourceGroup("secondaryResourceGroup", new Azure.Core.ResourceGroupArgs
            {
                Location = "East US",
            });
            var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new Azure.Network.VirtualNetworkArgs
            {
                ResourceGroupName = primaryResourceGroup.Name,
                AddressSpaces = 
                {
                    "192.168.1.0/24",
                },
                Location = primaryResourceGroup.Location,
            });
            var primarySubnet = new Azure.Network.Subnet("primarySubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = primaryResourceGroup.Name,
                VirtualNetworkName = primaryVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "192.168.1.0/24",
                },
            });
            var primaryPublicIp = new Azure.Network.PublicIp("primaryPublicIp", new Azure.Network.PublicIpArgs
            {
                AllocationMethod = "Static",
                Location = primaryResourceGroup.Location,
                ResourceGroupName = primaryResourceGroup.Name,
                Sku = "Basic",
            });
            var vmNetworkInterface = new Azure.Network.NetworkInterface("vmNetworkInterface", new Azure.Network.NetworkInterfaceArgs
            {
                Location = primaryResourceGroup.Location,
                ResourceGroupName = primaryResourceGroup.Name,
                IpConfigurations = 
                {
                    new Azure.Network.Inputs.NetworkInterfaceIpConfigurationArgs
                    {
                        Name = "vm",
                        SubnetId = primarySubnet.Id,
                        PrivateIpAddressAllocation = "Dynamic",
                        PublicIpAddressId = primaryPublicIp.Id,
                    },
                },
            });
            var vmVirtualMachine = new Azure.Compute.VirtualMachine("vmVirtualMachine", new Azure.Compute.VirtualMachineArgs
            {
                Location = primaryResourceGroup.Location,
                ResourceGroupName = primaryResourceGroup.Name,
                VmSize = "Standard_B1s",
                NetworkInterfaceIds = 
                {
                    vmNetworkInterface.Id,
                },
                StorageImageReference = new Azure.Compute.Inputs.VirtualMachineStorageImageReferenceArgs
                {
                    Publisher = "OpenLogic",
                    Offer = "CentOS",
                    Sku = "7.5",
                    Version = "latest",
                },
                StorageOsDisk = new Azure.Compute.Inputs.VirtualMachineStorageOsDiskArgs
                {
                    Name = "vm-os-disk",
                    OsType = "Linux",
                    Caching = "ReadWrite",
                    CreateOption = "FromImage",
                    ManagedDiskType = "Premium_LRS",
                },
                OsProfile = new Azure.Compute.Inputs.VirtualMachineOsProfileArgs
                {
                    AdminUsername = "test-admin-123",
                    AdminPassword = "test-pwd-123",
                    ComputerName = "vm",
                },
                OsProfileLinuxConfig = new Azure.Compute.Inputs.VirtualMachineOsProfileLinuxConfigArgs
                {
                    DisablePasswordAuthentication = false,
                },
            });
            var vault = new Azure.RecoveryServices.Vault("vault", new Azure.RecoveryServices.VaultArgs
            {
                Location = secondaryResourceGroup.Location,
                ResourceGroupName = secondaryResourceGroup.Name,
                Sku = "Standard",
            });
            var primaryFabric = new Azure.SiteRecovery.Fabric("primaryFabric", new Azure.SiteRecovery.FabricArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                Location = primaryResourceGroup.Location,
            });
            var secondaryFabric = new Azure.SiteRecovery.Fabric("secondaryFabric", new Azure.SiteRecovery.FabricArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                Location = secondaryResourceGroup.Location,
            });
            var primaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("primaryProtectionContainer", new Azure.SiteRecovery.ProtectionContainerArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                RecoveryFabricName = primaryFabric.Name,
            });
            var secondaryProtectionContainer = new Azure.SiteRecovery.ProtectionContainer("secondaryProtectionContainer", new Azure.SiteRecovery.ProtectionContainerArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                RecoveryFabricName = secondaryFabric.Name,
            });
            var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new Azure.SiteRecovery.ReplicationPolicyArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                RecoveryPointRetentionInMinutes = 24 * 60,
                ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60,
            });
            var container_mapping = new Azure.SiteRecovery.ProtectionContainerMapping("container-mapping", new Azure.SiteRecovery.ProtectionContainerMappingArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                RecoveryFabricName = primaryFabric.Name,
                RecoverySourceProtectionContainerName = primaryProtectionContainer.Name,
                RecoveryTargetProtectionContainerId = secondaryProtectionContainer.Id,
                RecoveryReplicationPolicyId = policy.Id,
            });
            var secondaryVirtualNetwork = new Azure.Network.VirtualNetwork("secondaryVirtualNetwork", new Azure.Network.VirtualNetworkArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                AddressSpaces = 
                {
                    "192.168.2.0/24",
                },
                Location = secondaryResourceGroup.Location,
            });
            var network_mapping = new Azure.SiteRecovery.NetworkMapping("network-mapping", new Azure.SiteRecovery.NetworkMappingArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                RecoveryVaultName = vault.Name,
                SourceRecoveryFabricName = primaryFabric.Name,
                TargetRecoveryFabricName = secondaryFabric.Name,
                SourceNetworkId = primaryVirtualNetwork.Id,
                TargetNetworkId = secondaryVirtualNetwork.Id,
            });
            var primaryAccount = new Azure.Storage.Account("primaryAccount", new Azure.Storage.AccountArgs
            {
                Location = primaryResourceGroup.Location,
                ResourceGroupName = primaryResourceGroup.Name,
                AccountTier = "Standard",
                AccountReplicationType = "LRS",
            });
            var secondarySubnet = new Azure.Network.Subnet("secondarySubnet", new Azure.Network.SubnetArgs
            {
                ResourceGroupName = secondaryResourceGroup.Name,
                VirtualNetworkName = secondaryVirtualNetwork.Name,
                AddressPrefixes = 
                {
                    "192.168.2.0/24",
                },
            });
            var secondaryPublicIp = new Azure.Network.PublicIp("secondaryPublicIp", new Azure.Network.PublicIpArgs
            {
                AllocationMethod = "Static",
                Location = secondaryResourceGroup.Location,
                ResourceGroupName = secondaryResourceGroup.Name,
                Sku = "Basic",
            });
            var vm_replication = new Azure.SiteRecovery.ReplicatedVM("vm-replication", new Azure.SiteRecovery.ReplicatedVMArgs
            {
                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 = 
                {
                    new Azure.SiteRecovery.Inputs.ReplicatedVMManagedDiskArgs
                    {
                        DiskId = vmVirtualMachine.StorageOsDisk.Apply(storageOsDisk => storageOsDisk.ManagedDiskId),
                        StagingStorageAccountId = primaryAccount.Id,
                        TargetResourceGroupId = secondaryResourceGroup.Id,
                        TargetDiskType = "Premium_LRS",
                        TargetReplicaDiskType = "Premium_LRS",
                    },
                },
                NetworkInterfaces = 
                {
                    new Azure.SiteRecovery.Inputs.ReplicatedVMNetworkInterfaceArgs
                    {
                        SourceNetworkInterfaceId = vmNetworkInterface.Id,
                        TargetSubnetName = secondarySubnet.Name,
                        RecoveryPublicIpAddressId = secondaryPublicIp.Id,
                    },
                },
            }, new CustomResourceOptions
            {
                DependsOn = 
                {
                    container_mapping,
                    network_mapping,
                },
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/compute"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/recoveryservices"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/siterecovery"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		primaryResourceGroup, err := core.NewResourceGroup(ctx, "primaryResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("West US"),
    		})
    		if err != nil {
    			return err
    		}
    		secondaryResourceGroup, err := core.NewResourceGroup(ctx, "secondaryResourceGroup", &core.ResourceGroupArgs{
    			Location: pulumi.String("East US"),
    		})
    		if err != nil {
    			return err
    		}
    		primaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "primaryVirtualNetwork", &network.VirtualNetworkArgs{
    			ResourceGroupName: primaryResourceGroup.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("192.168.1.0/24"),
    			},
    			Location: primaryResourceGroup.Location,
    		})
    		if err != nil {
    			return err
    		}
    		primarySubnet, err := network.NewSubnet(ctx, "primarySubnet", &network.SubnetArgs{
    			ResourceGroupName:  primaryResourceGroup.Name,
    			VirtualNetworkName: primaryVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("192.168.1.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		primaryPublicIp, err := network.NewPublicIp(ctx, "primaryPublicIp", &network.PublicIpArgs{
    			AllocationMethod:  pulumi.String("Static"),
    			Location:          primaryResourceGroup.Location,
    			ResourceGroupName: primaryResourceGroup.Name,
    			Sku:               pulumi.String("Basic"),
    		})
    		if err != nil {
    			return err
    		}
    		vmNetworkInterface, err := network.NewNetworkInterface(ctx, "vmNetworkInterface", &network.NetworkInterfaceArgs{
    			Location:          primaryResourceGroup.Location,
    			ResourceGroupName: primaryResourceGroup.Name,
    			IpConfigurations: network.NetworkInterfaceIpConfigurationArray{
    				&network.NetworkInterfaceIpConfigurationArgs{
    					Name:                       pulumi.String("vm"),
    					SubnetId:                   primarySubnet.ID(),
    					PrivateIpAddressAllocation: pulumi.String("Dynamic"),
    					PublicIpAddressId:          primaryPublicIp.ID(),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		vmVirtualMachine, err := compute.NewVirtualMachine(ctx, "vmVirtualMachine", &compute.VirtualMachineArgs{
    			Location:          primaryResourceGroup.Location,
    			ResourceGroupName: primaryResourceGroup.Name,
    			VmSize:            pulumi.String("Standard_B1s"),
    			NetworkInterfaceIds: pulumi.StringArray{
    				vmNetworkInterface.ID(),
    			},
    			StorageImageReference: &compute.VirtualMachineStorageImageReferenceArgs{
    				Publisher: pulumi.String("OpenLogic"),
    				Offer:     pulumi.String("CentOS"),
    				Sku:       pulumi.String("7.5"),
    				Version:   pulumi.String("latest"),
    			},
    			StorageOsDisk: &compute.VirtualMachineStorageOsDiskArgs{
    				Name:            pulumi.String("vm-os-disk"),
    				OsType:          pulumi.String("Linux"),
    				Caching:         pulumi.String("ReadWrite"),
    				CreateOption:    pulumi.String("FromImage"),
    				ManagedDiskType: pulumi.String("Premium_LRS"),
    			},
    			OsProfile: &compute.VirtualMachineOsProfileArgs{
    				AdminUsername: pulumi.String("test-admin-123"),
    				AdminPassword: pulumi.String("test-pwd-123"),
    				ComputerName:  pulumi.String("vm"),
    			},
    			OsProfileLinuxConfig: &compute.VirtualMachineOsProfileLinuxConfigArgs{
    				DisablePasswordAuthentication: pulumi.Bool(false),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
    			Location:          secondaryResourceGroup.Location,
    			ResourceGroupName: secondaryResourceGroup.Name,
    			Sku:               pulumi.String("Standard"),
    		})
    		if err != nil {
    			return err
    		}
    		primaryFabric, err := siterecovery.NewFabric(ctx, "primaryFabric", &siterecovery.FabricArgs{
    			ResourceGroupName: secondaryResourceGroup.Name,
    			RecoveryVaultName: vault.Name,
    			Location:          primaryResourceGroup.Location,
    		})
    		if err != nil {
    			return err
    		}
    		secondaryFabric, err := siterecovery.NewFabric(ctx, "secondaryFabric", &siterecovery.FabricArgs{
    			ResourceGroupName: secondaryResourceGroup.Name,
    			RecoveryVaultName: vault.Name,
    			Location:          secondaryResourceGroup.Location,
    		})
    		if err != nil {
    			return err
    		}
    		primaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "primaryProtectionContainer", &siterecovery.ProtectionContainerArgs{
    			ResourceGroupName:  secondaryResourceGroup.Name,
    			RecoveryVaultName:  vault.Name,
    			RecoveryFabricName: primaryFabric.Name,
    		})
    		if err != nil {
    			return err
    		}
    		secondaryProtectionContainer, err := siterecovery.NewProtectionContainer(ctx, "secondaryProtectionContainer", &siterecovery.ProtectionContainerArgs{
    			ResourceGroupName:  secondaryResourceGroup.Name,
    			RecoveryVaultName:  vault.Name,
    			RecoveryFabricName: secondaryFabric.Name,
    		})
    		if err != nil {
    			return err
    		}
    		policy, err := siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{
    			ResourceGroupName:                               secondaryResourceGroup.Name,
    			RecoveryVaultName:                               vault.Name,
    			RecoveryPointRetentionInMinutes:                 24 * 60,
    			ApplicationConsistentSnapshotFrequencyInMinutes: 4 * 60,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = siterecovery.NewProtectionContainerMapping(ctx, "container-mapping", &siterecovery.ProtectionContainerMappingArgs{
    			ResourceGroupName:                     secondaryResourceGroup.Name,
    			RecoveryVaultName:                     vault.Name,
    			RecoveryFabricName:                    primaryFabric.Name,
    			RecoverySourceProtectionContainerName: primaryProtectionContainer.Name,
    			RecoveryTargetProtectionContainerId:   secondaryProtectionContainer.ID(),
    			RecoveryReplicationPolicyId:           policy.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		secondaryVirtualNetwork, err := network.NewVirtualNetwork(ctx, "secondaryVirtualNetwork", &network.VirtualNetworkArgs{
    			ResourceGroupName: secondaryResourceGroup.Name,
    			AddressSpaces: pulumi.StringArray{
    				pulumi.String("192.168.2.0/24"),
    			},
    			Location: secondaryResourceGroup.Location,
    		})
    		if err != nil {
    			return err
    		}
    		_, err = siterecovery.NewNetworkMapping(ctx, "network-mapping", &siterecovery.NetworkMappingArgs{
    			ResourceGroupName:        secondaryResourceGroup.Name,
    			RecoveryVaultName:        vault.Name,
    			SourceRecoveryFabricName: primaryFabric.Name,
    			TargetRecoveryFabricName: secondaryFabric.Name,
    			SourceNetworkId:          primaryVirtualNetwork.ID(),
    			TargetNetworkId:          secondaryVirtualNetwork.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		primaryAccount, err := storage.NewAccount(ctx, "primaryAccount", &storage.AccountArgs{
    			Location:               primaryResourceGroup.Location,
    			ResourceGroupName:      primaryResourceGroup.Name,
    			AccountTier:            pulumi.String("Standard"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		secondarySubnet, err := network.NewSubnet(ctx, "secondarySubnet", &network.SubnetArgs{
    			ResourceGroupName:  secondaryResourceGroup.Name,
    			VirtualNetworkName: secondaryVirtualNetwork.Name,
    			AddressPrefixes: pulumi.StringArray{
    				pulumi.String("192.168.2.0/24"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		secondaryPublicIp, err := network.NewPublicIp(ctx, "secondaryPublicIp", &network.PublicIpArgs{
    			AllocationMethod:  pulumi.String("Static"),
    			Location:          secondaryResourceGroup.Location,
    			ResourceGroupName: secondaryResourceGroup.Name,
    			Sku:               pulumi.String("Basic"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = siterecovery.NewReplicatedVM(ctx, "vm-replication", &siterecovery.ReplicatedVMArgs{
    			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: siterecovery.ReplicatedVMManagedDiskArray{
    				&siterecovery.ReplicatedVMManagedDiskArgs{
    					DiskId: vmVirtualMachine.StorageOsDisk.ApplyT(func(storageOsDisk compute.VirtualMachineStorageOsDisk) (string, error) {
    						return storageOsDisk.ManagedDiskId, nil
    					}).(pulumi.StringOutput),
    					StagingStorageAccountId: primaryAccount.ID(),
    					TargetResourceGroupId:   secondaryResourceGroup.ID(),
    					TargetDiskType:          pulumi.String("Premium_LRS"),
    					TargetReplicaDiskType:   pulumi.String("Premium_LRS"),
    				},
    			},
    			NetworkInterfaces: siterecovery.ReplicatedVMNetworkInterfaceArray{
    				&siterecovery.ReplicatedVMNetworkInterfaceArgs{
    					SourceNetworkInterfaceId:  vmNetworkInterface.ID(),
    					TargetSubnetName:          secondarySubnet.Name,
    					RecoveryPublicIpAddressId: secondaryPublicIp.ID(),
    				},
    			},
    		}, pulumi.DependsOn([]pulumi.Resource{
    			container_mapping,
    			network_mapping,
    		}))
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const primaryResourceGroup = new azure.core.ResourceGroup("primaryResourceGroup", {location: "West US"});
    const secondaryResourceGroup = new azure.core.ResourceGroup("secondaryResourceGroup", {location: "East US"});
    const primaryVirtualNetwork = new azure.network.VirtualNetwork("primaryVirtualNetwork", {
        resourceGroupName: primaryResourceGroup.name,
        addressSpaces: ["192.168.1.0/24"],
        location: primaryResourceGroup.location,
    });
    const primarySubnet = new azure.network.Subnet("primarySubnet", {
        resourceGroupName: primaryResourceGroup.name,
        virtualNetworkName: primaryVirtualNetwork.name,
        addressPrefixes: ["192.168.1.0/24"],
    });
    const primaryPublicIp = new azure.network.PublicIp("primaryPublicIp", {
        allocationMethod: "Static",
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        sku: "Basic",
    });
    const vmNetworkInterface = new azure.network.NetworkInterface("vmNetworkInterface", {
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        ipConfigurations: [{
            name: "vm",
            subnetId: primarySubnet.id,
            privateIpAddressAllocation: "Dynamic",
            publicIpAddressId: primaryPublicIp.id,
        }],
    });
    const vmVirtualMachine = new azure.compute.VirtualMachine("vmVirtualMachine", {
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        vmSize: "Standard_B1s",
        networkInterfaceIds: [vmNetworkInterface.id],
        storageImageReference: {
            publisher: "OpenLogic",
            offer: "CentOS",
            sku: "7.5",
            version: "latest",
        },
        storageOsDisk: {
            name: "vm-os-disk",
            osType: "Linux",
            caching: "ReadWrite",
            createOption: "FromImage",
            managedDiskType: "Premium_LRS",
        },
        osProfile: {
            adminUsername: "test-admin-123",
            adminPassword: "test-pwd-123",
            computerName: "vm",
        },
        osProfileLinuxConfig: {
            disablePasswordAuthentication: false,
        },
    });
    const vault = new azure.recoveryservices.Vault("vault", {
        location: secondaryResourceGroup.location,
        resourceGroupName: secondaryResourceGroup.name,
        sku: "Standard",
    });
    const primaryFabric = new azure.siterecovery.Fabric("primaryFabric", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        location: primaryResourceGroup.location,
    });
    const secondaryFabric = new azure.siterecovery.Fabric("secondaryFabric", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        location: secondaryResourceGroup.location,
    });
    const primaryProtectionContainer = new azure.siterecovery.ProtectionContainer("primaryProtectionContainer", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        recoveryFabricName: primaryFabric.name,
    });
    const secondaryProtectionContainer = new azure.siterecovery.ProtectionContainer("secondaryProtectionContainer", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        recoveryFabricName: secondaryFabric.name,
    });
    const policy = new azure.siterecovery.ReplicationPolicy("policy", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        recoveryPointRetentionInMinutes: 24 * 60,
        applicationConsistentSnapshotFrequencyInMinutes: 4 * 60,
    });
    const container_mapping = new azure.siterecovery.ProtectionContainerMapping("container-mapping", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        recoveryFabricName: primaryFabric.name,
        recoverySourceProtectionContainerName: primaryProtectionContainer.name,
        recoveryTargetProtectionContainerId: secondaryProtectionContainer.id,
        recoveryReplicationPolicyId: policy.id,
    });
    const secondaryVirtualNetwork = new azure.network.VirtualNetwork("secondaryVirtualNetwork", {
        resourceGroupName: secondaryResourceGroup.name,
        addressSpaces: ["192.168.2.0/24"],
        location: secondaryResourceGroup.location,
    });
    const network_mapping = new azure.siterecovery.NetworkMapping("network-mapping", {
        resourceGroupName: secondaryResourceGroup.name,
        recoveryVaultName: vault.name,
        sourceRecoveryFabricName: primaryFabric.name,
        targetRecoveryFabricName: secondaryFabric.name,
        sourceNetworkId: primaryVirtualNetwork.id,
        targetNetworkId: secondaryVirtualNetwork.id,
    });
    const primaryAccount = new azure.storage.Account("primaryAccount", {
        location: primaryResourceGroup.location,
        resourceGroupName: primaryResourceGroup.name,
        accountTier: "Standard",
        accountReplicationType: "LRS",
    });
    const secondarySubnet = new azure.network.Subnet("secondarySubnet", {
        resourceGroupName: secondaryResourceGroup.name,
        virtualNetworkName: secondaryVirtualNetwork.name,
        addressPrefixes: ["192.168.2.0/24"],
    });
    const secondaryPublicIp = new azure.network.PublicIp("secondaryPublicIp", {
        allocationMethod: "Static",
        location: secondaryResourceGroup.location,
        resourceGroupName: secondaryResourceGroup.name,
        sku: "Basic",
    });
    const vm_replication = new azure.siterecovery.ReplicatedVM("vm-replication", {
        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: [{
            diskId: vmVirtualMachine.storageOsDisk.apply(storageOsDisk => storageOsDisk.managedDiskId),
            stagingStorageAccountId: primaryAccount.id,
            targetResourceGroupId: secondaryResourceGroup.id,
            targetDiskType: "Premium_LRS",
            targetReplicaDiskType: "Premium_LRS",
        }],
        networkInterfaces: [{
            sourceNetworkInterfaceId: vmNetworkInterface.id,
            targetSubnetName: secondarySubnet.name,
            recoveryPublicIpAddressId: secondaryPublicIp.id,
        }],
    }, {
        dependsOn: [
            container_mapping,
            network_mapping,
        ],
    });
    
    import pulumi
    import pulumi_azure as azure
    
    primary_resource_group = azure.core.ResourceGroup("primaryResourceGroup", location="West US")
    secondary_resource_group = azure.core.ResourceGroup("secondaryResourceGroup", location="East US")
    primary_virtual_network = azure.network.VirtualNetwork("primaryVirtualNetwork",
        resource_group_name=primary_resource_group.name,
        address_spaces=["192.168.1.0/24"],
        location=primary_resource_group.location)
    primary_subnet = azure.network.Subnet("primarySubnet",
        resource_group_name=primary_resource_group.name,
        virtual_network_name=primary_virtual_network.name,
        address_prefixes=["192.168.1.0/24"])
    primary_public_ip = azure.network.PublicIp("primaryPublicIp",
        allocation_method="Static",
        location=primary_resource_group.location,
        resource_group_name=primary_resource_group.name,
        sku="Basic")
    vm_network_interface = azure.network.NetworkInterface("vmNetworkInterface",
        location=primary_resource_group.location,
        resource_group_name=primary_resource_group.name,
        ip_configurations=[azure.network.NetworkInterfaceIpConfigurationArgs(
            name="vm",
            subnet_id=primary_subnet.id,
            private_ip_address_allocation="Dynamic",
            public_ip_address_id=primary_public_ip.id,
        )])
    vm_virtual_machine = azure.compute.VirtualMachine("vmVirtualMachine",
        location=primary_resource_group.location,
        resource_group_name=primary_resource_group.name,
        vm_size="Standard_B1s",
        network_interface_ids=[vm_network_interface.id],
        storage_image_reference=azure.compute.VirtualMachineStorageImageReferenceArgs(
            publisher="OpenLogic",
            offer="CentOS",
            sku="7.5",
            version="latest",
        ),
        storage_os_disk=azure.compute.VirtualMachineStorageOsDiskArgs(
            name="vm-os-disk",
            os_type="Linux",
            caching="ReadWrite",
            create_option="FromImage",
            managed_disk_type="Premium_LRS",
        ),
        os_profile=azure.compute.VirtualMachineOsProfileArgs(
            admin_username="test-admin-123",
            admin_password="test-pwd-123",
            computer_name="vm",
        ),
        os_profile_linux_config=azure.compute.VirtualMachineOsProfileLinuxConfigArgs(
            disable_password_authentication=False,
        ))
    vault = azure.recoveryservices.Vault("vault",
        location=secondary_resource_group.location,
        resource_group_name=secondary_resource_group.name,
        sku="Standard")
    primary_fabric = azure.siterecovery.Fabric("primaryFabric",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        location=primary_resource_group.location)
    secondary_fabric = azure.siterecovery.Fabric("secondaryFabric",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        location=secondary_resource_group.location)
    primary_protection_container = azure.siterecovery.ProtectionContainer("primaryProtectionContainer",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        recovery_fabric_name=primary_fabric.name)
    secondary_protection_container = azure.siterecovery.ProtectionContainer("secondaryProtectionContainer",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        recovery_fabric_name=secondary_fabric.name)
    policy = azure.siterecovery.ReplicationPolicy("policy",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        recovery_point_retention_in_minutes=24 * 60,
        application_consistent_snapshot_frequency_in_minutes=4 * 60)
    container_mapping = azure.siterecovery.ProtectionContainerMapping("container-mapping",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        recovery_fabric_name=primary_fabric.name,
        recovery_source_protection_container_name=primary_protection_container.name,
        recovery_target_protection_container_id=secondary_protection_container.id,
        recovery_replication_policy_id=policy.id)
    secondary_virtual_network = azure.network.VirtualNetwork("secondaryVirtualNetwork",
        resource_group_name=secondary_resource_group.name,
        address_spaces=["192.168.2.0/24"],
        location=secondary_resource_group.location)
    network_mapping = azure.siterecovery.NetworkMapping("network-mapping",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        source_recovery_fabric_name=primary_fabric.name,
        target_recovery_fabric_name=secondary_fabric.name,
        source_network_id=primary_virtual_network.id,
        target_network_id=secondary_virtual_network.id)
    primary_account = azure.storage.Account("primaryAccount",
        location=primary_resource_group.location,
        resource_group_name=primary_resource_group.name,
        account_tier="Standard",
        account_replication_type="LRS")
    secondary_subnet = azure.network.Subnet("secondarySubnet",
        resource_group_name=secondary_resource_group.name,
        virtual_network_name=secondary_virtual_network.name,
        address_prefixes=["192.168.2.0/24"])
    secondary_public_ip = azure.network.PublicIp("secondaryPublicIp",
        allocation_method="Static",
        location=secondary_resource_group.location,
        resource_group_name=secondary_resource_group.name,
        sku="Basic")
    vm_replication = azure.siterecovery.ReplicatedVM("vm-replication",
        resource_group_name=secondary_resource_group.name,
        recovery_vault_name=vault.name,
        source_recovery_fabric_name=primary_fabric.name,
        source_vm_id=vm_virtual_machine.id,
        recovery_replication_policy_id=policy.id,
        source_recovery_protection_container_name=primary_protection_container.name,
        target_resource_group_id=secondary_resource_group.id,
        target_recovery_fabric_id=secondary_fabric.id,
        target_recovery_protection_container_id=secondary_protection_container.id,
        managed_disks=[azure.siterecovery.ReplicatedVMManagedDiskArgs(
            disk_id=vm_virtual_machine.storage_os_disk.managed_disk_id,
            staging_storage_account_id=primary_account.id,
            target_resource_group_id=secondary_resource_group.id,
            target_disk_type="Premium_LRS",
            target_replica_disk_type="Premium_LRS",
        )],
        network_interfaces=[azure.siterecovery.ReplicatedVMNetworkInterfaceArgs(
            source_network_interface_id=vm_network_interface.id,
            target_subnet_name=secondary_subnet.name,
            recovery_public_ip_address_id=secondary_public_ip.id,
        )],
        opts=pulumi.ResourceOptions(depends_on=[
                container_mapping,
                network_mapping,
            ]))
    

    Example coming soon!

    Create ReplicatedVM Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new ReplicatedVM(name: string, args: ReplicatedVMArgs, opts?: CustomResourceOptions);
    @overload
    def ReplicatedVM(resource_name: str,
                     args: ReplicatedVMArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def ReplicatedVM(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     source_recovery_fabric_name: Optional[str] = None,
                     target_recovery_protection_container_id: Optional[str] = None,
                     target_resource_group_id: Optional[str] = None,
                     recovery_replication_policy_id: Optional[str] = None,
                     recovery_vault_name: Optional[str] = None,
                     resource_group_name: Optional[str] = None,
                     source_vm_id: Optional[str] = None,
                     source_recovery_protection_container_name: Optional[str] = None,
                     target_recovery_fabric_id: Optional[str] = None,
                     target_availability_set_id: Optional[str] = None,
                     target_network_id: Optional[str] = None,
                     name: Optional[str] = None,
                     managed_disks: Optional[Sequence[ReplicatedVMManagedDiskArgs]] = None,
                     network_interfaces: Optional[Sequence[ReplicatedVMNetworkInterfaceArgs]] = None)
    func NewReplicatedVM(ctx *Context, name string, args ReplicatedVMArgs, opts ...ResourceOption) (*ReplicatedVM, error)
    public ReplicatedVM(string name, ReplicatedVMArgs args, CustomResourceOptions? opts = null)
    public ReplicatedVM(String name, ReplicatedVMArgs args)
    public ReplicatedVM(String name, ReplicatedVMArgs args, CustomResourceOptions options)
    
    type: azure:siterecovery:ReplicatedVM
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args ReplicatedVMArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args ReplicatedVMArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args ReplicatedVMArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ReplicatedVMArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ReplicatedVMArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var replicatedVMResource = new Azure.SiteRecovery.ReplicatedVM("replicatedVMResource", new()
    {
        SourceRecoveryFabricName = "string",
        TargetRecoveryProtectionContainerId = "string",
        TargetResourceGroupId = "string",
        RecoveryReplicationPolicyId = "string",
        RecoveryVaultName = "string",
        ResourceGroupName = "string",
        SourceVmId = "string",
        SourceRecoveryProtectionContainerName = "string",
        TargetRecoveryFabricId = "string",
        TargetAvailabilitySetId = "string",
        TargetNetworkId = "string",
        Name = "string",
        ManagedDisks = new[]
        {
            new Azure.SiteRecovery.Inputs.ReplicatedVMManagedDiskArgs
            {
                DiskId = "string",
                StagingStorageAccountId = "string",
                TargetDiskType = "string",
                TargetReplicaDiskType = "string",
                TargetResourceGroupId = "string",
                TargetDiskEncryptionSetId = "string",
            },
        },
        NetworkInterfaces = new[]
        {
            new Azure.SiteRecovery.Inputs.ReplicatedVMNetworkInterfaceArgs
            {
                RecoveryPublicIpAddressId = "string",
                SourceNetworkInterfaceId = "string",
                TargetStaticIp = "string",
                TargetSubnetName = "string",
            },
        },
    });
    
    example, err := siterecovery.NewReplicatedVM(ctx, "replicatedVMResource", &siterecovery.ReplicatedVMArgs{
    	SourceRecoveryFabricName:              pulumi.String("string"),
    	TargetRecoveryProtectionContainerId:   pulumi.String("string"),
    	TargetResourceGroupId:                 pulumi.String("string"),
    	RecoveryReplicationPolicyId:           pulumi.String("string"),
    	RecoveryVaultName:                     pulumi.String("string"),
    	ResourceGroupName:                     pulumi.String("string"),
    	SourceVmId:                            pulumi.String("string"),
    	SourceRecoveryProtectionContainerName: pulumi.String("string"),
    	TargetRecoveryFabricId:                pulumi.String("string"),
    	TargetAvailabilitySetId:               pulumi.String("string"),
    	TargetNetworkId:                       pulumi.String("string"),
    	Name:                                  pulumi.String("string"),
    	ManagedDisks: siterecovery.ReplicatedVMManagedDiskArray{
    		&siterecovery.ReplicatedVMManagedDiskArgs{
    			DiskId:                    pulumi.String("string"),
    			StagingStorageAccountId:   pulumi.String("string"),
    			TargetDiskType:            pulumi.String("string"),
    			TargetReplicaDiskType:     pulumi.String("string"),
    			TargetResourceGroupId:     pulumi.String("string"),
    			TargetDiskEncryptionSetId: pulumi.String("string"),
    		},
    	},
    	NetworkInterfaces: siterecovery.ReplicatedVMNetworkInterfaceArray{
    		&siterecovery.ReplicatedVMNetworkInterfaceArgs{
    			RecoveryPublicIpAddressId: pulumi.String("string"),
    			SourceNetworkInterfaceId:  pulumi.String("string"),
    			TargetStaticIp:            pulumi.String("string"),
    			TargetSubnetName:          pulumi.String("string"),
    		},
    	},
    })
    
    var replicatedVMResource = new ReplicatedVM("replicatedVMResource", ReplicatedVMArgs.builder()
        .sourceRecoveryFabricName("string")
        .targetRecoveryProtectionContainerId("string")
        .targetResourceGroupId("string")
        .recoveryReplicationPolicyId("string")
        .recoveryVaultName("string")
        .resourceGroupName("string")
        .sourceVmId("string")
        .sourceRecoveryProtectionContainerName("string")
        .targetRecoveryFabricId("string")
        .targetAvailabilitySetId("string")
        .targetNetworkId("string")
        .name("string")
        .managedDisks(ReplicatedVMManagedDiskArgs.builder()
            .diskId("string")
            .stagingStorageAccountId("string")
            .targetDiskType("string")
            .targetReplicaDiskType("string")
            .targetResourceGroupId("string")
            .targetDiskEncryptionSetId("string")
            .build())
        .networkInterfaces(ReplicatedVMNetworkInterfaceArgs.builder()
            .recoveryPublicIpAddressId("string")
            .sourceNetworkInterfaceId("string")
            .targetStaticIp("string")
            .targetSubnetName("string")
            .build())
        .build());
    
    replicated_vm_resource = azure.siterecovery.ReplicatedVM("replicatedVMResource",
        source_recovery_fabric_name="string",
        target_recovery_protection_container_id="string",
        target_resource_group_id="string",
        recovery_replication_policy_id="string",
        recovery_vault_name="string",
        resource_group_name="string",
        source_vm_id="string",
        source_recovery_protection_container_name="string",
        target_recovery_fabric_id="string",
        target_availability_set_id="string",
        target_network_id="string",
        name="string",
        managed_disks=[{
            "disk_id": "string",
            "staging_storage_account_id": "string",
            "target_disk_type": "string",
            "target_replica_disk_type": "string",
            "target_resource_group_id": "string",
            "target_disk_encryption_set_id": "string",
        }],
        network_interfaces=[{
            "recovery_public_ip_address_id": "string",
            "source_network_interface_id": "string",
            "target_static_ip": "string",
            "target_subnet_name": "string",
        }])
    
    const replicatedVMResource = new azure.siterecovery.ReplicatedVM("replicatedVMResource", {
        sourceRecoveryFabricName: "string",
        targetRecoveryProtectionContainerId: "string",
        targetResourceGroupId: "string",
        recoveryReplicationPolicyId: "string",
        recoveryVaultName: "string",
        resourceGroupName: "string",
        sourceVmId: "string",
        sourceRecoveryProtectionContainerName: "string",
        targetRecoveryFabricId: "string",
        targetAvailabilitySetId: "string",
        targetNetworkId: "string",
        name: "string",
        managedDisks: [{
            diskId: "string",
            stagingStorageAccountId: "string",
            targetDiskType: "string",
            targetReplicaDiskType: "string",
            targetResourceGroupId: "string",
            targetDiskEncryptionSetId: "string",
        }],
        networkInterfaces: [{
            recoveryPublicIpAddressId: "string",
            sourceNetworkInterfaceId: "string",
            targetStaticIp: "string",
            targetSubnetName: "string",
        }],
    });
    
    type: azure:siterecovery:ReplicatedVM
    properties:
        managedDisks:
            - diskId: string
              stagingStorageAccountId: string
              targetDiskEncryptionSetId: string
              targetDiskType: string
              targetReplicaDiskType: string
              targetResourceGroupId: string
        name: string
        networkInterfaces:
            - recoveryPublicIpAddressId: string
              sourceNetworkInterfaceId: string
              targetStaticIp: string
              targetSubnetName: string
        recoveryReplicationPolicyId: string
        recoveryVaultName: string
        resourceGroupName: string
        sourceRecoveryFabricName: string
        sourceRecoveryProtectionContainerName: string
        sourceVmId: string
        targetAvailabilitySetId: string
        targetNetworkId: string
        targetRecoveryFabricId: string
        targetRecoveryProtectionContainerId: string
        targetResourceGroupId: string
    

    ReplicatedVM Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The ReplicatedVM resource accepts the following input properties:

    RecoveryReplicationPolicyId string
    RecoveryVaultName string
    The name of the vault that should be updated.
    ResourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    SourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    SourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    SourceVmId string
    Id of the VM to replicate
    TargetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    TargetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    TargetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    ManagedDisks List<ReplicatedVMManagedDisk>
    One or more managed_disk block.
    Name string
    The name of the replication for the replicated VM.
    NetworkInterfaces List<ReplicatedVMNetworkInterface>
    One or more network_interface block.
    TargetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    TargetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    RecoveryReplicationPolicyId string
    RecoveryVaultName string
    The name of the vault that should be updated.
    ResourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    SourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    SourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    SourceVmId string
    Id of the VM to replicate
    TargetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    TargetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    TargetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    ManagedDisks []ReplicatedVMManagedDiskArgs
    One or more managed_disk block.
    Name string
    The name of the replication for the replicated VM.
    NetworkInterfaces []ReplicatedVMNetworkInterfaceArgs
    One or more network_interface block.
    TargetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    TargetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    recoveryReplicationPolicyId String
    recoveryVaultName String
    The name of the vault that should be updated.
    resourceGroupName String
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName String
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName String
    Name of the protection container to use.
    sourceVmId String
    Id of the VM to replicate
    targetRecoveryFabricId String
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId String
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId String
    Id of resource group where the VM should be created when a failover is done.
    managedDisks List<ReplicatedVMManagedDisk>
    One or more managed_disk block.
    name String
    The name of the replication for the replicated VM.
    networkInterfaces List<ReplicatedVMNetworkInterface>
    One or more network_interface block.
    targetAvailabilitySetId String
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId String
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    recoveryReplicationPolicyId string
    recoveryVaultName string
    The name of the vault that should be updated.
    resourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    sourceVmId string
    Id of the VM to replicate
    targetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    managedDisks ReplicatedVMManagedDisk[]
    One or more managed_disk block.
    name string
    The name of the replication for the replicated VM.
    networkInterfaces ReplicatedVMNetworkInterface[]
    One or more network_interface block.
    targetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    recovery_replication_policy_id str
    recovery_vault_name str
    The name of the vault that should be updated.
    resource_group_name str
    Name of the resource group where the vault that should be updated is located.
    source_recovery_fabric_name str
    Name of fabric that should contains this replication.
    source_recovery_protection_container_name str
    Name of the protection container to use.
    source_vm_id str
    Id of the VM to replicate
    target_recovery_fabric_id str
    Id of fabric where the VM replication should be handled when a failover is done.
    target_recovery_protection_container_id str
    Id of protection container where the VM replication should be created when a failover is done.
    target_resource_group_id str
    Id of resource group where the VM should be created when a failover is done.
    managed_disks Sequence[ReplicatedVMManagedDiskArgs]
    One or more managed_disk block.
    name str
    The name of the replication for the replicated VM.
    network_interfaces Sequence[ReplicatedVMNetworkInterfaceArgs]
    One or more network_interface block.
    target_availability_set_id str
    Id of availability set that the new VM should belong to when a failover is done.
    target_network_id str
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    recoveryReplicationPolicyId String
    recoveryVaultName String
    The name of the vault that should be updated.
    resourceGroupName String
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName String
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName String
    Name of the protection container to use.
    sourceVmId String
    Id of the VM to replicate
    targetRecoveryFabricId String
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId String
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId String
    Id of resource group where the VM should be created when a failover is done.
    managedDisks List<Property Map>
    One or more managed_disk block.
    name String
    The name of the replication for the replicated VM.
    networkInterfaces List<Property Map>
    One or more network_interface block.
    targetAvailabilitySetId String
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId String
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).

    Outputs

    All input properties are implicitly available as output properties. Additionally, the ReplicatedVM resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ReplicatedVM Resource

    Get an existing ReplicatedVM resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: ReplicatedVMState, opts?: CustomResourceOptions): ReplicatedVM
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            managed_disks: Optional[Sequence[ReplicatedVMManagedDiskArgs]] = None,
            name: Optional[str] = None,
            network_interfaces: Optional[Sequence[ReplicatedVMNetworkInterfaceArgs]] = None,
            recovery_replication_policy_id: Optional[str] = None,
            recovery_vault_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            source_recovery_fabric_name: Optional[str] = None,
            source_recovery_protection_container_name: Optional[str] = None,
            source_vm_id: Optional[str] = None,
            target_availability_set_id: Optional[str] = None,
            target_network_id: Optional[str] = None,
            target_recovery_fabric_id: Optional[str] = None,
            target_recovery_protection_container_id: Optional[str] = None,
            target_resource_group_id: Optional[str] = None) -> ReplicatedVM
    func GetReplicatedVM(ctx *Context, name string, id IDInput, state *ReplicatedVMState, opts ...ResourceOption) (*ReplicatedVM, error)
    public static ReplicatedVM Get(string name, Input<string> id, ReplicatedVMState? state, CustomResourceOptions? opts = null)
    public static ReplicatedVM get(String name, Output<String> id, ReplicatedVMState state, CustomResourceOptions options)
    resources:  _:    type: azure:siterecovery:ReplicatedVM    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ManagedDisks List<ReplicatedVMManagedDisk>
    One or more managed_disk block.
    Name string
    The name of the replication for the replicated VM.
    NetworkInterfaces List<ReplicatedVMNetworkInterface>
    One or more network_interface block.
    RecoveryReplicationPolicyId string
    RecoveryVaultName string
    The name of the vault that should be updated.
    ResourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    SourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    SourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    SourceVmId string
    Id of the VM to replicate
    TargetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    TargetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    TargetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    TargetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    TargetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    ManagedDisks []ReplicatedVMManagedDiskArgs
    One or more managed_disk block.
    Name string
    The name of the replication for the replicated VM.
    NetworkInterfaces []ReplicatedVMNetworkInterfaceArgs
    One or more network_interface block.
    RecoveryReplicationPolicyId string
    RecoveryVaultName string
    The name of the vault that should be updated.
    ResourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    SourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    SourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    SourceVmId string
    Id of the VM to replicate
    TargetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    TargetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    TargetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    TargetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    TargetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    managedDisks List<ReplicatedVMManagedDisk>
    One or more managed_disk block.
    name String
    The name of the replication for the replicated VM.
    networkInterfaces List<ReplicatedVMNetworkInterface>
    One or more network_interface block.
    recoveryReplicationPolicyId String
    recoveryVaultName String
    The name of the vault that should be updated.
    resourceGroupName String
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName String
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName String
    Name of the protection container to use.
    sourceVmId String
    Id of the VM to replicate
    targetAvailabilitySetId String
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId String
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    targetRecoveryFabricId String
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId String
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId String
    Id of resource group where the VM should be created when a failover is done.
    managedDisks ReplicatedVMManagedDisk[]
    One or more managed_disk block.
    name string
    The name of the replication for the replicated VM.
    networkInterfaces ReplicatedVMNetworkInterface[]
    One or more network_interface block.
    recoveryReplicationPolicyId string
    recoveryVaultName string
    The name of the vault that should be updated.
    resourceGroupName string
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName string
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName string
    Name of the protection container to use.
    sourceVmId string
    Id of the VM to replicate
    targetAvailabilitySetId string
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId string
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    targetRecoveryFabricId string
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId string
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId string
    Id of resource group where the VM should be created when a failover is done.
    managed_disks Sequence[ReplicatedVMManagedDiskArgs]
    One or more managed_disk block.
    name str
    The name of the replication for the replicated VM.
    network_interfaces Sequence[ReplicatedVMNetworkInterfaceArgs]
    One or more network_interface block.
    recovery_replication_policy_id str
    recovery_vault_name str
    The name of the vault that should be updated.
    resource_group_name str
    Name of the resource group where the vault that should be updated is located.
    source_recovery_fabric_name str
    Name of fabric that should contains this replication.
    source_recovery_protection_container_name str
    Name of the protection container to use.
    source_vm_id str
    Id of the VM to replicate
    target_availability_set_id str
    Id of availability set that the new VM should belong to when a failover is done.
    target_network_id str
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    target_recovery_fabric_id str
    Id of fabric where the VM replication should be handled when a failover is done.
    target_recovery_protection_container_id str
    Id of protection container where the VM replication should be created when a failover is done.
    target_resource_group_id str
    Id of resource group where the VM should be created when a failover is done.
    managedDisks List<Property Map>
    One or more managed_disk block.
    name String
    The name of the replication for the replicated VM.
    networkInterfaces List<Property Map>
    One or more network_interface block.
    recoveryReplicationPolicyId String
    recoveryVaultName String
    The name of the vault that should be updated.
    resourceGroupName String
    Name of the resource group where the vault that should be updated is located.
    sourceRecoveryFabricName String
    Name of fabric that should contains this replication.
    sourceRecoveryProtectionContainerName String
    Name of the protection container to use.
    sourceVmId String
    Id of the VM to replicate
    targetAvailabilitySetId String
    Id of availability set that the new VM should belong to when a failover is done.
    targetNetworkId String
    Network to use when a failover is done (recommended to set if any network_interface is configured for failover).
    targetRecoveryFabricId String
    Id of fabric where the VM replication should be handled when a failover is done.
    targetRecoveryProtectionContainerId String
    Id of protection container where the VM replication should be created when a failover is done.
    targetResourceGroupId String
    Id of resource group where the VM should be created when a failover is done.

    Supporting Types

    ReplicatedVMManagedDisk, ReplicatedVMManagedDiskArgs

    DiskId string
    Id of disk that should be replicated.
    StagingStorageAccountId string
    Storage account that should be used for caching.
    TargetDiskType string
    What type should the disk be when a failover is done.
    TargetReplicaDiskType string
    What type should the disk be that holds the replication data.
    TargetResourceGroupId string
    Resource group disk should belong to when a failover is done.
    TargetDiskEncryptionSetId string
    The Disk Encryption Set that the Managed Disk will be associated with.
    DiskId string
    Id of disk that should be replicated.
    StagingStorageAccountId string
    Storage account that should be used for caching.
    TargetDiskType string
    What type should the disk be when a failover is done.
    TargetReplicaDiskType string
    What type should the disk be that holds the replication data.
    TargetResourceGroupId string
    Resource group disk should belong to when a failover is done.
    TargetDiskEncryptionSetId string
    The Disk Encryption Set that the Managed Disk will be associated with.
    diskId String
    Id of disk that should be replicated.
    stagingStorageAccountId String
    Storage account that should be used for caching.
    targetDiskType String
    What type should the disk be when a failover is done.
    targetReplicaDiskType String
    What type should the disk be that holds the replication data.
    targetResourceGroupId String
    Resource group disk should belong to when a failover is done.
    targetDiskEncryptionSetId String
    The Disk Encryption Set that the Managed Disk will be associated with.
    diskId string
    Id of disk that should be replicated.
    stagingStorageAccountId string
    Storage account that should be used for caching.
    targetDiskType string
    What type should the disk be when a failover is done.
    targetReplicaDiskType string
    What type should the disk be that holds the replication data.
    targetResourceGroupId string
    Resource group disk should belong to when a failover is done.
    targetDiskEncryptionSetId string
    The Disk Encryption Set that the Managed Disk will be associated with.
    disk_id str
    Id of disk that should be replicated.
    staging_storage_account_id str
    Storage account that should be used for caching.
    target_disk_type str
    What type should the disk be when a failover is done.
    target_replica_disk_type str
    What type should the disk be that holds the replication data.
    target_resource_group_id str
    Resource group disk should belong to when a failover is done.
    target_disk_encryption_set_id str
    The Disk Encryption Set that the Managed Disk will be associated with.
    diskId String
    Id of disk that should be replicated.
    stagingStorageAccountId String
    Storage account that should be used for caching.
    targetDiskType String
    What type should the disk be when a failover is done.
    targetReplicaDiskType String
    What type should the disk be that holds the replication data.
    targetResourceGroupId String
    Resource group disk should belong to when a failover is done.
    targetDiskEncryptionSetId String
    The Disk Encryption Set that the Managed Disk will be associated with.

    ReplicatedVMNetworkInterface, ReplicatedVMNetworkInterfaceArgs

    RecoveryPublicIpAddressId string
    Id of the public IP object to use when a failover is done.
    SourceNetworkInterfaceId string
    Id source network interface.
    TargetStaticIp string
    Static IP to assign when a failover is done.
    TargetSubnetName string
    Name of the subnet to to use when a failover is done.
    RecoveryPublicIpAddressId string
    Id of the public IP object to use when a failover is done.
    SourceNetworkInterfaceId string
    Id source network interface.
    TargetStaticIp string
    Static IP to assign when a failover is done.
    TargetSubnetName string
    Name of the subnet to to use when a failover is done.
    recoveryPublicIpAddressId String
    Id of the public IP object to use when a failover is done.
    sourceNetworkInterfaceId String
    Id source network interface.
    targetStaticIp String
    Static IP to assign when a failover is done.
    targetSubnetName String
    Name of the subnet to to use when a failover is done.
    recoveryPublicIpAddressId string
    Id of the public IP object to use when a failover is done.
    sourceNetworkInterfaceId string
    Id source network interface.
    targetStaticIp string
    Static IP to assign when a failover is done.
    targetSubnetName string
    Name of the subnet to to use when a failover is done.
    recovery_public_ip_address_id str
    Id of the public IP object to use when a failover is done.
    source_network_interface_id str
    Id source network interface.
    target_static_ip str
    Static IP to assign when a failover is done.
    target_subnet_name str
    Name of the subnet to to use when a failover is done.
    recoveryPublicIpAddressId String
    Id of the public IP object to use when a failover is done.
    sourceNetworkInterfaceId String
    Id source network interface.
    targetStaticIp String
    Static IP to assign when a failover is done.
    targetSubnetName String
    Name of the subnet to to use when a failover is done.

    Import

    Site Recovery Replicated VM’s can be imported using the resource id, e.g.

     $ pulumi import azure:siterecovery/replicatedVM:ReplicatedVM vmreplication /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/fabric-name/replicationProtectionContainers/protection-container-name/replicationProtectedItems/vm-replication-name
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azurerm Terraform Provider.
    azure logo

    We recommend using Azure Native.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.