Show / Hide Table of Contents

Class NetworkMapping

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

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 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,
    });
    // Avoids issues with crearing fabrics simultainusly
    var primaryVirtualNetwork = new Azure.Network.VirtualNetwork("primaryVirtualNetwork", new Azure.Network.VirtualNetworkArgs
    {
        ResourceGroupName = primaryResourceGroup.Name,
        AddressSpaces = 
        {
            "192.168.1.0/24",
        },
        Location = primaryResourceGroup.Location,
    });
    var secondaryVirtualNetwork = new Azure.Network.VirtualNetwork("secondaryVirtualNetwork", new Azure.Network.VirtualNetworkArgs
    {
        ResourceGroupName = secondaryResourceGroup.Name,
        AddressSpaces = 
        {
            "192.168.2.0/24",
        },
        Location = secondaryResourceGroup.Location,
    });
    var recovery_mapping = new Azure.SiteRecovery.NetworkMapping("recovery-mapping", new Azure.SiteRecovery.NetworkMappingArgs
    {
        ResourceGroupName = secondaryResourceGroup.Name,
        RecoveryVaultName = vault.Name,
        SourceRecoveryFabricName = "primary-fabric",
        TargetRecoveryFabricName = "secondary-fabric",
        SourceNetworkId = primaryVirtualNetwork.Id,
        TargetNetworkId = secondaryVirtualNetwork.Id,
    });
}

}
Inheritance
System.Object
Resource
CustomResource
NetworkMapping
Inherited Members
CustomResource.Id
Resource.GetResourceType()
Resource.GetResourceName()
Resource.Urn
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Pulumi.Azure.SiteRecovery
Assembly: Pulumi.Azure.dll
Syntax
public class NetworkMapping : CustomResource

Constructors

View Source

NetworkMapping(String, NetworkMappingArgs, CustomResourceOptions)

Create a NetworkMapping resource with the given unique name, arguments, and options.

Declaration
public NetworkMapping(string name, NetworkMappingArgs args, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resource

NetworkMappingArgs args

The arguments used to populate this resource's properties

CustomResourceOptions options

A bag of options that control this resource's behavior

Properties

View Source

Name

The name of the network mapping.

Declaration
public Output<string> Name { get; }
Property Value
Type Description
Output<System.String>
View Source

RecoveryVaultName

The name of the vault that should be updated.

Declaration
public Output<string> RecoveryVaultName { get; }
Property Value
Type Description
Output<System.String>
View Source

ResourceGroupName

Name of the resource group where the vault that should be updated is located.

Declaration
public Output<string> ResourceGroupName { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceNetworkId

The id of the primary network.

Declaration
public Output<string> SourceNetworkId { get; }
Property Value
Type Description
Output<System.String>
View Source

SourceRecoveryFabricName

Specifies the ASR fabric where mapping should be created.

Declaration
public Output<string> SourceRecoveryFabricName { get; }
Property Value
Type Description
Output<System.String>
View Source

TargetNetworkId

The id of the recovery network.

Declaration
public Output<string> TargetNetworkId { get; }
Property Value
Type Description
Output<System.String>
View Source

TargetRecoveryFabricName

The Azure Site Recovery fabric object corresponding to the recovery Azure region.

Declaration
public Output<string> TargetRecoveryFabricName { get; }
Property Value
Type Description
Output<System.String>

Methods

View Source

Get(String, Input<String>, NetworkMappingState, CustomResourceOptions)

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

Declaration
public static NetworkMapping Get(string name, Input<string> id, NetworkMappingState state = null, CustomResourceOptions options = null)
Parameters
Type Name Description
System.String name

The unique name of the resulting resource.

Input<System.String> id

The unique provider ID of the resource to lookup.

NetworkMappingState state

Any extra arguments used during the lookup.

CustomResourceOptions options

A bag of options that control this resource's behavior

Returns
Type Description
NetworkMapping
  • View Source
Back to top Copyright 2016-2020, Pulumi Corporation.