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,
});
}
}
Inherited Members
Namespace: Pulumi.Azure.SiteRecovery
Assembly: Pulumi.Azure.dll
Syntax
public class NetworkMapping : CustomResource
Constructors
View SourceNetworkMapping(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 SourceName
The name of the network mapping.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
RecoveryVaultName
The name of the vault that should be updated.
Declaration
public Output<string> RecoveryVaultName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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> |
SourceNetworkId
The id of the primary network.
Declaration
public Output<string> SourceNetworkId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceRecoveryFabricName
Specifies the ASR fabric where mapping should be created.
Declaration
public Output<string> SourceRecoveryFabricName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
TargetNetworkId
The id of the recovery network.
Declaration
public Output<string> TargetNetworkId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
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 SourceGet(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 |