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

com.pulumi.azure.dataprotection.kotlin.BackupPolicyKubernetesClusterArgs.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.dataprotection.kotlin

import com.pulumi.azure.dataprotection.BackupPolicyKubernetesClusterArgs.builder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyKubernetesClusterDefaultRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyKubernetesClusterDefaultRetentionRuleArgsBuilder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyKubernetesClusterRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyKubernetesClusterRetentionRuleArgsBuilder
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Manages a Backup Policy to back up Kubernetes Cluster.
 * ## Example Usage
 * 
 * ```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
 *   exampleBackupPolicyKubernetesCluster:
 *     type: azure:dataprotection:BackupPolicyKubernetesCluster
 *     name: example
 *     properties:
 *       name: example-backup-policy
 *       resourceGroupName: ${example.name}
 *       vaultName: ${exampleBackupVault.name}
 *       backupRepeatingTimeIntervals:
 *         - R/2021-05-23T02:30:00+00:00/P1W
 *       timeZone: India Standard Time
 *       defaultRetentionDuration: P4M
 *       retentionRules:
 *         - name: Daily
 *           priority: 25
 *           lifeCycles:
 *             - duration: P84D
 *               dataStoreType: OperationalStore
 *           criteria:
 *             absoluteCriteria: FirstOfDay
 *       defaultRetentionRule:
 *         lifeCycles:
 *           - duration: P7D
 *             dataStoreType: OperationalStore
 * ```
 * 
 * ## Import
 * Backup Policy Kubernetes Cluster's can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:dataprotection/backupPolicyKubernetesCluster:BackupPolicyKubernetesCluster 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 supports weekly back. It should follow `ISO 8601` repeating time interval. Changing this forces a new resource to be created.
 * @property defaultRetentionRule A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
 * @property name The name which should be used for the Backup Policy Kubernetes Cluster. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the Resource Group where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
 * @property retentionRules One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
 * @property timeZone Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new resource to be created.
 * @property vaultName The name of the Backup Vault where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
 */
public data class BackupPolicyKubernetesClusterArgs(
    public val backupRepeatingTimeIntervals: Output>? = null,
    public val defaultRetentionRule: Output? =
        null,
    public val name: Output? = null,
    public val resourceGroupName: Output? = null,
    public val retentionRules: Output>? = null,
    public val timeZone: Output? = null,
    public val vaultName: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.dataprotection.BackupPolicyKubernetesClusterArgs =
        com.pulumi.azure.dataprotection.BackupPolicyKubernetesClusterArgs.builder()
            .backupRepeatingTimeIntervals(
                backupRepeatingTimeIntervals?.applyValue({ args0 ->
                    args0.map({ args0 -> args0 })
                }),
            )
            .defaultRetentionRule(
                defaultRetentionRule?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .name(name?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .retentionRules(
                retentionRules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .timeZone(timeZone?.applyValue({ args0 -> args0 }))
            .vaultName(vaultName?.applyValue({ args0 -> args0 })).build()
}

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

    private var defaultRetentionRule: Output? =
        null

    private var name: Output? = null

    private var resourceGroupName: Output? = null

    private var retentionRules: Output>? = null

    private var timeZone: Output? = null

    private var vaultName: Output? = null

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

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

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

    /**
     * @param value A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("jlkmoidbusksijrb")
    public suspend fun defaultRetentionRule(`value`: Output) {
        this.defaultRetentionRule = value
    }

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

    /**
     * @param value The name of the Resource Group where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
     */
    @JvmName("smdtowhpseqbnkwg")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("rjcajskhwvpavyif")
    public suspend fun retentionRules(`value`: Output>) {
        this.retentionRules = value
    }

    @JvmName("fcdisjijsgykxayw")
    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 resource to be created.
     */
    @JvmName("hlsshcqbbswwijdd")
    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 resource to be created.
     */
    @JvmName("gbtrnaephiilsxlm")
    public suspend fun timeZone(`value`: Output) {
        this.timeZone = value
    }

    /**
     * @param value The name of the Backup Vault where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
     */
    @JvmName("fkmahauqqyqijvit")
    public suspend fun vaultName(`value`: Output) {
        this.vaultName = value
    }

    /**
     * @param value Specifies a list of repeating time interval. It supports weekly back. It should follow `ISO 8601` repeating time interval. Changing this forces a new resource to be created.
     */
    @JvmName("kwyesckjcsraantc")
    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 supports weekly back. It should follow `ISO 8601` repeating time interval. Changing this forces a new resource to be created.
     */
    @JvmName("gyantoqptototayr")
    public suspend fun backupRepeatingTimeIntervals(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.backupRepeatingTimeIntervals = mapped
    }

    /**
     * @param value A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("knwsfkodpavwsmdo")
    public suspend fun defaultRetentionRule(`value`: BackupPolicyKubernetesClusterDefaultRetentionRuleArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.defaultRetentionRule = mapped
    }

    /**
     * @param argument A `default_retention_rule` block as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("lyhkdiiuotphhjqu")
    public suspend fun defaultRetentionRule(argument: suspend BackupPolicyKubernetesClusterDefaultRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = BackupPolicyKubernetesClusterDefaultRetentionRuleArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.defaultRetentionRule = mapped
    }

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

    /**
     * @param value The name of the Resource Group where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
     */
    @JvmName("pwynonxasjwudcxf")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value One or more `retention_rule` blocks as defined below. Changing this forces a new resource to be created.
     */
    @JvmName("tamwwcdehtmvawxe")
    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 resource to be created.
     */
    @JvmName("gmnkfyevchwiywty")
    public suspend fun retentionRules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            BackupPolicyKubernetesClusterRetentionRuleArgsBuilder().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 resource to be created.
     */
    @JvmName("rwkqsqcqaomwcraq")
    public suspend fun retentionRules(vararg argument: suspend BackupPolicyKubernetesClusterRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            BackupPolicyKubernetesClusterRetentionRuleArgsBuilder().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 resource to be created.
     */
    @JvmName("jhmkqtgvxukpuqev")
    public suspend fun retentionRules(argument: suspend BackupPolicyKubernetesClusterRetentionRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            BackupPolicyKubernetesClusterRetentionRuleArgsBuilder().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 resource to be created.
     */
    @JvmName("mhtaofomnyngrgxe")
    public suspend fun retentionRules(vararg values: BackupPolicyKubernetesClusterRetentionRuleArgs) {
        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 resource to be created.
     */
    @JvmName("gftfmmtypigxijgs")
    public suspend fun timeZone(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.timeZone = mapped
    }

    /**
     * @param value The name of the Backup Vault where the Backup Policy Kubernetes Cluster should exist. Changing this forces a new resource to be created.
     */
    @JvmName("ninrwuqferyjkcyn")
    public suspend fun vaultName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.vaultName = mapped
    }

    internal fun build(): BackupPolicyKubernetesClusterArgs = BackupPolicyKubernetesClusterArgs(
        backupRepeatingTimeIntervals = backupRepeatingTimeIntervals,
        defaultRetentionRule = defaultRetentionRule,
        name = name,
        resourceGroupName = resourceGroupName,
        retentionRules = retentionRules,
        timeZone = timeZone,
        vaultName = vaultName,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy