All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pulumi.azure.siterecovery.kotlin.ReplicationPolicyArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 6.15.0.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.siterecovery.kotlin

import com.pulumi.azure.siterecovery.ReplicationPolicyArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName

/**
 * Manages a Azure Site Recovery replication policy within a recovery vault. Replication policies define the frequency at which recovery points are created and how long they are stored.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "tfex-network-mapping-secondary",
 *     location: "East US",
 * });
 * const vault = new azure.recoveryservices.Vault("vault", {
 *     name: "example-recovery-vault",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     sku: "Standard",
 * });
 * const policy = new azure.siterecovery.ReplicationPolicy("policy", {
 *     name: "policy",
 *     resourceGroupName: example.name,
 *     recoveryVaultName: vault.name,
 *     recoveryPointRetentionInMinutes: 24 * 60,
 *     applicationConsistentSnapshotFrequencyInMinutes: 4 * 60,
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="tfex-network-mapping-secondary",
 *     location="East US")
 * vault = azure.recoveryservices.Vault("vault",
 *     name="example-recovery-vault",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     sku="Standard")
 * policy = azure.siterecovery.ReplicationPolicy("policy",
 *     name="policy",
 *     resource_group_name=example.name,
 *     recovery_vault_name=vault.name,
 *     recovery_point_retention_in_minutes=24 * 60,
 *     application_consistent_snapshot_frequency_in_minutes=4 * 60)
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "tfex-network-mapping-secondary",
 *         Location = "East US",
 *     });
 *     var vault = new Azure.RecoveryServices.Vault("vault", new()
 *     {
 *         Name = "example-recovery-vault",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Sku = "Standard",
 *     });
 *     var policy = new Azure.SiteRecovery.ReplicationPolicy("policy", new()
 *     {
 *         Name = "policy",
 *         ResourceGroupName = example.Name,
 *         RecoveryVaultName = vault.Name,
 *         RecoveryPointRetentionInMinutes = 24 * 60,
 *         ApplicationConsistentSnapshotFrequencyInMinutes = 4 * 60,
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"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 {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("tfex-network-mapping-secondary"),
 * 			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:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Sku:               pulumi.String("Standard"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = siterecovery.NewReplicationPolicy(ctx, "policy", &siterecovery.ReplicationPolicyArgs{
 * 			Name:                            pulumi.String("policy"),
 * 			ResourceGroupName:               example.Name,
 * 			RecoveryVaultName:               vault.Name,
 * 			RecoveryPointRetentionInMinutes: int(24 * 60),
 * 			ApplicationConsistentSnapshotFrequencyInMinutes: int(4 * 60),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * 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.ReplicationPolicy;
 * import com.pulumi.azure.siterecovery.ReplicationPolicyArgs;
 * 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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("tfex-network-mapping-secondary")
 *             .location("East US")
 *             .build());
 *         var vault = new Vault("vault", VaultArgs.builder()
 *             .name("example-recovery-vault")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .sku("Standard")
 *             .build());
 *         var policy = new ReplicationPolicy("policy", ReplicationPolicyArgs.builder()
 *             .name("policy")
 *             .resourceGroupName(example.name())
 *             .recoveryVaultName(vault.name())
 *             .recoveryPointRetentionInMinutes(24 * 60)
 *             .applicationConsistentSnapshotFrequencyInMinutes(4 * 60)
 *             .build());
 *     }
 * }
 * ```
 * 
 * ## Import
 * Site Recovery Replication Policies can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:siterecovery/replicationPolicy:ReplicationPolicy mypolicy /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/replicationPolicies/policy-name
 * ```
 * @property applicationConsistentSnapshotFrequencyInMinutes Specifies the frequency(in minutes) at which to create application consistent recovery points.
 * > **Note:** The value of `application_consistent_snapshot_frequency_in_minutes` must be less than or equal to the value of `recovery_point_retention_in_minutes`.
 * @property name The name of the replication policy. Changing this forces a new resource to be created.
 * @property recoveryPointRetentionInMinutes The duration in minutes for which the recovery points need to be stored.
 * @property recoveryVaultName The name of the vault that should be updated. Changing this forces a new resource to be created.
 * @property resourceGroupName Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.
 */
