Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.pulumi.azure.dataprotection.kotlin.BackupPolicyDiskArgs.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.dataprotection.kotlin
import com.pulumi.azure.dataprotection.BackupPolicyDiskArgs.builder
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyDiskRetentionRuleArgs
import com.pulumi.azure.dataprotection.kotlin.inputs.BackupPolicyDiskRetentionRuleArgsBuilder
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 Disk.
* ## 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 exampleBackupPolicyDisk = new azure.dataprotection.BackupPolicyDisk("example", {
* name: "example-backup-policy",
* vaultId: exampleBackupVault.id,
* backupRepeatingTimeIntervals: ["R/2021-05-19T06:33:16+00:00/PT4H"],
* defaultRetentionDuration: "P7D",
* timeZone: "W. Europe Standard Time",
* retentionRules: [
* {
* name: "Daily",
* duration: "P7D",
* priority: 25,
* criteria: {
* absoluteCriteria: "FirstOfDay",
* },
* },
* {
* name: "Weekly",
* duration: "P7D",
* priority: 20,
* criteria: {
* absoluteCriteria: "FirstOfWeek",
* },
* },
* ],
* });
* ```
* ```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_disk = azure.dataprotection.BackupPolicyDisk("example",
* name="example-backup-policy",
* vault_id=example_backup_vault.id,
* backup_repeating_time_intervals=["R/2021-05-19T06:33:16+00:00/PT4H"],
* default_retention_duration="P7D",
* time_zone="W. Europe Standard Time",
* retention_rules=[
* {
* "name": "Daily",
* "duration": "P7D",
* "priority": 25,
* "criteria": {
* "absolute_criteria": "FirstOfDay",
* },
* },
* {
* "name": "Weekly",
* "duration": "P7D",
* "priority": 20,
* "criteria": {
* "absolute_criteria": "FirstOfWeek",
* },
* },
* ])
* ```
* ```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 exampleBackupPolicyDisk = new Azure.DataProtection.BackupPolicyDisk("example", new()
* {
* Name = "example-backup-policy",
* VaultId = exampleBackupVault.Id,
* BackupRepeatingTimeIntervals = new[]
* {
* "R/2021-05-19T06:33:16+00:00/PT4H",
* },
* DefaultRetentionDuration = "P7D",
* TimeZone = "W. Europe Standard Time",
* RetentionRules = new[]
* {
* new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleArgs
* {
* Name = "Daily",
* Duration = "P7D",
* Priority = 25,
* Criteria = new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleCriteriaArgs
* {
* AbsoluteCriteria = "FirstOfDay",
* },
* },
* new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleArgs
* {
* Name = "Weekly",
* Duration = "P7D",
* Priority = 20,
* Criteria = new Azure.DataProtection.Inputs.BackupPolicyDiskRetentionRuleCriteriaArgs
* {
* AbsoluteCriteria = "FirstOfWeek",
* },
* },
* },
* });
* });
* ```
* ```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.NewBackupPolicyDisk(ctx, "example", &dataprotection.BackupPolicyDiskArgs{
* Name: pulumi.String("example-backup-policy"),
* VaultId: exampleBackupVault.ID(),
* BackupRepeatingTimeIntervals: pulumi.StringArray{
* pulumi.String("R/2021-05-19T06:33:16+00:00/PT4H"),
* },
* DefaultRetentionDuration: pulumi.String("P7D"),
* TimeZone: pulumi.String("W. Europe Standard Time"),
* RetentionRules: dataprotection.BackupPolicyDiskRetentionRuleArray{
* &dataprotection.BackupPolicyDiskRetentionRuleArgs{
* Name: pulumi.String("Daily"),
* Duration: pulumi.String("P7D"),
* Priority: pulumi.Int(25),
* Criteria: &dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs{
* AbsoluteCriteria: pulumi.String("FirstOfDay"),
* },
* },
* &dataprotection.BackupPolicyDiskRetentionRuleArgs{
* Name: pulumi.String("Weekly"),
* Duration: pulumi.String("P7D"),
* Priority: pulumi.Int(20),
* Criteria: &dataprotection.BackupPolicyDiskRetentionRuleCriteriaArgs{
* AbsoluteCriteria: pulumi.String("FirstOfWeek"),
* },
* },
* },
* })
* 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.BackupPolicyDisk;
* import com.pulumi.azure.dataprotection.BackupPolicyDiskArgs;
* import com.pulumi.azure.dataprotection.inputs.BackupPolicyDiskRetentionRuleArgs;
* import com.pulumi.azure.dataprotection.inputs.BackupPolicyDiskRetentionRuleCriteriaArgs;
* 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 exampleBackupPolicyDisk = new BackupPolicyDisk("exampleBackupPolicyDisk", BackupPolicyDiskArgs.builder()
* .name("example-backup-policy")
* .vaultId(exampleBackupVault.id())
* .backupRepeatingTimeIntervals("R/2021-05-19T06:33:16+00:00/PT4H")
* .defaultRetentionDuration("P7D")
* .timeZone("W. Europe Standard Time")
* .retentionRules(
* BackupPolicyDiskRetentionRuleArgs.builder()
* .name("Daily")
* .duration("P7D")
* .priority(25)
* .criteria(BackupPolicyDiskRetentionRuleCriteriaArgs.builder()
* .absoluteCriteria("FirstOfDay")
* .build())
* .build(),
* BackupPolicyDiskRetentionRuleArgs.builder()
* .name("Weekly")
* .duration("P7D")
* .priority(20)
* .criteria(BackupPolicyDiskRetentionRuleCriteriaArgs.builder()
* .absoluteCriteria("FirstOfWeek")
* .build())
* .build())
* .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
* exampleBackupPolicyDisk:
* type: azure:dataprotection:BackupPolicyDisk
* name: example
* properties:
* name: example-backup-policy
* vaultId: ${exampleBackupVault.id}
* backupRepeatingTimeIntervals:
* - R/2021-05-19T06:33:16+00:00/PT4H
* defaultRetentionDuration: P7D
* timeZone: W. Europe Standard Time
* retentionRules:
* - name: Daily
* duration: P7D
* priority: 25
* criteria:
* absoluteCriteria: FirstOfDay
* - name: Weekly
* duration: P7D
* priority: 20
* criteria:
* absoluteCriteria: FirstOfWeek
* ```
*
* ## Import
* Backup Policy Disks can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:dataprotection/backupPolicyDisk:BackupPolicyDisk 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 Disk to be created.
* @property defaultRetentionDuration The duration of default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Disk to be created.
* @property name The name which should be used for this Backup Policy Disk. Changing this forces a new Backup Policy Disk to be created.
* @property retentionRules One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Disk to be created.
* @property timeZone Specifies the Time Zone which should be used by the backup schedule. Changing this forces a new Backup Policy Disk to be created.
* @property vaultId The ID of the Backup Vault within which the Backup Policy Disk should exist. Changing this forces a new Backup Policy Disk to be created.
*/
public data class BackupPolicyDiskArgs(
public val backupRepeatingTimeIntervals: Output>? = null,
public val defaultRetentionDuration: Output? = null,
public val name: Output? = null,
public val retentionRules: Output>? = null,
public val timeZone: Output? = null,
public val vaultId: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.dataprotection.BackupPolicyDiskArgs =
com.pulumi.azure.dataprotection.BackupPolicyDiskArgs.builder()
.backupRepeatingTimeIntervals(
backupRepeatingTimeIntervals?.applyValue({ args0 ->
args0.map({ args0 -> args0 })
}),
)
.defaultRetentionDuration(defaultRetentionDuration?.applyValue({ args0 -> args0 }))
.name(name?.applyValue({ args0 -> args0 }))
.retentionRules(
retentionRules?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
})
}),
)
.timeZone(timeZone?.applyValue({ args0 -> args0 }))
.vaultId(vaultId?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [BackupPolicyDiskArgs].
*/
@PulumiTagMarker
public class BackupPolicyDiskArgsBuilder internal constructor() {
private var backupRepeatingTimeIntervals: Output>? = null
private var defaultRetentionDuration: Output? = null
private var name: Output? = null
private var retentionRules: Output>? = null
private var timeZone: 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 Disk to be created.
*/
@JvmName("nlkjuxcweefrfwdu")
public suspend fun backupRepeatingTimeIntervals(`value`: Output>) {
this.backupRepeatingTimeIntervals = value
}
@JvmName("gtdcilnjgqocrllq")
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 Disk to be created.
*/
@JvmName("hhbprdqqaqwqcmxt")
public suspend fun backupRepeatingTimeIntervals(values: List>) {
this.backupRepeatingTimeIntervals = Output.all(values)
}
/**
* @param value The duration of default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("jqwpasuthocpyhbm")
public suspend fun defaultRetentionDuration(`value`: Output) {
this.defaultRetentionDuration = value
}
/**
* @param value The name which should be used for this Backup Policy Disk. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("gekqrogsrpjgkitb")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("eicyhbaiewwvyalw")
public suspend fun retentionRules(`value`: Output>) {
this.retentionRules = value
}
@JvmName("ktfroxwbnqpiyghi")
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 Disk to be created.
*/
@JvmName("wrwtcofhhupaxmxi")
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 Disk to be created.
*/
@JvmName("xaqmoacbssmeppsy")
public suspend fun timeZone(`value`: Output) {
this.timeZone = value
}
/**
* @param value The ID of the Backup Vault within which the Backup Policy Disk should exist. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("yttyuqwfnyqtwkdt")
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 Disk to be created.
*/
@JvmName("xoahxolwwmfyrejq")
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 Disk to be created.
*/
@JvmName("jhnlnumfeuqysteb")
public suspend fun backupRepeatingTimeIntervals(vararg values: String) {
val toBeMapped = values.toList()
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.backupRepeatingTimeIntervals = mapped
}
/**
* @param value The duration of default retention rule. It should follow `ISO 8601` duration format. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("jtauvhscukskdpor")
public suspend fun defaultRetentionDuration(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.defaultRetentionDuration = mapped
}
/**
* @param value The name which should be used for this Backup Policy Disk. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("mftvwoqedmkeuueo")
public suspend fun name(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.name = mapped
}
/**
* @param value One or more `retention_rule` blocks as defined below. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("njvxvjidpeakqlnb")
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 Disk to be created.
*/
@JvmName("ydhvxyryxngexiwq")
public suspend fun retentionRules(argument: List Unit>) {
val toBeMapped = argument.toList().map {
BackupPolicyDiskRetentionRuleArgsBuilder().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 Disk to be created.
*/
@JvmName("isqjxxovapmrbmfy")
public suspend fun retentionRules(vararg argument: suspend BackupPolicyDiskRetentionRuleArgsBuilder.() -> Unit) {
val toBeMapped = argument.toList().map {
BackupPolicyDiskRetentionRuleArgsBuilder().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 Disk to be created.
*/
@JvmName("upwcocpqiefpirmb")
public suspend fun retentionRules(argument: suspend BackupPolicyDiskRetentionRuleArgsBuilder.() -> Unit) {
val toBeMapped = listOf(
BackupPolicyDiskRetentionRuleArgsBuilder().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 Disk to be created.
*/
@JvmName("oacutiulxafvfcwt")
public suspend fun retentionRules(vararg values: BackupPolicyDiskRetentionRuleArgs) {
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 Disk to be created.
*/
@JvmName("hhhgusourjarxclg")
public suspend fun timeZone(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.timeZone = mapped
}
/**
* @param value The ID of the Backup Vault within which the Backup Policy Disk should exist. Changing this forces a new Backup Policy Disk to be created.
*/
@JvmName("txbasgvxebrparlt")
public suspend fun vaultId(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.vaultId = mapped
}
internal fun build(): BackupPolicyDiskArgs = BackupPolicyDiskArgs(
backupRepeatingTimeIntervals = backupRepeatingTimeIntervals,
defaultRetentionDuration = defaultRetentionDuration,
name = name,
retentionRules = retentionRules,
timeZone = timeZone,
vaultId = vaultId,
)
}