We recommend using Azure Native.
azure.siterecovery.HypervNetworkMapping
Explore with Pulumi AI
Manages a HyperV site recovery network mapping on Azure. A HyperV network mapping decides how to translate connected networks when a VM is migrated from HyperV VMM Center to Azure.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const target = new azure.core.ResourceGroup("target", {
name: "tfex-network-mapping",
location: "East US",
});
const vault = new azure.recoveryservices.Vault("vault", {
name: "example-recovery-vault",
location: target.location,
resourceGroupName: target.name,
sku: "Standard",
});
const targetVirtualNetwork = new azure.network.VirtualNetwork("target", {
name: "network",
resourceGroupName: target.name,
addressSpaces: ["192.168.2.0/24"],
location: target.location,
});
const recovery_mapping = new azure.siterecovery.HypervNetworkMapping("recovery-mapping", {
name: "recovery-network-mapping",
recoveryVaultId: vault.id,
sourceSystemCenterVirtualMachineManagerName: "my-vmm-server",
sourceNetworkName: "my-vmm-network",
targetNetworkId: targetVirtualNetwork.id,
});
import pulumi
import pulumi_azure as azure
target = azure.core.ResourceGroup("target",
name="tfex-network-mapping",
location="East US")
vault = azure.recoveryservices.Vault("vault",
name="example-recovery-vault",
location=target.location,
resource_group_name=target.name,
sku="Standard")
target_virtual_network = azure.network.VirtualNetwork("target",
name="network",
resource_group_name=target.name,
address_spaces=["192.168.2.0/24"],
location=target.location)
recovery_mapping = azure.siterecovery.HypervNetworkMapping("recovery-mapping",
name="recovery-network-mapping",
recovery_vault_id=vault.id,
source_system_center_virtual_machine_manager_name="my-vmm-server",
source_network_name="my-vmm-network",
target_network_id=target_virtual_network.id)
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/network"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices"
"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/siterecovery"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
target, err := core.NewResourceGroup(ctx, "target", &core.ResourceGroupArgs{
Name: pulumi.String("tfex-network-mapping"),
Location: pulumi.String("East US"),
})
if err != nil {
return err
}
vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
Name: pulumi.String("example-recovery-vault"),
Location: target.Location,
ResourceGroupName: target.Name,
Sku: pulumi.String("Standard"),
})
if err != nil {
return err
}
targetVirtualNetwork, err := network.NewVirtualNetwork(ctx, "target", &network.VirtualNetworkArgs{
Name: pulumi.String("network"),
ResourceGroupName: target.Name,
AddressSpaces: pulumi.StringArray{
pulumi.String("192.168.2.0/24"),
},
Location: target.Location,
})
if err != nil {
return err
}
_, err = siterecovery.NewHypervNetworkMapping(ctx, "recovery-mapping", &siterecovery.HypervNetworkMappingArgs{
Name: pulumi.String("recovery-network-mapping"),
RecoveryVaultId: vault.ID(),
SourceSystemCenterVirtualMachineManagerName: pulumi.String("my-vmm-server"),
SourceNetworkName: pulumi.String("my-vmm-network"),
TargetNetworkId: targetVirtualNetwork.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var target = new Azure.Core.ResourceGroup("target", new()
{
Name = "tfex-network-mapping",
Location = "East US",
});
var vault = new Azure.RecoveryServices.Vault("vault", new()
{
Name = "example-recovery-vault",
Location = target.Location,
ResourceGroupName = target.Name,
Sku = "Standard",
});
var targetVirtualNetwork = new Azure.Network.VirtualNetwork("target", new()
{
Name = "network",
ResourceGroupName = target.Name,
AddressSpaces = new[]
{
"192.168.2.0/24",
},
Location = target.Location,
});
var recovery_mapping = new Azure.SiteRecovery.HypervNetworkMapping("recovery-mapping", new()
{
Name = "recovery-network-mapping",
RecoveryVaultId = vault.Id,
SourceSystemCenterVirtualMachineManagerName = "my-vmm-server",
SourceNetworkName = "my-vmm-network",
TargetNetworkId = targetVirtualNetwork.Id,
});
});
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.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.siterecovery.HypervNetworkMapping;
import com.pulumi.azure.siterecovery.HypervNetworkMappingArgs;
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 target = new ResourceGroup("target", ResourceGroupArgs.builder()
.name("tfex-network-mapping")
.location("East US")
.build());
var vault = new Vault("vault", VaultArgs.builder()
.name("example-recovery-vault")
.location(target.location())
.resourceGroupName(target.name())
.sku("Standard")
.build());
var targetVirtualNetwork = new VirtualNetwork("targetVirtualNetwork", VirtualNetworkArgs.builder()
.name("network")
.resourceGroupName(target.name())
.addressSpaces("192.168.2.0/24")
.location(target.location())
.build());
var recovery_mapping = new HypervNetworkMapping("recovery-mapping", HypervNetworkMappingArgs.builder()
.name("recovery-network-mapping")
.recoveryVaultId(vault.id())
.sourceSystemCenterVirtualMachineManagerName("my-vmm-server")
.sourceNetworkName("my-vmm-network")
.targetNetworkId(targetVirtualNetwork.id())
.build());
}
}
resources:
target:
type: azure:core:ResourceGroup
properties:
name: tfex-network-mapping
location: East US
vault:
type: azure:recoveryservices:Vault
properties:
name: example-recovery-vault
location: ${target.location}
resourceGroupName: ${target.name}
sku: Standard
targetVirtualNetwork:
type: azure:network:VirtualNetwork
name: target
properties:
name: network
resourceGroupName: ${target.name}
addressSpaces:
- 192.168.2.0/24
location: ${target.location}
recovery-mapping:
type: azure:siterecovery:HypervNetworkMapping
properties:
name: recovery-network-mapping
recoveryVaultId: ${vault.id}
sourceSystemCenterVirtualMachineManagerName: my-vmm-server
sourceNetworkName: my-vmm-network
targetNetworkId: ${targetVirtualNetwork.id}
Create HypervNetworkMapping Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new HypervNetworkMapping(name: string, args: HypervNetworkMappingArgs, opts?: CustomResourceOptions);
@overload
def HypervNetworkMapping(resource_name: str,
args: HypervNetworkMappingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def HypervNetworkMapping(resource_name: str,
opts: Optional[ResourceOptions] = None,
recovery_vault_id: Optional[str] = None,
source_network_name: Optional[str] = None,
source_system_center_virtual_machine_manager_name: Optional[str] = None,
target_network_id: Optional[str] = None,
name: Optional[str] = None)
func NewHypervNetworkMapping(ctx *Context, name string, args HypervNetworkMappingArgs, opts ...ResourceOption) (*HypervNetworkMapping, error)
public HypervNetworkMapping(string name, HypervNetworkMappingArgs args, CustomResourceOptions? opts = null)
public HypervNetworkMapping(String name, HypervNetworkMappingArgs args)
public HypervNetworkMapping(String name, HypervNetworkMappingArgs args, CustomResourceOptions options)
type: azure:siterecovery:HypervNetworkMapping
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 HypervNetworkMappingArgs
- 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 HypervNetworkMappingArgs
- 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 HypervNetworkMappingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args HypervNetworkMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args HypervNetworkMappingArgs
- 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 hypervNetworkMappingResource = new Azure.SiteRecovery.HypervNetworkMapping("hypervNetworkMappingResource", new()
{
RecoveryVaultId = "string",
SourceNetworkName = "string",
SourceSystemCenterVirtualMachineManagerName = "string",
TargetNetworkId = "string",
Name = "string",
});
example, err := siterecovery.NewHypervNetworkMapping(ctx, "hypervNetworkMappingResource", &siterecovery.HypervNetworkMappingArgs{
RecoveryVaultId: pulumi.String("string"),
SourceNetworkName: pulumi.String("string"),
SourceSystemCenterVirtualMachineManagerName: pulumi.String("string"),
TargetNetworkId: pulumi.String("string"),
Name: pulumi.String("string"),
})
var hypervNetworkMappingResource = new HypervNetworkMapping("hypervNetworkMappingResource", HypervNetworkMappingArgs.builder()
.recoveryVaultId("string")
.sourceNetworkName("string")
.sourceSystemCenterVirtualMachineManagerName("string")
.targetNetworkId("string")
.name("string")
.build());
hyperv_network_mapping_resource = azure.siterecovery.HypervNetworkMapping("hypervNetworkMappingResource",
recovery_vault_id="string",
source_network_name="string",
source_system_center_virtual_machine_manager_name="string",
target_network_id="string",
name="string")
const hypervNetworkMappingResource = new azure.siterecovery.HypervNetworkMapping("hypervNetworkMappingResource", {
recoveryVaultId: "string",
sourceNetworkName: "string",
sourceSystemCenterVirtualMachineManagerName: "string",
targetNetworkId: "string",
name: "string",
});
type: azure:siterecovery:HypervNetworkMapping
properties:
name: string
recoveryVaultId: string
sourceNetworkName: string
sourceSystemCenterVirtualMachineManagerName: string
targetNetworkId: string
HypervNetworkMapping Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The HypervNetworkMapping resource accepts the following input properties:
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- Source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- Source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- Target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- Name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- Source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- Source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- Target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- Name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network StringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System StringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network StringId - The id of the recovery network. Changing this forces a new resource to be created.
- name String
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery_
vault_ strid - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source_
network_ strname - The Name of the primary network. Changing this forces a new resource to be created.
- source_
system_ strcenter_ virtual_ machine_ manager_ name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target_
network_ strid - The id of the recovery network. Changing this forces a new resource to be created.
- name str
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network StringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System StringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network StringId - The id of the recovery network. Changing this forces a new resource to be created.
- name String
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the HypervNetworkMapping 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 HypervNetworkMapping Resource
Get an existing HypervNetworkMapping 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?: HypervNetworkMappingState, opts?: CustomResourceOptions): HypervNetworkMapping
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
recovery_vault_id: Optional[str] = None,
source_network_name: Optional[str] = None,
source_system_center_virtual_machine_manager_name: Optional[str] = None,
target_network_id: Optional[str] = None) -> HypervNetworkMapping
func GetHypervNetworkMapping(ctx *Context, name string, id IDInput, state *HypervNetworkMappingState, opts ...ResourceOption) (*HypervNetworkMapping, error)
public static HypervNetworkMapping Get(string name, Input<string> id, HypervNetworkMappingState? state, CustomResourceOptions? opts = null)
public static HypervNetworkMapping get(String name, Output<String> id, HypervNetworkMappingState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- Source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- Source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- Target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- Name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- Recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- Source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- Source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- Target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- name String
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network StringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System StringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network StringId - The id of the recovery network. Changing this forces a new resource to be created.
- name string
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault stringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network stringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System stringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network stringId - The id of the recovery network. Changing this forces a new resource to be created.
- name str
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery_
vault_ strid - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source_
network_ strname - The Name of the primary network. Changing this forces a new resource to be created.
- source_
system_ strcenter_ virtual_ machine_ manager_ name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target_
network_ strid - The id of the recovery network. Changing this forces a new resource to be created.
- name String
- The name of the HyperV network mapping. Changing this forces a new resource to be created.
- recovery
Vault StringId - The ID of the Recovery Services Vault where the HyperV network mapping should be created. Changing this forces a new resource to be created.
- source
Network StringName - The Name of the primary network. Changing this forces a new resource to be created.
- source
System StringCenter Virtual Machine Manager Name - Specifies the name of source System Center Virtual Machine Manager where the source network exists. Changing this forces a new resource to be created.
- target
Network StringId - The id of the recovery network. Changing this forces a new resource to be created.
Import
Site Recovery Network Mapping can be imported using the resource id
, e.g.
$ pulumi import azure:siterecovery/hypervNetworkMapping:HypervNetworkMapping azurerm_site_recovery_hyperv_network_mapping.mymapping /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationFabrics/primary-fabric-name/replicationNetworks/azureNetwork/replicationNetworkMappings/mapping-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.