com.pulumi.azure.backup.kotlin.PolicyVMWorkloadArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.backup.kotlin
import com.pulumi.azure.backup.PolicyVMWorkloadArgs.builder
import com.pulumi.azure.backup.kotlin.inputs.PolicyVMWorkloadProtectionPolicyArgs
import com.pulumi.azure.backup.kotlin.inputs.PolicyVMWorkloadProtectionPolicyArgsBuilder
import com.pulumi.azure.backup.kotlin.inputs.PolicyVMWorkloadSettingsArgs
import com.pulumi.azure.backup.kotlin.inputs.PolicyVMWorkloadSettingsArgsBuilder
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 an Azure VM Workload Backup Policy within a Recovery Services vault.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = new azure.core.ResourceGroup("example", {
* name: "example-bpvmw",
* location: "West Europe",
* });
* const exampleVault = new azure.recoveryservices.Vault("example", {
* name: "example-rsv",
* location: example.location,
* resourceGroupName: example.name,
* sku: "Standard",
* softDeleteEnabled: false,
* });
* const examplePolicyVMWorkload = new azure.backup.PolicyVMWorkload("example", {
* name: "example-bpvmw",
* resourceGroupName: example.name,
* recoveryVaultName: exampleVault.name,
* workloadType: "SQLDataBase",
* settings: {
* timeZone: "UTC",
* compressionEnabled: false,
* },
* protectionPolicies: [
* {
* policyType: "Full",
* backup: {
* frequency: "Daily",
* time: "15:00",
* },
* retentionDaily: {
* count: 8,
* },
* },
* {
* policyType: "Log",
* backup: {
* frequencyInMinutes: 15,
* },
* simpleRetention: {
* count: 8,
* },
* },
* ],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-bpvmw",
* location="West Europe")
* example_vault = azure.recoveryservices.Vault("example",
* name="example-rsv",
* location=example.location,
* resource_group_name=example.name,
* sku="Standard",
* soft_delete_enabled=False)
* example_policy_vm_workload = azure.backup.PolicyVMWorkload("example",
* name="example-bpvmw",
* resource_group_name=example.name,
* recovery_vault_name=example_vault.name,
* workload_type="SQLDataBase",
* settings=azure.backup.PolicyVMWorkloadSettingsArgs(
* time_zone="UTC",
* compression_enabled=False,
* ),
* protection_policies=[
* azure.backup.PolicyVMWorkloadProtectionPolicyArgs(
* policy_type="Full",
* backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs(
* frequency="Daily",
* time="15:00",
* ),
* retention_daily=azure.backup.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs(
* count=8,
* ),
* ),
* azure.backup.PolicyVMWorkloadProtectionPolicyArgs(
* policy_type="Log",
* backup=azure.backup.PolicyVMWorkloadProtectionPolicyBackupArgs(
* frequency_in_minutes=15,
* ),
* simple_retention=azure.backup.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs(
* count=8,
* ),
* ),
* ])
* ```
* ```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-bpvmw",
* Location = "West Europe",
* });
* var exampleVault = new Azure.RecoveryServices.Vault("example", new()
* {
* Name = "example-rsv",
* Location = example.Location,
* ResourceGroupName = example.Name,
* Sku = "Standard",
* SoftDeleteEnabled = false,
* });
* var examplePolicyVMWorkload = new Azure.Backup.PolicyVMWorkload("example", new()
* {
* Name = "example-bpvmw",
* ResourceGroupName = example.Name,
* RecoveryVaultName = exampleVault.Name,
* WorkloadType = "SQLDataBase",
* Settings = new Azure.Backup.Inputs.PolicyVMWorkloadSettingsArgs
* {
* TimeZone = "UTC",
* CompressionEnabled = false,
* },
* ProtectionPolicies = new[]
* {
* new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyArgs
* {
* PolicyType = "Full",
* Backup = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyBackupArgs
* {
* Frequency = "Daily",
* Time = "15:00",
* },
* RetentionDaily = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs
* {
* Count = 8,
* },
* },
* new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyArgs
* {
* PolicyType = "Log",
* Backup = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicyBackupArgs
* {
* FrequencyInMinutes = 15,
* },
* SimpleRetention = new Azure.Backup.Inputs.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs
* {
* Count = 8,
* },
* },
* },
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/backup"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/recoveryservices"
* "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-bpvmw"),
* Location: pulumi.String("West Europe"),
* })
* if err != nil {
* return err
* }
* exampleVault, err := recoveryservices.NewVault(ctx, "example", &recoveryservices.VaultArgs{
* Name: pulumi.String("example-rsv"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* Sku: pulumi.String("Standard"),
* SoftDeleteEnabled: pulumi.Bool(false),
* })
* if err != nil {
* return err
* }
* _, err = backup.NewPolicyVMWorkload(ctx, "example", &backup.PolicyVMWorkloadArgs{
* Name: pulumi.String("example-bpvmw"),
* ResourceGroupName: example.Name,
* RecoveryVaultName: exampleVault.Name,
* WorkloadType: pulumi.String("SQLDataBase"),
* Settings: &backup.PolicyVMWorkloadSettingsArgs{
* TimeZone: pulumi.String("UTC"),
* CompressionEnabled: pulumi.Bool(false),
* },
* ProtectionPolicies: backup.PolicyVMWorkloadProtectionPolicyArray{
* &backup.PolicyVMWorkloadProtectionPolicyArgs{
* PolicyType: pulumi.String("Full"),
* Backup: &backup.PolicyVMWorkloadProtectionPolicyBackupArgs{
* Frequency: pulumi.String("Daily"),
* Time: pulumi.String("15:00"),
* },
* RetentionDaily: &backup.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs{
* Count: pulumi.Int(8),
* },
* },
* &backup.PolicyVMWorkloadProtectionPolicyArgs{
* PolicyType: pulumi.String("Log"),
* Backup: &backup.PolicyVMWorkloadProtectionPolicyBackupArgs{
* FrequencyInMinutes: pulumi.Int(15),
* },
* SimpleRetention: &backup.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs{
* Count: pulumi.Int(8),
* },
* },
* },
* })
* 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.backup.PolicyVMWorkload;
* import com.pulumi.azure.backup.PolicyVMWorkloadArgs;
* import com.pulumi.azure.backup.inputs.PolicyVMWorkloadSettingsArgs;
* import com.pulumi.azure.backup.inputs.PolicyVMWorkloadProtectionPolicyArgs;
* import com.pulumi.azure.backup.inputs.PolicyVMWorkloadProtectionPolicyBackupArgs;
* import com.pulumi.azure.backup.inputs.PolicyVMWorkloadProtectionPolicyRetentionDailyArgs;
* import com.pulumi.azure.backup.inputs.PolicyVMWorkloadProtectionPolicySimpleRetentionArgs;
* 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-bpvmw")
* .location("West Europe")
* .build());
* var exampleVault = new Vault("exampleVault", VaultArgs.builder()
* .name("example-rsv")
* .location(example.location())
* .resourceGroupName(example.name())
* .sku("Standard")
* .softDeleteEnabled(false)
* .build());
* var examplePolicyVMWorkload = new PolicyVMWorkload("examplePolicyVMWorkload", PolicyVMWorkloadArgs.builder()
* .name("example-bpvmw")
* .resourceGroupName(example.name())
* .recoveryVaultName(exampleVault.name())
* .workloadType("SQLDataBase")
* .settings(PolicyVMWorkloadSettingsArgs.builder()
* .timeZone("UTC")
* .compressionEnabled(false)
* .build())
* .protectionPolicies(
* PolicyVMWorkloadProtectionPolicyArgs.builder()
* .policyType("Full")
* .backup(PolicyVMWorkloadProtectionPolicyBackupArgs.builder()
* .frequency("Daily")
* .time("15:00")
* .build())
* .retentionDaily(PolicyVMWorkloadProtectionPolicyRetentionDailyArgs.builder()
* .count(8)
* .build())
* .build(),
* PolicyVMWorkloadProtectionPolicyArgs.builder()
* .policyType("Log")
* .backup(PolicyVMWorkloadProtectionPolicyBackupArgs.builder()
* .frequencyInMinutes(15)
* .build())
* .simpleRetention(PolicyVMWorkloadProtectionPolicySimpleRetentionArgs.builder()
* .count(8)
* .build())
* .build())
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-bpvmw
* location: West Europe
* exampleVault:
* type: azure:recoveryservices:Vault
* name: example
* properties:
* name: example-rsv
* location: ${example.location}
* resourceGroupName: ${example.name}
* sku: Standard
* softDeleteEnabled: false
* examplePolicyVMWorkload:
* type: azure:backup:PolicyVMWorkload
* name: example
* properties:
* name: example-bpvmw
* resourceGroupName: ${example.name}
* recoveryVaultName: ${exampleVault.name}
* workloadType: SQLDataBase
* settings:
* timeZone: UTC
* compressionEnabled: false
* protectionPolicies:
* - policyType: Full
* backup:
* frequency: Daily
* time: 15:00
* retentionDaily:
* count: 8
* - policyType: Log
* backup:
* frequencyInMinutes: 15
* simpleRetention:
* count: 8
* ```
*
* ## Import
* Azure VM Workload Backup Policies can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:backup/policyVMWorkload:PolicyVMWorkload policy1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.RecoveryServices/vaults/vault1/backupPolicies/policy1
* ```
* @property name The name of the VM Workload Backup Policy. Changing this forces a new resource to be created.
* @property protectionPolicies One or more `protection_policy` blocks as defined below.
* @property recoveryVaultName The name of the Recovery Services Vault to use. Changing this forces a new resource to be created.
* @property resourceGroupName The name of the resource group in which to create the VM Workload Backup Policy. Changing this forces a new resource to be created.
* @property settings A `settings` block as defined below.
* @property workloadType The VM Workload type for the Backup Policy. Possible values are `SQLDataBase` and `SAPHanaDatabase`. Changing this forces a new resource to be created.
*/
public data class PolicyVMWorkloadArgs(
public val name: Output? = null,
public val protectionPolicies: Output>? = null,
public val recoveryVaultName: Output? = null,
public val resourceGroupName: Output? = null,
public val settings: Output? = null,
public val workloadType: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azure.backup.PolicyVMWorkloadArgs =
com.pulumi.azure.backup.PolicyVMWorkloadArgs.builder()
.name(name?.applyValue({ args0 -> args0 }))
.protectionPolicies(
protectionPolicies?.applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 -> args0.toJava() })
})
}),
)
.recoveryVaultName(recoveryVaultName?.applyValue({ args0 -> args0 }))
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
.settings(settings?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
.workloadType(workloadType?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [PolicyVMWorkloadArgs].
*/
@PulumiTagMarker
public class PolicyVMWorkloadArgsBuilder internal constructor() {
private var name: Output? = null
private var protectionPolicies: Output>? = null
private var recoveryVaultName: Output? = null
private var resourceGroupName: Output? = null
private var settings: Output? = null
private var workloadType: Output? = null
/**
* @param value The name of the VM Workload Backup Policy. Changing this forces a new resource to be created.
*/
@JvmName("qxkxayoeemupvjkv")
public suspend fun name(`value`: Output) {
this.name = value
}
/**
* @param value One or more `protection_policy` blocks as defined below.
*/
@JvmName("pjayiuluodyralov")
public suspend
fun protectionPolicies(`value`: Output>) {
this.protectionPolicies = value
}
@JvmName("jkaiblpcahlbbpwi")
public suspend fun protectionPolicies(
vararg
values: Output,
) {
this.protectionPolicies = Output.all(values.asList())
}
/**
* @param values One or more `protection_policy` blocks as defined below.
*/
@JvmName("tnxuexbtrkuxycap")
public suspend
fun protectionPolicies(values: List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy