ProtectionContainerMapping
Manages a Azure recovery vault protection container mapping. A protection container mapping decides how to translate the protection container 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,
});
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,
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/recoveryservices"
"github.com/pulumi/pulumi-azure/sdk/v3/go/azure/siterecovery"
"github.com/pulumi/pulumi/sdk/v2/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
}
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: pulumi.Int(24 * 60),
ApplicationConsistentSnapshotFrequencyInMinutes: pulumi.Int(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
}
return nil
})
}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")
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)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 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,
});Create a ProtectionContainerMapping Resource
new ProtectionContainerMapping(name: string, args: ProtectionContainerMappingArgs, opts?: CustomResourceOptions);def ProtectionContainerMapping(resource_name, opts=None, name=None, recovery_fabric_name=None, recovery_replication_policy_id=None, recovery_source_protection_container_name=None, recovery_target_protection_container_id=None, recovery_vault_name=None, resource_group_name=None, __props__=None);func NewProtectionContainerMapping(ctx *Context, name string, args ProtectionContainerMappingArgs, opts ...ResourceOption) (*ProtectionContainerMapping, error)public ProtectionContainerMapping(string name, ProtectionContainerMappingArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ProtectionContainerMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- opts ResourceOptions
- A bag of options that control this resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProtectionContainerMappingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProtectionContainerMappingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ProtectionContainerMapping Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ProtectionContainerMapping resource accepts the following input properties:
- Recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- Recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- Recovery
Source stringProtection Container Name Name of the source protection container to map.
- Recovery
Target stringProtection Container Id Id of target protection container to map to.
- Recovery
Vault stringName The name of the vault that should be updated.
- Resource
Group stringName Name of the resource group where the vault that should be updated is located.
- Name string
The name of the network mapping.
- Recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- Recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- Recovery
Source stringProtection Container Name Name of the source protection container to map.
- Recovery
Target stringProtection Container Id Id of target protection container to map to.
- Recovery
Vault stringName The name of the vault that should be updated.
- Resource
Group stringName Name of the resource group where the vault that should be updated is located.
- Name string
The name of the network mapping.
- recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- recovery
Source stringProtection Container Name Name of the source protection container to map.
- recovery
Target stringProtection Container Id Id of target protection container to map to.
- recovery
Vault stringName The name of the vault that should be updated.
- resource
Group stringName Name of the resource group where the vault that should be updated is located.
- name string
The name of the network mapping.
- recovery_
fabric_ strname Name of fabric that should contains the protection container to map.
- recovery_
replication_ strpolicy_ id Id of the policy to use for this mapping.
- recovery_
source_ strprotection_ container_ name Name of the source protection container to map.
- recovery_
target_ strprotection_ container_ id Id of target protection container to map to.
- recovery_
vault_ strname The name of the vault that should be updated.
- resource_
group_ strname Name of the resource group where the vault that should be updated is located.
- name str
The name of the network mapping.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProtectionContainerMapping resource produces the following output properties:
Look up an Existing ProtectionContainerMapping Resource
Get an existing ProtectionContainerMapping 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?: ProtectionContainerMappingState, opts?: CustomResourceOptions): ProtectionContainerMappingstatic get(resource_name, id, opts=None, name=None, recovery_fabric_name=None, recovery_replication_policy_id=None, recovery_source_protection_container_name=None, recovery_target_protection_container_id=None, recovery_vault_name=None, resource_group_name=None, __props__=None);func GetProtectionContainerMapping(ctx *Context, name string, id IDInput, state *ProtectionContainerMappingState, opts ...ResourceOption) (*ProtectionContainerMapping, error)public static ProtectionContainerMapping Get(string name, Input<string> id, ProtectionContainerMappingState? state, CustomResourceOptions? opts = null)- 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.
The following state arguments are supported:
- Name string
The name of the network mapping.
- Recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- Recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- Recovery
Source stringProtection Container Name Name of the source protection container to map.
- Recovery
Target stringProtection Container Id Id of target protection container to map to.
- Recovery
Vault stringName The name of the vault that should be updated.
- Resource
Group stringName Name of the resource group where the vault that should be updated is located.
- Name string
The name of the network mapping.
- Recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- Recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- Recovery
Source stringProtection Container Name Name of the source protection container to map.
- Recovery
Target stringProtection Container Id Id of target protection container to map to.
- Recovery
Vault stringName The name of the vault that should be updated.
- Resource
Group stringName Name of the resource group where the vault that should be updated is located.
- name string
The name of the network mapping.
- recovery
Fabric stringName Name of fabric that should contains the protection container to map.
- recovery
Replication stringPolicy Id Id of the policy to use for this mapping.
- recovery
Source stringProtection Container Name Name of the source protection container to map.
- recovery
Target stringProtection Container Id Id of target protection container to map to.
- recovery
Vault stringName The name of the vault that should be updated.
- resource
Group stringName Name of the resource group where the vault that should be updated is located.
- name str
The name of the network mapping.
- recovery_
fabric_ strname Name of fabric that should contains the protection container to map.
- recovery_
replication_ strpolicy_ id Id of the policy to use for this mapping.
- recovery_
source_ strprotection_ container_ name Name of the source protection container to map.
- recovery_
target_ strprotection_ container_ id Id of target protection container to map to.
- recovery_
vault_ strname The name of the vault that should be updated.
- resource_
group_ strname Name of the resource group where the vault that should be updated is located.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.