public data class ReplicationPolicyArgs(
    public val applicationConsistentSnapshotFrequencyInMinutes: Output? = null,
    public val name: Output? = null,
    public val recoveryPointRetentionInMinutes: Output? = null,
    public val recoveryVaultName: Output? = null,
    public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.siterecovery.ReplicationPolicyArgs =
        com.pulumi.azure.siterecovery.ReplicationPolicyArgs.builder()
            .applicationConsistentSnapshotFrequencyInMinutes(
                applicationConsistentSnapshotFrequencyInMinutes?.applyValue({ args0 ->
                    args0
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .recoveryPointRetentionInMinutes(recoveryPointRetentionInMinutes?.applyValue({ args0 -> args0 }))
            .recoveryVaultName(recoveryVaultName?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [ReplicationPolicyArgs].
 */
@PulumiTagMarker
public class ReplicationPolicyArgsBuilder internal constructor() {
    private var applicationConsistentSnapshotFrequencyInMinutes: Output? = null

    private var name: Output? = null

    private var recoveryPointRetentionInMinutes: Output? = null

    private var recoveryVaultName: Output? = null

    private var resourceGroupName: Output? = null

    /**
     * @param value Specifies the frequency(in minutes) at which to create application consistent recovery points.
     * > **Note:** The value of `application_consistent_snapshot_frequency_in_minutes` must be less than or equal to the value of `recovery_point_retention_in_minutes`.
     */
    @JvmName("hlhjdbwcggrjhadp")
    public suspend fun applicationConsistentSnapshotFrequencyInMinutes(`value`: Output) {
        this.applicationConsistentSnapshotFrequencyInMinutes = value
    }

    /**
     * @param value The name of the replication policy. Changing this forces a new resource to be created.
     */
    @JvmName("fnvgijaafghsgpqh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The duration in minutes for which the recovery points need to be stored.
     */
    @JvmName("rvpcgasnpnlwaefx")
    public suspend fun recoveryPointRetentionInMinutes(`value`: Output) {
        this.recoveryPointRetentionInMinutes = value
    }

    /**
     * @param value The name of the vault that should be updated. Changing this forces a new resource to be created.
     */
    @JvmName("swdpiddclqbmlsxw")
    public suspend fun recoveryVaultName(`value`: Output) {
        this.recoveryVaultName = value
    }

    /**
     * @param value Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.
     */
    @JvmName("qgkhxhmvqvtrvukl")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value Specifies the frequency(in minutes) at which to create application consistent recovery points.
     * > **Note:** The value of `application_consistent_snapshot_frequency_in_minutes` must be less than or equal to the value of `recovery_point_retention_in_minutes`.
     */
    @JvmName("udwncuxdserasntn")
    public suspend fun applicationConsistentSnapshotFrequencyInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.applicationConsistentSnapshotFrequencyInMinutes = mapped
    }

    /**
     * @param value The name of the replication policy. Changing this forces a new resource to be created.
     */
    @JvmName("ptbhmfcowfwvtrbh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The duration in minutes for which the recovery points need to be stored.
     */
    @JvmName("mwqjdvvyfxqvoidi")
    public suspend fun recoveryPointRetentionInMinutes(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.recoveryPointRetentionInMinutes = mapped
    }

    /**
     * @param value The name of the vault that should be updated. Changing this forces a new resource to be created.
     */
    @JvmName("cgxofjoqtyjloawc")
    public suspend fun recoveryVaultName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.recoveryVaultName = mapped
    }

    /**
     * @param value Name of the resource group where the vault that should be updated is located. Changing this forces a new resource to be created.
     */
    @JvmName("gbycqxjrjorbwecc")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    internal fun build(): ReplicationPolicyArgs = ReplicationPolicyArgs(
        applicationConsistentSnapshotFrequencyInMinutes = applicationConsistentSnapshotFrequencyInMinutes,
        name = name,
        recoveryPointRetentionInMinutes = recoveryPointRetentionInMinutes,
        recoveryVaultName = recoveryVaultName,
        resourceGroupName = resourceGroupName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy