NetworkMapping

class NetworkMapping : KotlinCustomResource

Manages a site recovery network mapping on Azure. A network mapping decides how to translate connected networks when a VM is migrated from one region to another.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.recoveryservices.Vault;
import com.pulumi.azure.recoveryservices.VaultArgs;
import com.pulumi.azure.siterecovery.Fabric;
import com.pulumi.azure.siterecovery.FabricArgs;
import com.pulumi.azure.network.VirtualNetwork;
import com.pulumi.azure.network.VirtualNetworkArgs;
import com.pulumi.azure.siterecovery.NetworkMapping;
import com.pulumi.azure.siterecovery.NetworkMappingArgs;
import com.pulumi.resources.CustomResourceOptions;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var primaryResourceGroup = new ResourceGroup("primaryResourceGroup", ResourceGroupArgs.builder()
.location("West US")
.build());
var secondaryResourceGroup = new ResourceGroup("secondaryResourceGroup", ResourceGroupArgs.builder()
.location("East US")
.build());
var vault = new Vault("vault", VaultArgs.builder()
.location(secondaryResourceGroup.location())
.resourceGroupName(secondaryResourceGroup.name())
.sku("Standard")
.build());
var primaryFabric = new Fabric("primaryFabric", FabricArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.location(primaryResourceGroup.location())
.build());
var secondaryFabric = new Fabric("secondaryFabric", FabricArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.location(secondaryResourceGroup.location())
.build(), CustomResourceOptions.builder()
.dependsOn(primaryFabric)
.build());
var primaryVirtualNetwork = new VirtualNetwork("primaryVirtualNetwork", VirtualNetworkArgs.builder()
.resourceGroupName(primaryResourceGroup.name())
.addressSpaces("192.168.1.0/24")
.location(primaryResourceGroup.location())
.build());
var secondaryVirtualNetwork = new VirtualNetwork("secondaryVirtualNetwork", VirtualNetworkArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.addressSpaces("192.168.2.0/24")
.location(secondaryResourceGroup.location())
.build());
var recovery_mapping = new NetworkMapping("recovery-mapping", NetworkMappingArgs.builder()
.resourceGroupName(secondaryResourceGroup.name())
.recoveryVaultName(vault.name())
.sourceRecoveryFabricName("primary-fabric")
.targetRecoveryFabricName("secondary-fabric")
.sourceNetworkId(primaryVirtualNetwork.id())
.targetNetworkId(secondaryVirtualNetwork.id())
.build());
}
}

Import

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

$ pulumi import azure:siterecovery/networkMapping:NetworkMapping 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

Properties

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name of the network mapping. Changing this forces a new resource to be created.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.

Link copied to clipboard
val sourceNetworkId: Output<String>

The id of the primary network. Changing this forces a new resource to be created.

Link copied to clipboard

Specifies the ASR fabric where mapping should be created. Changing this forces a new resource to be created.

Link copied to clipboard
val targetNetworkId: Output<String>

The id of the recovery network. Changing this forces a new resource to be created.

Link copied to clipboard

The Azure Site Recovery fabric object corresponding to the recovery Azure region. Changing this forces a new resource to be created.

Link copied to clipboard
val urn: Output<String>