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

com.pulumi.azure.dataprotection.kotlin.BackupPolicyBlobStorageArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.dataprotection.kotlin

import com.pulumi.azure.dataprotection.BackupPolicyBlobStorageArgs.builder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyBlobStorageRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyBlobStorageRetentionRuleArgsBuilder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Deprecated
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Backup Policy Blob Storage.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleBackupVault = new azure.dataprotection.BackupVault("example", {
 *     name: "example-backup-vault",
 *     resourceGroupName: example.name,
 *     location: example.location,
 *     datastoreType: "VaultStore",
 *     redundancy: "LocallyRedundant",
 * });
 * const exampleBackupPolicyBlobStorage = new azure.dataprotection.BackupPolicyBlobStorage("example", {
 *     name: "example-backup-policy",
 *     vaultId: exampleBackupVault.id,
 *     retentionDuration: "P30D",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_backup_vault = azure.dataprotection.BackupVault("example",
 *     name="example-backup-vault",
 *     resource_group_name=example.name,
 *     location=example.location,
 *     datastore_type="VaultStore",
 *     redundancy="LocallyRedundant")
 * example_backup_policy_blob_storage = azure.dataprotection.BackupPolicyBlobStorage("example",
 *     name="example-backup-policy",
 *     vault_id=example_backup_vault.id,
 *     retention_duration="P30D")
 * ```
 * ```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 = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleBackupVault = new Azure.DataProtection.BackupVault("example", new()
 *     {
 *         Name = "example-backup-vault",
 *         ResourceGroupName = example.Name,
 *         Location = example.Location,
 *         DatastoreType = "VaultStore",
 *         Redundancy = "LocallyRedundant",
 *     });
 *     var exampleBackupPolicyBlobStorage = new Azure.DataProtection.BackupPolicyBlobStorage("example", new()
 *     {
 *         Name = "example-backup-policy",
 *         VaultId = exampleBackupVault.Id,
 *         RetentionDuration = "P30D",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/dataprotection"
 * 	"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("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		exampleBackupVault, err := dataprotection.NewBackupVault(ctx, "example", &dataprotection.BackupVaultArgs{
 * 			Name:              pulumi.String("example-backup-vault"),
 * 			ResourceGroupName: example.Name,
 * 			Location:          example.Location,
 * 			DatastoreType:     pulumi.String("VaultStore"),
 * 			Redundancy:        pulumi.String("LocallyRedundant"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = dataprotection.NewBackupPolicyBlobStorage(ctx, "example", &dataprotection.BackupPolicyBlobStorageArgs{
 * 			Name:              pulumi.String("example-backup-policy"),
 * 			VaultId:           exampleBackupVault.ID(),
 * 			RetentionDuration: pulumi.String("P30D"),
 * 		})
 * 		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.dataprotection.BackupVault;
 * import com.pulumi.azure.dataprotection.BackupVaultArgs;
 * import com.pulumi.azure.dataprotection.BackupPolicyBlobStorage;
 * import com.pulumi.azure.dataprotection.BackupPolicyBlobStorageArgs;
 * 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("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleBackupVault = new BackupVault("exampleBackupVault", BackupVaultArgs.builder()
 *             .name("example-backup-vault")
 *             .resourceGroupName(example.name())
 *             .location(example.location())
 *             .datastoreType("VaultStore")
 *             .redundancy("LocallyRedundant")
 *             .build());
 *         var exampleBackupPolicyBlobStorage = new BackupPolicyBlobStorage("exampleBackupPolicyBlobStorage", BackupPolicyBlobStorageArgs.builder()
 *             .name("example-backup-policy")
 *             .vaultId(exampleBackupVault.id())
 *             .retentionDuration("P30D")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleBackupVault:
 *     type: azure:dataprotection:BackupVault
 *     name: example
 *     properties:
 *       name: example-backup-vault
 *       resourceGroupName: ${example.name}
 *       location: ${example.location}
 *       datastoreType: VaultStore
 *       redundancy: LocallyRedundant
 *   exampleBackupPolicyBlobStorage:
 *     type: azure:dataprotection:BackupPolicyBlobStorage
 *     name: example
 *     properties:
 *       name: example-backup-policy
 *       vaultId: ${exampleBackupVault.id}
 *       retentionDuration: P30D
 * ```
 * 
 * ## Import
 * Backup Policy Blob Storages can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:dataprotection/backupPolicyBlobStorage:BackupPolicyBlobStorage example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DataProtection/backupVaults/vault1/backupPolicies/backupPolicy1
 * ```
 * @property backupRepeatingTimeIntervals Specifies a list of repeating time interval. It should follow `ISO 8601` repeating time interval. Changing this forces a new Backup Policy Blob Storage to be created.
 * @property name The name which should be used for this Backup Policy Blob Storage. Changing this forces a new Backup Policy Blob Storage to be created.
 * @property operationalDefaultRetentionDuration The duration of operational default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
 * @property retentionDuration Duration of deletion after given timespan. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
 * > **Note:** > `retention_duration` is deprecated in version 3.0 and will be removed in version 4.0 of the AzureRM Provider. Please use the `operational_default_retention_duration` instead.
 * @property retentionRules One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
 * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
 * @property timeZone Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new Backup Policy Blob Storage to be created.
 * @property vaultDefaultRetentionDuration The duration of vault default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
 * > **Note:** Setting `vault_default_retention_duration` also requires setting `backup_repeating_time_intervals`. At least one of `operational_default_retention_duration`, `retention_duration` or `vault_default_retention_duration` must be specified.
 * @property vaultId The ID of the Backup Vault within which the Backup Policy Blob Storage should exist. Changing this forces a new Backup Policy Blob Storage to be created.
 */
public data class BackupPolicyBlobStorageArgs(
    public val backupRepeatingTimeIntervals: Output>? = null,
    public val name: Output? = null,
    public val operationalDefaultRetentionDuration: Output? = null,
    @Deprecated(
        message = """
  This property has been renamed to `operational_default_retention_duration` and will be removed in
      v4.0 of the AzureRM provider
  """,
    )
    public val retentionDuration: Output? = null,
    public val retentionRules: Output>? = null,
    public val timeZone: Output? = null,
    public val vaultDefaultRetentionDuration: Output? = null,
    public val vaultId: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.dataprotection.BackupPolicyBlobStorageArgs =
        com.pulumi.azure.dataprotection.BackupPolicyBlobStorageArgs.builder()
            .backupRepeatingTimeIntervals(
                backupRepeatingTimeIntervals?.applyValue({ args0 ->
                    args0.map({ args0 -> args0 })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .operationalDefaultRetentionDuration(
                operationalDefaultRetentionDuration?.applyValue({ args0 ->
                    args0
                }),
            )
            .retentionDuration(retentionDuration?.applyValue({ args0 -> args0 }))
            .retentionRules(
                retentionRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .timeZone(timeZone?.applyValue({ args0 -> args0 }))
            .vaultDefaultRetentionDuration(vaultDefaultRetentionDuration?.applyValue({ args0 -> args0 }))
            .vaultId(vaultId?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [BackupPolicyBlobStorageArgs].
 */
@PulumiTagMarker
public class BackupPolicyBlobStorageArgsBuilder internal constructor() {
    private var backupRepeatingTimeIntervals: Output>? = null

    private var name: Output? = null

    private var operationalDefaultRetentionDuration: Output? = null

    private var retentionDuration: Output? = null

    private var retentionRules: Output>? = null

    private var timeZone: Output? = null

    private var vaultDefaultRetentionDuration: Output? = null

    private var vaultId: Output? = null

    /**
     * @param value Specifies a list of repeating time interval. It should follow `ISO 8601` repeating time interval. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("qwrakjacpkxilldq")
    public suspend fun backupRepeatingTimeIntervals(`value`: Output>) {
        this.backupRepeatingTimeIntervals = value
    }

    @JvmName("tecuurrkvkuferjw")
    public suspend fun backupRepeatingTimeIntervals(vararg values: Output) {
        this.backupRepeatingTimeIntervals = Output.all(values.asList())
    }

    /**
     * @param values Specifies a list of repeating time interval. It should follow `ISO 8601` repeating time interval. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("jwdyadrjeiqoctja")
    public suspend fun backupRepeatingTimeIntervals(values: List>) {
        this.backupRepeatingTimeIntervals = Output.all(values)
    }

    /**
     * @param value The name which should be used for this Backup Policy Blob Storage. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("eyapidigmxusufwm")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value The duration of operational default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("knqsdfeaqvctxaqi")
    public suspend fun operationalDefaultRetentionDuration(`value`: Output) {
        this.operationalDefaultRetentionDuration = value
    }

    /**
     * @param value Duration of deletion after given timespan. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** > `retention_duration` is deprecated in version 3.0 and will be removed in version 4.0 of the AzureRM Provider. Please use the `operational_default_retention_duration` instead.
     */
    @Deprecated(
        message = """
  This property has been renamed to `operational_default_retention_duration` and will be removed in
      v4.0 of the AzureRM provider
  """,
    )
    @JvmName("yfnrjlfmcmtnokcg")
    public suspend fun retentionDuration(`value`: Output) {
        this.retentionDuration = value
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("fdlrxiglhiiocsvj")
    public suspend fun retentionRules(`value`: Output>) {
        this.retentionRules = value
    }

    @JvmName("awikcibwjeloqjru")
    public suspend fun retentionRules(vararg values: Output) {
        this.retentionRules = Output.all(values.asList())
    }

    /**
     * @param values One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("fykelbbewrluysfq")
    public suspend fun retentionRules(values: List>) {
        this.retentionRules = Output.all(values)
    }

    /**
     * @param value Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("esmssyfdxwlgnqfe")
    public suspend fun timeZone(`value`: Output) {
        this.timeZone = value
    }

    /**
     * @param value The duration of vault default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `vault_default_retention_duration` also requires setting `backup_repeating_time_intervals`. At least one of `operational_default_retention_duration`, `retention_duration` or `vault_default_retention_duration` must be specified.
     */
    @JvmName("colfpsuhgejjftqd")
    public suspend fun vaultDefaultRetentionDuration(`value`: Output) {
        this.vaultDefaultRetentionDuration = value
    }

    /**
     * @param value The ID of the Backup Vault within which the Backup Policy Blob Storage should exist. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("nbiljjpqrnsqjxat")
    public suspend fun vaultId(`value`: Output) {
        this.vaultId = value
    }

    /**
     * @param value Specifies a list of repeating time interval. It should follow `ISO 8601` repeating time interval. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("nlveaupfnnwpjtis")
    public suspend fun backupRepeatingTimeIntervals(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backupRepeatingTimeIntervals = mapped
    }

    /**
     * @param values Specifies a list of repeating time interval. It should follow `ISO 8601` repeating time interval. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("diymjqflkbbvnhjx")
    public suspend fun backupRepeatingTimeIntervals(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.backupRepeatingTimeIntervals = mapped
    }

    /**
     * @param value The name which should be used for this Backup Policy Blob Storage. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("qixserofhwmmfpeb")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value The duration of operational default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("peyefqgadmyehtrb")
    public suspend fun operationalDefaultRetentionDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.operationalDefaultRetentionDuration = mapped
    }

    /**
     * @param value Duration of deletion after given timespan. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** > `retention_duration` is deprecated in version 3.0 and will be removed in version 4.0 of the AzureRM Provider. Please use the `operational_default_retention_duration` instead.
     */
    @Deprecated(
        message = """
  This property has been renamed to `operational_default_retention_duration` and will be removed in
      v4.0 of the AzureRM provider
  """,
    )
    @JvmName("josdvgarsgsgrdwj")
    public suspend fun retentionDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionDuration = mapped
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("rpelwtasfdkwjtal")
    public suspend fun retentionRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("nmffcuoncslhdcpb")
    public suspend fun retentionRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BackupPolicyBlobStorageRetentionRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("adtasqxsyagovrwq")
    public suspend fun retentionRules(vararg argument: suspend BackupPolicyBlobStorageRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BackupPolicyBlobStorageRetentionRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param argument One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("dxvclmtnovggaaqy")
    public suspend fun retentionRules(argument: suspend BackupPolicyBlobStorageRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            BackupPolicyBlobStorageRetentionRuleArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.retentionRules = mapped
    }

    /**
     * @param values One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `retention_rule` also requires setting `vault_default_retention_duration`.
     */
    @JvmName("gphbhjcmnqipshfm")
    public suspend fun retentionRules(vararg values: BackupPolicyBlobStorageRetentionRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.retentionRules = mapped
    }

    /**
     * @param value Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("rimwwhyvcplmqdsn")
    public suspend fun timeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeZone = mapped
    }

    /**
     * @param value The duration of vault default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Blob Storage to be created.
     * > **Note:** Setting `vault_default_retention_duration` also requires setting `backup_repeating_time_intervals`. At least one of `operational_default_retention_duration`, `retention_duration` or `vault_default_retention_duration` must be specified.
     */
    @JvmName("evarjubpcvfsxvsx")
    public suspend fun vaultDefaultRetentionDuration(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultDefaultRetentionDuration = mapped
    }

    /**
     * @param value The ID of the Backup Vault within which the Backup Policy Blob Storage should exist. Changing this forces a new Backup Policy Blob Storage to be created.
     */
    @JvmName("tnlnmukarqapiylw")
    public suspend fun vaultId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultId = mapped
    }

    internal fun build(): BackupPolicyBlobStorageArgs = BackupPolicyBlobStorageArgs(
        backupRepeatingTimeIntervals = backupRepeatingTimeIntervals,
        name = name,
        operationalDefaultRetentionDuration = operationalDefaultRetentionDuration,
        retentionDuration = retentionDuration,
        retentionRules = retentionRules,
        timeZone = timeZone,
        vaultDefaultRetentionDuration = vaultDefaultRetentionDuration,
        vaultId = vaultId,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy