Base class for backup policy. Workload-specific backup policies are derived from this class.
Uses Azure REST API version 2024-10-01. In version 2.x of the Azure Native provider, it used API version 2023-04-01.
Other available API versions: 2023-02-01, 2023-04-01, 2023-06-01, 2023-08-01, 2024-01-01, 2024-02-01, 2024-04-01, 2024-04-30-preview, 2024-07-30-preview, 2024-11-01-preview, 2025-01-01, 2025-02-01, 2025-02-28-preview, 2025-08-01, 2026-01-01, 2026-01-31-preview, 2026-02-01, 2026-03-31-preview, 2026-05-01, 2026-05-31-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native recoveryservices [ApiVersion]. See the version guide for details.
Example Usage
Create or Update Azure Storage Vault Standard Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "newPolicyV2",
Properties = new AzureNative.RecoveryServices.Inputs.AzureFileShareProtectionPolicyArgs
{
BackupManagementType = "AzureStorage",
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Daily,
ScheduleRunTimes = new[]
{
"2023-07-18T09:30:00.000Z",
},
},
TimeZone = "UTC",
VaultRetentionPolicy = new AzureNative.RecoveryServices.Inputs.VaultRetentionPolicyArgs
{
SnapshotRetentionInDays = 5,
VaultRetention = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 30,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionTimes = new[]
{
"2023-07-18T09:30:00.000Z",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 60,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2023-07-18T09:30:00.000Z",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 12,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2023-07-18T09:30:00.000Z",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 10,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2023-07-18T09:30:00.000Z",
},
},
},
},
WorkLoadType = AzureNative.RecoveryServices.WorkloadType.AzureFileShare,
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "swaggertestvault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("newPolicyV2"),
Properties: &recoveryservices.AzureFileShareProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureStorage"),
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeDaily),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2023-07-18T09:30:00.000Z"),
},
},
TimeZone: pulumi.String("UTC"),
VaultRetentionPolicy: &recoveryservices.VaultRetentionPolicyArgs{
SnapshotRetentionInDays: pulumi.Int(5),
VaultRetention: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(30),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2023-07-18T09:30:00.000Z"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(60),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2023-07-18T09:30:00.000Z"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(12),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2023-07-18T09:30:00.000Z"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(10),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2023-07-18T09:30:00.000Z"),
},
},
},
},
WorkLoadType: pulumi.String(recoveryservices.WorkloadTypeAzureFileShare),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("swaggertestvault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "newPolicyV2"
properties = {
backup_management_type = "AzureStorage"
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_frequency = "Daily"
schedule_run_times = ["2023-07-18T09:30:00.000Z"]
}
time_zone = "UTC"
vault_retention_policy = {
snapshot_retention_in_days = 5
vault_retention = {
daily_schedule = {
retention_duration = {
count = 30
duration_type = "Days"
}
retention_times = ["2023-07-18T09:30:00.000Z"]
}
monthly_schedule = {
retention_duration = {
count = 60
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2023-07-18T09:30:00.000Z"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 12
duration_type = "Weeks"
}
retention_times = ["2023-07-18T09:30:00.000Z"]
}
yearly_schedule = {
months_of_year = ["January"]
retention_duration = {
count = 10
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2023-07-18T09:30:00.000Z"]
}
}
}
work_load_type = "AzureFileShare"
}
resource_group_name = "SwaggerTestRg"
vault_name = "swaggertestvault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.VaultRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("newPolicyV2")
.properties(AzureFileShareProtectionPolicyArgs.builder()
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunFrequency("Daily")
.scheduleRunTimes("2023-07-18T09:30:00.000Z")
.build())
.timeZone("UTC")
.vaultRetentionPolicy(VaultRetentionPolicyArgs.builder()
.snapshotRetentionInDays(5)
.vaultRetention(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(30)
.durationType("Days")
.build())
.retentionTimes("2023-07-18T09:30:00.000Z")
.build())
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(60)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2023-07-18T09:30:00.000Z")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(RetentionDurationArgs.builder()
.count(12)
.durationType("Weeks")
.build())
.retentionTimes("2023-07-18T09:30:00.000Z")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear("January")
.retentionDuration(RetentionDurationArgs.builder()
.count(10)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2023-07-18T09:30:00.000Z")
.build())
.build())
.build())
.workLoadType("AzureFileShare")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("swaggertestvault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "newPolicyV2",
properties: {
backupManagementType: "AzureStorage",
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Daily,
scheduleRunTimes: ["2023-07-18T09:30:00.000Z"],
},
timeZone: "UTC",
vaultRetentionPolicy: {
snapshotRetentionInDays: 5,
vaultRetention: {
dailySchedule: {
retentionDuration: {
count: 30,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionTimes: ["2023-07-18T09:30:00.000Z"],
},
monthlySchedule: {
retentionDuration: {
count: 60,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2023-07-18T09:30:00.000Z"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 12,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2023-07-18T09:30:00.000Z"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.January],
retentionDuration: {
count: 10,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2023-07-18T09:30:00.000Z"],
},
},
},
workLoadType: azure_native.recoveryservices.WorkloadType.AzureFileShare,
},
resourceGroupName: "SwaggerTestRg",
vaultName: "swaggertestvault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="newPolicyV2",
properties={
"backup_management_type": "AzureStorage",
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.DAILY,
"schedule_run_times": ["2023-07-18T09:30:00.000Z"],
},
"time_zone": "UTC",
"vault_retention_policy": {
"snapshot_retention_in_days": 5,
"vault_retention": {
"daily_schedule": {
"retention_duration": {
"count": 30,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_times": ["2023-07-18T09:30:00.000Z"],
},
"monthly_schedule": {
"retention_duration": {
"count": 60,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2023-07-18T09:30:00.000Z"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 12,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2023-07-18T09:30:00.000Z"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.JANUARY],
"retention_duration": {
"count": 10,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2023-07-18T09:30:00.000Z"],
},
},
},
"work_load_type": azure_native.recoveryservices.WorkloadType.AZURE_FILE_SHARE,
},
resource_group_name="SwaggerTestRg",
vault_name="swaggertestvault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: newPolicyV2
properties:
backupManagementType: AzureStorage
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunFrequency: Daily
scheduleRunTimes:
- 2023-07-18T09:30:00.000Z
timeZone: UTC
vaultRetentionPolicy:
snapshotRetentionInDays: 5
vaultRetention:
dailySchedule:
retentionDuration:
count: 30
durationType: Days
retentionTimes:
- 2023-07-18T09:30:00.000Z
monthlySchedule:
retentionDuration:
count: 60
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2023-07-18T09:30:00.000Z
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 12
durationType: Weeks
retentionTimes:
- 2023-07-18T09:30:00.000Z
yearlySchedule:
monthsOfYear:
- January
retentionDuration:
count: 10
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2023-07-18T09:30:00.000Z
workLoadType: AzureFileShare
resourceGroupName: SwaggerTestRg
vaultName: swaggertestvault
Create or Update Daily Azure Storage Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "dailyPolicy2",
Properties = new AzureNative.RecoveryServices.Inputs.AzureFileShareProtectionPolicyArgs
{
BackupManagementType = "AzureStorage",
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 5,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionTimes = new[]
{
"2021-09-29T08:00:00.000Z",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 60,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-09-29T08:00:00.000Z",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 12,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2021-09-29T08:00:00.000Z",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 10,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-09-29T08:00:00.000Z",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Daily,
ScheduleRunTimes = new[]
{
"2021-09-29T08:00:00.000Z",
},
},
TimeZone = "UTC",
WorkLoadType = AzureNative.RecoveryServices.WorkloadType.AzureFileShare,
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "swaggertestvault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("dailyPolicy2"),
Properties: &recoveryservices.AzureFileShareProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureStorage"),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(5),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-09-29T08:00:00.000Z"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(60),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-09-29T08:00:00.000Z"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(12),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-09-29T08:00:00.000Z"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(10),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-09-29T08:00:00.000Z"),
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeDaily),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2021-09-29T08:00:00.000Z"),
},
},
TimeZone: pulumi.String("UTC"),
WorkLoadType: pulumi.String(recoveryservices.WorkloadTypeAzureFileShare),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("swaggertestvault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "dailyPolicy2"
properties = {
backup_management_type = "AzureStorage"
retention_policy = {
daily_schedule = {
retention_duration = {
count = 5
duration_type = "Days"
}
retention_times = ["2021-09-29T08:00:00.000Z"]
}
monthly_schedule = {
retention_duration = {
count = 60
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-09-29T08:00:00.000Z"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 12
duration_type = "Weeks"
}
retention_times = ["2021-09-29T08:00:00.000Z"]
}
yearly_schedule = {
months_of_year = ["January"]
retention_duration = {
count = 10
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-09-29T08:00:00.000Z"]
}
}
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_frequency = "Daily"
schedule_run_times = ["2021-09-29T08:00:00.000Z"]
}
time_zone = "UTC"
work_load_type = "AzureFileShare"
}
resource_group_name = "SwaggerTestRg"
vault_name = "swaggertestvault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("dailyPolicy2")
.properties(AzureFileShareProtectionPolicyArgs.builder()
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(5)
.durationType("Days")
.build())
.retentionTimes("2021-09-29T08:00:00.000Z")
.build())
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(60)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-09-29T08:00:00.000Z")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(RetentionDurationArgs.builder()
.count(12)
.durationType("Weeks")
.build())
.retentionTimes("2021-09-29T08:00:00.000Z")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear("January")
.retentionDuration(RetentionDurationArgs.builder()
.count(10)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-09-29T08:00:00.000Z")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunFrequency("Daily")
.scheduleRunTimes("2021-09-29T08:00:00.000Z")
.build())
.timeZone("UTC")
.workLoadType("AzureFileShare")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("swaggertestvault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "dailyPolicy2",
properties: {
backupManagementType: "AzureStorage",
retentionPolicy: {
dailySchedule: {
retentionDuration: {
count: 5,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionTimes: ["2021-09-29T08:00:00.000Z"],
},
monthlySchedule: {
retentionDuration: {
count: 60,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-09-29T08:00:00.000Z"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 12,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2021-09-29T08:00:00.000Z"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.January],
retentionDuration: {
count: 10,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-09-29T08:00:00.000Z"],
},
},
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Daily,
scheduleRunTimes: ["2021-09-29T08:00:00.000Z"],
},
timeZone: "UTC",
workLoadType: azure_native.recoveryservices.WorkloadType.AzureFileShare,
},
resourceGroupName: "SwaggerTestRg",
vaultName: "swaggertestvault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="dailyPolicy2",
properties={
"backup_management_type": "AzureStorage",
"retention_policy": {
"daily_schedule": {
"retention_duration": {
"count": 5,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_times": ["2021-09-29T08:00:00.000Z"],
},
"monthly_schedule": {
"retention_duration": {
"count": 60,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-09-29T08:00:00.000Z"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 12,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2021-09-29T08:00:00.000Z"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.JANUARY],
"retention_duration": {
"count": 10,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-09-29T08:00:00.000Z"],
},
},
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.DAILY,
"schedule_run_times": ["2021-09-29T08:00:00.000Z"],
},
"time_zone": "UTC",
"work_load_type": azure_native.recoveryservices.WorkloadType.AZURE_FILE_SHARE,
},
resource_group_name="SwaggerTestRg",
vault_name="swaggertestvault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: dailyPolicy2
properties:
backupManagementType: AzureStorage
retentionPolicy:
dailySchedule:
retentionDuration:
count: 5
durationType: Days
retentionTimes:
- 2021-09-29T08:00:00.000Z
monthlySchedule:
retentionDuration:
count: 60
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-09-29T08:00:00.000Z
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 12
durationType: Weeks
retentionTimes:
- 2021-09-29T08:00:00.000Z
yearlySchedule:
monthsOfYear:
- January
retentionDuration:
count: 10
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-09-29T08:00:00.000Z
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunFrequency: Daily
scheduleRunTimes:
- 2021-09-29T08:00:00.000Z
timeZone: UTC
workLoadType: AzureFileShare
resourceGroupName: SwaggerTestRg
vaultName: swaggertestvault
Create or Update Enhanced Azure Vm Protection Policy with Hourly backup
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "v2-daily-sample",
Properties = new AzureNative.RecoveryServices.Inputs.AzureIaaSVMProtectionPolicyArgs
{
BackupManagementType = "AzureIaasVM",
InstantRpRetentionRangeInDays = 30,
PolicyType = AzureNative.RecoveryServices.IAASVMPolicyType.V2,
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 180,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 60,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 12,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 10,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyV2Args
{
HourlySchedule = new AzureNative.RecoveryServices.Inputs.HourlyScheduleArgs
{
Interval = 4,
ScheduleWindowDuration = 16,
ScheduleWindowStartTime = "2021-12-17T08:00:00Z",
},
SchedulePolicyType = "SimpleSchedulePolicyV2",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Hourly,
},
SnapshotConsistencyType = AzureNative.RecoveryServices.IaasVMSnapshotConsistencyType.OnlyCrashConsistent,
TimeZone = "India Standard Time",
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "NetSDKTestRsVault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("v2-daily-sample"),
Properties: &recoveryservices.AzureIaaSVMProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureIaasVM"),
InstantRpRetentionRangeInDays: pulumi.Int(30),
PolicyType: pulumi.String(recoveryservices.IAASVMPolicyTypeV2),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(180),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(60),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(12),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(10),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyV2Args{
HourlySchedule: &recoveryservices.HourlyScheduleArgs{
Interval: pulumi.Int(4),
ScheduleWindowDuration: pulumi.Int(16),
ScheduleWindowStartTime: pulumi.String("2021-12-17T08:00:00Z"),
},
SchedulePolicyType: pulumi.String("SimpleSchedulePolicyV2"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeHourly),
},
SnapshotConsistencyType: pulumi.String(recoveryservices.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent),
TimeZone: pulumi.String("India Standard Time"),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("NetSDKTestRsVault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "v2-daily-sample"
properties = {
backup_management_type = "AzureIaasVM"
instant_rp_retention_range_in_days = 30
policy_type = "V2"
retention_policy = {
daily_schedule = {
retention_duration = {
count = 180
duration_type = "Days"
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
monthly_schedule = {
retention_duration = {
count = 60
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 12
duration_type = "Weeks"
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
yearly_schedule = {
months_of_year = ["January"]
retention_duration = {
count = 10
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
}
schedule_policy = {
hourly_schedule = {
interval = 4
schedule_window_duration = 16
schedule_window_start_time = "2021-12-17T08:00:00Z"
}
schedule_policy_type = "SimpleSchedulePolicyV2"
schedule_run_frequency = "Hourly"
}
snapshot_consistency_type = "OnlyCrashConsistent"
time_zone = "India Standard Time"
}
resource_group_name = "SwaggerTestRg"
vault_name = "NetSDKTestRsVault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.HourlyScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("v2-daily-sample")
.properties(AzureIaaSVMProtectionPolicyArgs.builder()
.instantRpRetentionRangeInDays(30)
.policyType("V2")
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(180)
.durationType("Days")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(60)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(RetentionDurationArgs.builder()
.count(12)
.durationType("Weeks")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear("January")
.retentionDuration(RetentionDurationArgs.builder()
.count(10)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyV2Args.builder()
.hourlySchedule(HourlyScheduleArgs.builder()
.interval(4)
.scheduleWindowDuration(16)
.scheduleWindowStartTime("2021-12-17T08:00:00Z")
.build())
.scheduleRunFrequency("Hourly")
.build())
.snapshotConsistencyType("OnlyCrashConsistent")
.timeZone("India Standard Time")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("NetSDKTestRsVault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "v2-daily-sample",
properties: {
backupManagementType: "AzureIaasVM",
instantRpRetentionRangeInDays: 30,
policyType: azure_native.recoveryservices.IAASVMPolicyType.V2,
retentionPolicy: {
dailySchedule: {
retentionDuration: {
count: 180,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
monthlySchedule: {
retentionDuration: {
count: 60,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 12,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.January],
retentionDuration: {
count: 10,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
},
schedulePolicy: {
hourlySchedule: {
interval: 4,
scheduleWindowDuration: 16,
scheduleWindowStartTime: "2021-12-17T08:00:00Z",
},
schedulePolicyType: "SimpleSchedulePolicyV2",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Hourly,
},
snapshotConsistencyType: azure_native.recoveryservices.IaasVMSnapshotConsistencyType.OnlyCrashConsistent,
timeZone: "India Standard Time",
},
resourceGroupName: "SwaggerTestRg",
vaultName: "NetSDKTestRsVault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="v2-daily-sample",
properties={
"backup_management_type": "AzureIaasVM",
"instant_rp_retention_range_in_days": 30,
"policy_type": azure_native.recoveryservices.IAASVMPolicyType.V2,
"retention_policy": {
"daily_schedule": {
"retention_duration": {
"count": 180,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"monthly_schedule": {
"retention_duration": {
"count": 60,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 12,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.JANUARY],
"retention_duration": {
"count": 10,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
},
"schedule_policy": {
"hourly_schedule": {
"interval": 4,
"schedule_window_duration": 16,
"schedule_window_start_time": "2021-12-17T08:00:00Z",
},
"schedule_policy_type": "SimpleSchedulePolicyV2",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.HOURLY,
},
"snapshot_consistency_type": azure_native.recoveryservices.IaasVMSnapshotConsistencyType.ONLY_CRASH_CONSISTENT,
"time_zone": "India Standard Time",
},
resource_group_name="SwaggerTestRg",
vault_name="NetSDKTestRsVault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: v2-daily-sample
properties:
backupManagementType: AzureIaasVM
instantRpRetentionRangeInDays: 30
policyType: V2
retentionPolicy:
dailySchedule:
retentionDuration:
count: 180
durationType: Days
retentionTimes:
- 2021-12-17T08:00:00+00:00
monthlySchedule:
retentionDuration:
count: 60
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-12-17T08:00:00+00:00
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 12
durationType: Weeks
retentionTimes:
- 2021-12-17T08:00:00+00:00
yearlySchedule:
monthsOfYear:
- January
retentionDuration:
count: 10
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-12-17T08:00:00+00:00
schedulePolicy:
hourlySchedule:
interval: 4
scheduleWindowDuration: 16
scheduleWindowStartTime: 2021-12-17T08:00:00Z
schedulePolicyType: SimpleSchedulePolicyV2
scheduleRunFrequency: Hourly
snapshotConsistencyType: OnlyCrashConsistent
timeZone: India Standard Time
resourceGroupName: SwaggerTestRg
vaultName: NetSDKTestRsVault
Create or Update Enhanced Azure Vm Protection Policy with daily backup
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "v2-daily-sample",
Properties = new AzureNative.RecoveryServices.Inputs.AzureIaaSVMProtectionPolicyArgs
{
BackupManagementType = "AzureIaasVM",
InstantRpRetentionRangeInDays = 30,
PolicyType = AzureNative.RecoveryServices.IAASVMPolicyType.V2,
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 180,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 60,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 12,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 10,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"2021-12-17T08:00:00+00:00",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyV2Args
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyScheduleArgs
{
ScheduleRunTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
SchedulePolicyType = "SimpleSchedulePolicyV2",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Daily,
},
SnapshotConsistencyType = AzureNative.RecoveryServices.IaasVMSnapshotConsistencyType.OnlyCrashConsistent,
TimeZone = "India Standard Time",
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "NetSDKTestRsVault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("v2-daily-sample"),
Properties: &recoveryservices.AzureIaaSVMProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureIaasVM"),
InstantRpRetentionRangeInDays: pulumi.Int(30),
PolicyType: pulumi.String(recoveryservices.IAASVMPolicyTypeV2),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(180),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(60),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(12),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(10),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2021-12-17T08:00:00+00:00"),
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyV2Args{
DailySchedule: &recoveryservices.DailyScheduleArgs{
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
SchedulePolicyType: pulumi.String("SimpleSchedulePolicyV2"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeDaily),
},
SnapshotConsistencyType: pulumi.String(recoveryservices.IaasVMSnapshotConsistencyTypeOnlyCrashConsistent),
TimeZone: pulumi.String("India Standard Time"),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("NetSDKTestRsVault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "v2-daily-sample"
properties = {
backup_management_type = "AzureIaasVM"
instant_rp_retention_range_in_days = 30
policy_type = "V2"
retention_policy = {
daily_schedule = {
retention_duration = {
count = 180
duration_type = "Days"
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
monthly_schedule = {
retention_duration = {
count = 60
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 12
duration_type = "Weeks"
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
yearly_schedule = {
months_of_year = ["January"]
retention_duration = {
count = 10
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["2021-12-17T08:00:00+00:00"]
}
}
schedule_policy = {
daily_schedule = {
schedule_run_times = ["2018-01-24T10:00:00Z"]
}
schedule_policy_type = "SimpleSchedulePolicyV2"
schedule_run_frequency = "Daily"
}
snapshot_consistency_type = "OnlyCrashConsistent"
time_zone = "India Standard Time"
}
resource_group_name = "SwaggerTestRg"
vault_name = "NetSDKTestRsVault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.DailyScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("v2-daily-sample")
.properties(AzureIaaSVMProtectionPolicyArgs.builder()
.instantRpRetentionRangeInDays(30)
.policyType("V2")
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(180)
.durationType("Days")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(60)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(RetentionDurationArgs.builder()
.count(12)
.durationType("Weeks")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear("January")
.retentionDuration(RetentionDurationArgs.builder()
.count(10)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("2021-12-17T08:00:00+00:00")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyV2Args.builder()
.dailySchedule(DailyScheduleArgs.builder()
.scheduleRunTimes("2018-01-24T10:00:00Z")
.build())
.scheduleRunFrequency("Daily")
.build())
.snapshotConsistencyType("OnlyCrashConsistent")
.timeZone("India Standard Time")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("NetSDKTestRsVault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "v2-daily-sample",
properties: {
backupManagementType: "AzureIaasVM",
instantRpRetentionRangeInDays: 30,
policyType: azure_native.recoveryservices.IAASVMPolicyType.V2,
retentionPolicy: {
dailySchedule: {
retentionDuration: {
count: 180,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
monthlySchedule: {
retentionDuration: {
count: 60,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 12,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.January],
retentionDuration: {
count: 10,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["2021-12-17T08:00:00+00:00"],
},
},
schedulePolicy: {
dailySchedule: {
scheduleRunTimes: ["2018-01-24T10:00:00Z"],
},
schedulePolicyType: "SimpleSchedulePolicyV2",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Daily,
},
snapshotConsistencyType: azure_native.recoveryservices.IaasVMSnapshotConsistencyType.OnlyCrashConsistent,
timeZone: "India Standard Time",
},
resourceGroupName: "SwaggerTestRg",
vaultName: "NetSDKTestRsVault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="v2-daily-sample",
properties={
"backup_management_type": "AzureIaasVM",
"instant_rp_retention_range_in_days": 30,
"policy_type": azure_native.recoveryservices.IAASVMPolicyType.V2,
"retention_policy": {
"daily_schedule": {
"retention_duration": {
"count": 180,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"monthly_schedule": {
"retention_duration": {
"count": 60,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 12,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.JANUARY],
"retention_duration": {
"count": 10,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["2021-12-17T08:00:00+00:00"],
},
},
"schedule_policy": {
"daily_schedule": {
"schedule_run_times": ["2018-01-24T10:00:00Z"],
},
"schedule_policy_type": "SimpleSchedulePolicyV2",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.DAILY,
},
"snapshot_consistency_type": azure_native.recoveryservices.IaasVMSnapshotConsistencyType.ONLY_CRASH_CONSISTENT,
"time_zone": "India Standard Time",
},
resource_group_name="SwaggerTestRg",
vault_name="NetSDKTestRsVault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: v2-daily-sample
properties:
backupManagementType: AzureIaasVM
instantRpRetentionRangeInDays: 30
policyType: V2
retentionPolicy:
dailySchedule:
retentionDuration:
count: 180
durationType: Days
retentionTimes:
- 2021-12-17T08:00:00+00:00
monthlySchedule:
retentionDuration:
count: 60
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-12-17T08:00:00+00:00
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 12
durationType: Weeks
retentionTimes:
- 2021-12-17T08:00:00+00:00
yearlySchedule:
monthsOfYear:
- January
retentionDuration:
count: 10
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- 2021-12-17T08:00:00+00:00
schedulePolicy:
dailySchedule:
scheduleRunTimes:
- 2018-01-24T10:00:00Z
schedulePolicyType: SimpleSchedulePolicyV2
scheduleRunFrequency: Daily
snapshotConsistencyType: OnlyCrashConsistent
timeZone: India Standard Time
resourceGroupName: SwaggerTestRg
vaultName: NetSDKTestRsVault
Create or Update Full Azure Vm Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "testPolicy1",
Properties = new AzureNative.RecoveryServices.Inputs.AzureIaaSVMProtectionPolicyArgs
{
BackupManagementType = "AzureIaasVM",
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 2,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Wednesday,
AzureNative.RecoveryServices.DayOfWeek.Thursday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
AzureNative.RecoveryServices.WeekOfMonth.Third,
},
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Monday,
AzureNative.RecoveryServices.DayOfWeek.Wednesday,
AzureNative.RecoveryServices.DayOfWeek.Thursday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 1,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.February,
AzureNative.RecoveryServices.MonthOfYear.November,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 4,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Monday,
AzureNative.RecoveryServices.DayOfWeek.Thursday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.Fourth,
},
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunDays = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Monday,
AzureNative.RecoveryServices.DayOfWeek.Wednesday,
AzureNative.RecoveryServices.DayOfWeek.Thursday,
},
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Weekly,
ScheduleRunTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
TimeZone = "Pacific Standard Time",
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "NetSDKTestRsVault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("testPolicy1"),
Properties: &recoveryservices.AzureIaaSVMProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureIaasVM"),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(2),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekWednesday,
recoveryservices.DayOfWeekThursday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
recoveryservices.WeekOfMonthThird,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekMonday,
recoveryservices.DayOfWeekWednesday,
recoveryservices.DayOfWeekThursday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(1),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearFebruary,
recoveryservices.MonthOfYearNovember,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(4),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekMonday,
recoveryservices.DayOfWeekThursday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFourth,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunDays: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekMonday,
recoveryservices.DayOfWeekWednesday,
recoveryservices.DayOfWeekThursday,
},
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeWeekly),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
TimeZone: pulumi.String("Pacific Standard Time"),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("NetSDKTestRsVault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "testPolicy1"
properties = {
backup_management_type = "AzureIaasVM"
retention_policy = {
monthly_schedule = {
retention_duration = {
count = 2
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Wednesday", "Thursday"]
weeks_of_the_month = ["First", "Third"]
}
retention_times = ["2018-01-24T10:00:00Z"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Monday", "Wednesday", "Thursday"]
retention_duration = {
count = 1
duration_type = "Weeks"
}
retention_times = ["2018-01-24T10:00:00Z"]
}
yearly_schedule = {
months_of_year = ["February", "November"]
retention_duration = {
count = 4
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Monday", "Thursday"]
weeks_of_the_month = ["Fourth"]
}
retention_times = ["2018-01-24T10:00:00Z"]
}
}
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_days = ["Monday", "Wednesday", "Thursday"]
schedule_run_frequency = "Weekly"
schedule_run_times = ["2018-01-24T10:00:00Z"]
}
time_zone = "Pacific Standard Time"
}
resource_group_name = "SwaggerTestRg"
vault_name = "NetSDKTestRsVault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("testPolicy1")
.properties(AzureIaaSVMProtectionPolicyArgs.builder()
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(2)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek(
"Wednesday",
"Thursday")
.weeksOfTheMonth(
"First",
"Third")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek(
"Monday",
"Wednesday",
"Thursday")
.retentionDuration(RetentionDurationArgs.builder()
.count(1)
.durationType("Weeks")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear(
"February",
"November")
.retentionDuration(RetentionDurationArgs.builder()
.count(4)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek(
"Monday",
"Thursday")
.weeksOfTheMonth("Fourth")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunDays(
"Monday",
"Wednesday",
"Thursday")
.scheduleRunFrequency("Weekly")
.scheduleRunTimes("2018-01-24T10:00:00Z")
.build())
.timeZone("Pacific Standard Time")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("NetSDKTestRsVault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "testPolicy1",
properties: {
backupManagementType: "AzureIaasVM",
retentionPolicy: {
monthlySchedule: {
retentionDuration: {
count: 2,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [
azure_native.recoveryservices.DayOfWeek.Wednesday,
azure_native.recoveryservices.DayOfWeek.Thursday,
],
weeksOfTheMonth: [
azure_native.recoveryservices.WeekOfMonth.First,
azure_native.recoveryservices.WeekOfMonth.Third,
],
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [
azure_native.recoveryservices.DayOfWeek.Monday,
azure_native.recoveryservices.DayOfWeek.Wednesday,
azure_native.recoveryservices.DayOfWeek.Thursday,
],
retentionDuration: {
count: 1,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
yearlySchedule: {
monthsOfYear: [
azure_native.recoveryservices.MonthOfYear.February,
azure_native.recoveryservices.MonthOfYear.November,
],
retentionDuration: {
count: 4,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [
azure_native.recoveryservices.DayOfWeek.Monday,
azure_native.recoveryservices.DayOfWeek.Thursday,
],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.Fourth],
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
},
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunDays: [
azure_native.recoveryservices.DayOfWeek.Monday,
azure_native.recoveryservices.DayOfWeek.Wednesday,
azure_native.recoveryservices.DayOfWeek.Thursday,
],
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Weekly,
scheduleRunTimes: ["2018-01-24T10:00:00Z"],
},
timeZone: "Pacific Standard Time",
},
resourceGroupName: "SwaggerTestRg",
vaultName: "NetSDKTestRsVault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="testPolicy1",
properties={
"backup_management_type": "AzureIaasVM",
"retention_policy": {
"monthly_schedule": {
"retention_duration": {
"count": 2,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [
azure_native.recoveryservices.DayOfWeek.WEDNESDAY,
azure_native.recoveryservices.DayOfWeek.THURSDAY,
],
"weeks_of_the_month": [
azure_native.recoveryservices.WeekOfMonth.FIRST,
azure_native.recoveryservices.WeekOfMonth.THIRD,
],
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [
azure_native.recoveryservices.DayOfWeek.MONDAY,
azure_native.recoveryservices.DayOfWeek.WEDNESDAY,
azure_native.recoveryservices.DayOfWeek.THURSDAY,
],
"retention_duration": {
"count": 1,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
"yearly_schedule": {
"months_of_year": [
azure_native.recoveryservices.MonthOfYear.FEBRUARY,
azure_native.recoveryservices.MonthOfYear.NOVEMBER,
],
"retention_duration": {
"count": 4,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [
azure_native.recoveryservices.DayOfWeek.MONDAY,
azure_native.recoveryservices.DayOfWeek.THURSDAY,
],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FOURTH],
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
},
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_days": [
azure_native.recoveryservices.DayOfWeek.MONDAY,
azure_native.recoveryservices.DayOfWeek.WEDNESDAY,
azure_native.recoveryservices.DayOfWeek.THURSDAY,
],
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.WEEKLY,
"schedule_run_times": ["2018-01-24T10:00:00Z"],
},
"time_zone": "Pacific Standard Time",
},
resource_group_name="SwaggerTestRg",
vault_name="NetSDKTestRsVault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: testPolicy1
properties:
backupManagementType: AzureIaasVM
retentionPolicy:
monthlySchedule:
retentionDuration:
count: 2
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Wednesday
- Thursday
weeksOfTheMonth:
- First
- Third
retentionTimes:
- 2018-01-24T10:00:00Z
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Monday
- Wednesday
- Thursday
retentionDuration:
count: 1
durationType: Weeks
retentionTimes:
- 2018-01-24T10:00:00Z
yearlySchedule:
monthsOfYear:
- February
- November
retentionDuration:
count: 4
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Monday
- Thursday
weeksOfTheMonth:
- Fourth
retentionTimes:
- 2018-01-24T10:00:00Z
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunDays:
- Monday
- Wednesday
- Thursday
scheduleRunFrequency: Weekly
scheduleRunTimes:
- 2018-01-24T10:00:00Z
timeZone: Pacific Standard Time
resourceGroupName: SwaggerTestRg
vaultName: NetSDKTestRsVault
Create or Update Full Azure Workload Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "testPolicy1",
Properties = new AzureNative.RecoveryServices.Inputs.AzureVmWorkloadProtectionPolicyArgs
{
BackupManagementType = "AzureWorkload",
Settings = new AzureNative.RecoveryServices.Inputs.SettingsArgs
{
Issqlcompression = false,
TimeZone = "Pacific Standard Time",
},
SubProtectionPolicy =
{
new AzureNative.RecoveryServices.Inputs.SubProtectionPolicyArgs
{
PolicyType = AzureNative.RecoveryServices.PolicyType.Full,
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 1,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.Second,
},
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
AzureNative.RecoveryServices.DayOfWeek.Tuesday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 2,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
AzureNative.RecoveryServices.MonthOfYear.June,
AzureNative.RecoveryServices.MonthOfYear.December,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 1,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.Last,
},
},
RetentionTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunDays = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
AzureNative.RecoveryServices.DayOfWeek.Tuesday,
},
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Weekly,
ScheduleRunTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
},
new AzureNative.RecoveryServices.Inputs.SubProtectionPolicyArgs
{
PolicyType = AzureNative.RecoveryServices.PolicyType.Differential,
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.SimpleRetentionPolicyArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 8,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionPolicyType = "SimpleRetentionPolicy",
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunDays = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Friday,
},
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Weekly,
ScheduleRunTimes = new[]
{
"2018-01-24T10:00:00Z",
},
},
},
new AzureNative.RecoveryServices.Inputs.SubProtectionPolicyArgs
{
PolicyType = AzureNative.RecoveryServices.PolicyType.Log,
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.SimpleRetentionPolicyArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 7,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionPolicyType = "SimpleRetentionPolicy",
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.LogSchedulePolicyArgs
{
ScheduleFrequencyInMins = 60,
SchedulePolicyType = "LogSchedulePolicy",
},
},
},
WorkLoadType = AzureNative.RecoveryServices.WorkloadType.SQLDataBase,
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "NetSDKTestRsVault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("testPolicy1"),
Properties: &recoveryservices.AzureVmWorkloadProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureWorkload"),
Settings: &recoveryservices.SettingsArgs{
Issqlcompression: pulumi.Bool(false),
TimeZone: pulumi.String("Pacific Standard Time"),
},
SubProtectionPolicy: recoveryservices.SubProtectionPolicyArray{
&recoveryservices.SubProtectionPolicyArgs{
PolicyType: pulumi.String(recoveryservices.PolicyTypeFull),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(1),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthSecond,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
recoveryservices.DayOfWeekTuesday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(2),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
recoveryservices.MonthOfYearJune,
recoveryservices.MonthOfYearDecember,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(1),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthLast,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunDays: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
recoveryservices.DayOfWeekTuesday,
},
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeWeekly),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
},
&recoveryservices.SubProtectionPolicyArgs{
PolicyType: pulumi.String(recoveryservices.PolicyTypeDifferential),
RetentionPolicy: &recoveryservices.SimpleRetentionPolicyArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(8),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionPolicyType: pulumi.String("SimpleRetentionPolicy"),
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunDays: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekFriday,
},
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeWeekly),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2018-01-24T10:00:00Z"),
},
},
},
&recoveryservices.SubProtectionPolicyArgs{
PolicyType: pulumi.String(recoveryservices.PolicyTypeLog),
RetentionPolicy: &recoveryservices.SimpleRetentionPolicyArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(7),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionPolicyType: pulumi.String("SimpleRetentionPolicy"),
},
SchedulePolicy: &recoveryservices.LogSchedulePolicyArgs{
ScheduleFrequencyInMins: pulumi.Int(60),
SchedulePolicyType: pulumi.String("LogSchedulePolicy"),
},
},
},
WorkLoadType: pulumi.String(recoveryservices.WorkloadTypeSQLDataBase),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("NetSDKTestRsVault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "testPolicy1"
properties = {
backup_management_type = "AzureWorkload"
settings = {
issqlcompression = false
time_zone = "Pacific Standard Time"
}
sub_protection_policy = [{
policy_type = "Full"
retention_policy = {
monthly_schedule = {
retention_duration = {
count = 1
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["Second"]
}
retention_times = ["2018-01-24T10:00:00Z"]
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday", "Tuesday"]
retention_duration = {
count = 2
duration_type = "Weeks"
}
retention_times = ["2018-01-24T10:00:00Z"]
}
yearly_schedule = {
months_of_year = ["January", "June", "December"]
retention_duration = {
count = 1
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["Last"]
}
retention_times = ["2018-01-24T10:00:00Z"]
}
}
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_days = ["Sunday", "Tuesday"]
schedule_run_frequency = "Weekly"
schedule_run_times = ["2018-01-24T10:00:00Z"]
}
}, {
policy_type = "Differential"
retention_policy = {
retention_duration = {
count = 8
duration_type = "Days"
}
retention_policy_type = "SimpleRetentionPolicy"
}
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_days = ["Friday"]
schedule_run_frequency = "Weekly"
schedule_run_times = ["2018-01-24T10:00:00Z"]
}
}, {
policy_type = "Log"
retention_policy = {
retention_duration = {
count = 7
duration_type = "Days"
}
retention_policy_type = "SimpleRetentionPolicy"
}
schedule_policy = {
schedule_frequency_in_mins = 60
schedule_policy_type = "LogSchedulePolicy"
}
}]
work_load_type = "SQLDataBase"
}
resource_group_name = "SwaggerTestRg"
vault_name = "NetSDKTestRsVault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SettingsArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SubProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("testPolicy1")
.properties(AzureVmWorkloadProtectionPolicyArgs.builder()
.settings(SettingsArgs.builder()
.issqlcompression(false)
.timeZone("Pacific Standard Time")
.build())
.subProtectionPolicy(
SubProtectionPolicyArgs.builder()
.policyType("Full")
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(1)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("Second")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek(
"Sunday",
"Tuesday")
.retentionDuration(RetentionDurationArgs.builder()
.count(2)
.durationType("Weeks")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear(
"January",
"June",
"December")
.retentionDuration(RetentionDurationArgs.builder()
.count(1)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("Last")
.build())
.retentionTimes("2018-01-24T10:00:00Z")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunDays(
"Sunday",
"Tuesday")
.scheduleRunFrequency("Weekly")
.scheduleRunTimes("2018-01-24T10:00:00Z")
.build())
.build(),
SubProtectionPolicyArgs.builder()
.policyType("Differential")
.retentionPolicy(SimpleRetentionPolicyArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(8)
.durationType("Days")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunDays("Friday")
.scheduleRunFrequency("Weekly")
.scheduleRunTimes("2018-01-24T10:00:00Z")
.build())
.build(),
SubProtectionPolicyArgs.builder()
.policyType("Log")
.retentionPolicy(SimpleRetentionPolicyArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(7)
.durationType("Days")
.build())
.build())
.schedulePolicy(LogSchedulePolicyArgs.builder()
.scheduleFrequencyInMins(60)
.build())
.build())
.workLoadType("SQLDataBase")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("NetSDKTestRsVault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "testPolicy1",
properties: {
backupManagementType: "AzureWorkload",
settings: {
issqlcompression: false,
timeZone: "Pacific Standard Time",
},
subProtectionPolicy: [
{
policyType: azure_native.recoveryservices.PolicyType.Full,
retentionPolicy: {
monthlySchedule: {
retentionDuration: {
count: 1,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.Second],
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [
azure_native.recoveryservices.DayOfWeek.Sunday,
azure_native.recoveryservices.DayOfWeek.Tuesday,
],
retentionDuration: {
count: 2,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
yearlySchedule: {
monthsOfYear: [
azure_native.recoveryservices.MonthOfYear.January,
azure_native.recoveryservices.MonthOfYear.June,
azure_native.recoveryservices.MonthOfYear.December,
],
retentionDuration: {
count: 1,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.Last],
},
retentionTimes: ["2018-01-24T10:00:00Z"],
},
},
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunDays: [
azure_native.recoveryservices.DayOfWeek.Sunday,
azure_native.recoveryservices.DayOfWeek.Tuesday,
],
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Weekly,
scheduleRunTimes: ["2018-01-24T10:00:00Z"],
},
},
{
policyType: azure_native.recoveryservices.PolicyType.Differential,
retentionPolicy: {
retentionDuration: {
count: 8,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionPolicyType: "SimpleRetentionPolicy",
},
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunDays: [azure_native.recoveryservices.DayOfWeek.Friday],
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Weekly,
scheduleRunTimes: ["2018-01-24T10:00:00Z"],
},
},
{
policyType: azure_native.recoveryservices.PolicyType.Log,
retentionPolicy: {
retentionDuration: {
count: 7,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionPolicyType: "SimpleRetentionPolicy",
},
schedulePolicy: {
scheduleFrequencyInMins: 60,
schedulePolicyType: "LogSchedulePolicy",
},
},
],
workLoadType: azure_native.recoveryservices.WorkloadType.SQLDataBase,
},
resourceGroupName: "SwaggerTestRg",
vaultName: "NetSDKTestRsVault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="testPolicy1",
properties={
"backup_management_type": "AzureWorkload",
"settings": {
"issqlcompression": False,
"time_zone": "Pacific Standard Time",
},
"sub_protection_policy": [
{
"policy_type": azure_native.recoveryservices.PolicyType.FULL,
"retention_policy": {
"monthly_schedule": {
"retention_duration": {
"count": 1,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.SECOND],
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [
azure_native.recoveryservices.DayOfWeek.SUNDAY,
azure_native.recoveryservices.DayOfWeek.TUESDAY,
],
"retention_duration": {
"count": 2,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
"yearly_schedule": {
"months_of_year": [
azure_native.recoveryservices.MonthOfYear.JANUARY,
azure_native.recoveryservices.MonthOfYear.JUNE,
azure_native.recoveryservices.MonthOfYear.DECEMBER,
],
"retention_duration": {
"count": 1,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.LAST],
},
"retention_times": ["2018-01-24T10:00:00Z"],
},
},
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_days": [
azure_native.recoveryservices.DayOfWeek.SUNDAY,
azure_native.recoveryservices.DayOfWeek.TUESDAY,
],
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.WEEKLY,
"schedule_run_times": ["2018-01-24T10:00:00Z"],
},
},
{
"policy_type": azure_native.recoveryservices.PolicyType.DIFFERENTIAL,
"retention_policy": {
"retention_duration": {
"count": 8,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_policy_type": "SimpleRetentionPolicy",
},
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_days": [azure_native.recoveryservices.DayOfWeek.FRIDAY],
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.WEEKLY,
"schedule_run_times": ["2018-01-24T10:00:00Z"],
},
},
{
"policy_type": azure_native.recoveryservices.PolicyType.LOG,
"retention_policy": {
"retention_duration": {
"count": 7,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_policy_type": "SimpleRetentionPolicy",
},
"schedule_policy": {
"schedule_frequency_in_mins": 60,
"schedule_policy_type": "LogSchedulePolicy",
},
},
],
"work_load_type": azure_native.recoveryservices.WorkloadType.SQL_DATA_BASE,
},
resource_group_name="SwaggerTestRg",
vault_name="NetSDKTestRsVault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: testPolicy1
properties:
backupManagementType: AzureWorkload
settings:
issqlcompression: false
timeZone: Pacific Standard Time
subProtectionPolicy:
- policyType: Full
retentionPolicy:
monthlySchedule:
retentionDuration:
count: 1
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- Second
retentionTimes:
- 2018-01-24T10:00:00Z
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
- Tuesday
retentionDuration:
count: 2
durationType: Weeks
retentionTimes:
- 2018-01-24T10:00:00Z
yearlySchedule:
monthsOfYear:
- January
- June
- December
retentionDuration:
count: 1
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- Last
retentionTimes:
- 2018-01-24T10:00:00Z
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunDays:
- Sunday
- Tuesday
scheduleRunFrequency: Weekly
scheduleRunTimes:
- 2018-01-24T10:00:00Z
- policyType: Differential
retentionPolicy:
retentionDuration:
count: 8
durationType: Days
retentionPolicyType: SimpleRetentionPolicy
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunDays:
- Friday
scheduleRunFrequency: Weekly
scheduleRunTimes:
- 2018-01-24T10:00:00Z
- policyType: Log
retentionPolicy:
retentionDuration:
count: 7
durationType: Days
retentionPolicyType: SimpleRetentionPolicy
schedulePolicy:
scheduleFrequencyInMins: 60
schedulePolicyType: LogSchedulePolicy
workLoadType: SQLDataBase
resourceGroupName: SwaggerTestRg
vaultName: NetSDKTestRsVault
Create or Update Hourly Azure Storage Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "newPolicy2",
Properties = new AzureNative.RecoveryServices.Inputs.AzureFileShareProtectionPolicyArgs
{
BackupManagementType = "AzureStorage",
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 5,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 60,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Months,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 12,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Weeks,
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.January,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 10,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Years,
},
RetentionScheduleFormatType = AzureNative.RecoveryServices.RetentionScheduleFormat.Weekly,
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
HourlySchedule = new AzureNative.RecoveryServices.Inputs.HourlyScheduleArgs
{
Interval = 4,
ScheduleWindowDuration = 12,
ScheduleWindowStartTime = "2021-09-29T08:00:00.000Z",
},
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Hourly,
},
TimeZone = "UTC",
WorkLoadType = AzureNative.RecoveryServices.WorkloadType.AzureFileShare,
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "swaggertestvault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("newPolicy2"),
Properties: &recoveryservices.AzureFileShareProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureStorage"),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(5),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(60),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeMonths),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(12),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeWeeks),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearJanuary,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(10),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeYears),
},
RetentionScheduleFormatType: pulumi.String(recoveryservices.RetentionScheduleFormatWeekly),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
},
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
HourlySchedule: &recoveryservices.HourlyScheduleArgs{
Interval: pulumi.Int(4),
ScheduleWindowDuration: pulumi.Int(12),
ScheduleWindowStartTime: pulumi.String("2021-09-29T08:00:00.000Z"),
},
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeHourly),
},
TimeZone: pulumi.String("UTC"),
WorkLoadType: pulumi.String(recoveryservices.WorkloadTypeAzureFileShare),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("swaggertestvault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "newPolicy2"
properties = {
backup_management_type = "AzureStorage"
retention_policy = {
daily_schedule = {
retention_duration = {
count = 5
duration_type = "Days"
}
}
monthly_schedule = {
retention_duration = {
count = 60
duration_type = "Months"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
}
retention_policy_type = "LongTermRetentionPolicy"
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 12
duration_type = "Weeks"
}
}
yearly_schedule = {
months_of_year = ["January"]
retention_duration = {
count = 10
duration_type = "Years"
}
retention_schedule_format_type = "Weekly"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
}
}
schedule_policy = {
hourly_schedule = {
interval = 4
schedule_window_duration = 12
schedule_window_start_time = "2021-09-29T08:00:00.000Z"
}
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_frequency = "Hourly"
}
time_zone = "UTC"
work_load_type = "AzureFileShare"
}
resource_group_name = "SwaggerTestRg"
vault_name = "swaggertestvault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs;
import com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.HourlyScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("newPolicy2")
.properties(AzureFileShareProtectionPolicyArgs.builder()
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(5)
.durationType("Days")
.build())
.build())
.monthlySchedule(MonthlyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(60)
.durationType("Months")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.build())
.weeklySchedule(WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(RetentionDurationArgs.builder()
.count(12)
.durationType("Weeks")
.build())
.build())
.yearlySchedule(YearlyRetentionScheduleArgs.builder()
.monthsOfYear("January")
.retentionDuration(RetentionDurationArgs.builder()
.count(10)
.durationType("Years")
.build())
.retentionScheduleFormatType("Weekly")
.retentionScheduleWeekly(WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.hourlySchedule(HourlyScheduleArgs.builder()
.interval(4)
.scheduleWindowDuration(12)
.scheduleWindowStartTime("2021-09-29T08:00:00.000Z")
.build())
.scheduleRunFrequency("Hourly")
.build())
.timeZone("UTC")
.workLoadType("AzureFileShare")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("swaggertestvault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "newPolicy2",
properties: {
backupManagementType: "AzureStorage",
retentionPolicy: {
dailySchedule: {
retentionDuration: {
count: 5,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
},
monthlySchedule: {
retentionDuration: {
count: 60,
durationType: azure_native.recoveryservices.RetentionDurationType.Months,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
},
retentionPolicyType: "LongTermRetentionPolicy",
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 12,
durationType: azure_native.recoveryservices.RetentionDurationType.Weeks,
},
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.January],
retentionDuration: {
count: 10,
durationType: azure_native.recoveryservices.RetentionDurationType.Years,
},
retentionScheduleFormatType: azure_native.recoveryservices.RetentionScheduleFormat.Weekly,
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
},
},
schedulePolicy: {
hourlySchedule: {
interval: 4,
scheduleWindowDuration: 12,
scheduleWindowStartTime: "2021-09-29T08:00:00.000Z",
},
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Hourly,
},
timeZone: "UTC",
workLoadType: azure_native.recoveryservices.WorkloadType.AzureFileShare,
},
resourceGroupName: "SwaggerTestRg",
vaultName: "swaggertestvault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="newPolicy2",
properties={
"backup_management_type": "AzureStorage",
"retention_policy": {
"daily_schedule": {
"retention_duration": {
"count": 5,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
},
"monthly_schedule": {
"retention_duration": {
"count": 60,
"duration_type": azure_native.recoveryservices.RetentionDurationType.MONTHS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
},
"retention_policy_type": "LongTermRetentionPolicy",
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 12,
"duration_type": azure_native.recoveryservices.RetentionDurationType.WEEKS,
},
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.JANUARY],
"retention_duration": {
"count": 10,
"duration_type": azure_native.recoveryservices.RetentionDurationType.YEARS,
},
"retention_schedule_format_type": azure_native.recoveryservices.RetentionScheduleFormat.WEEKLY,
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
},
},
"schedule_policy": {
"hourly_schedule": {
"interval": 4,
"schedule_window_duration": 12,
"schedule_window_start_time": "2021-09-29T08:00:00.000Z",
},
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.HOURLY,
},
"time_zone": "UTC",
"work_load_type": azure_native.recoveryservices.WorkloadType.AZURE_FILE_SHARE,
},
resource_group_name="SwaggerTestRg",
vault_name="swaggertestvault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: newPolicy2
properties:
backupManagementType: AzureStorage
retentionPolicy:
dailySchedule:
retentionDuration:
count: 5
durationType: Days
monthlySchedule:
retentionDuration:
count: 60
durationType: Months
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 12
durationType: Weeks
yearlySchedule:
monthsOfYear:
- January
retentionDuration:
count: 10
durationType: Years
retentionScheduleFormatType: Weekly
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
schedulePolicy:
hourlySchedule:
interval: 4
scheduleWindowDuration: 12
scheduleWindowStartTime: 2021-09-29T08:00:00.000Z
schedulePolicyType: SimpleSchedulePolicy
scheduleRunFrequency: Hourly
timeZone: UTC
workLoadType: AzureFileShare
resourceGroupName: SwaggerTestRg
vaultName: swaggertestvault
Create or Update Simple Azure Vm Protection Policy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var protectionPolicy = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicy", new()
{
PolicyName = "testPolicy1",
Properties = new AzureNative.RecoveryServices.Inputs.AzureIaaSVMProtectionPolicyArgs
{
BackupManagementType = "AzureIaasVM",
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 1,
DurationType = AzureNative.RecoveryServices.RetentionDurationType.Days,
},
RetentionTimes = new[]
{
"2018-01-24T02:00:00Z",
},
},
RetentionPolicyType = "LongTermRetentionPolicy",
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.SimpleSchedulePolicyArgs
{
SchedulePolicyType = "SimpleSchedulePolicy",
ScheduleRunFrequency = AzureNative.RecoveryServices.ScheduleRunType.Daily,
ScheduleRunTimes = new[]
{
"2018-01-24T02:00:00Z",
},
},
TimeZone = "Pacific Standard Time",
},
ResourceGroupName = "SwaggerTestRg",
VaultName = "NetSDKTestRsVault",
});
});
package main
import (
recoveryservices "github.com/pulumi/pulumi-azure-native-sdk/recoveryservices/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicy", &recoveryservices.ProtectionPolicyArgs{
PolicyName: pulumi.String("testPolicy1"),
Properties: &recoveryservices.AzureIaaSVMProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureIaasVM"),
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(1),
DurationType: pulumi.String(recoveryservices.RetentionDurationTypeDays),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("2018-01-24T02:00:00Z"),
},
},
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
},
SchedulePolicy: &recoveryservices.SimpleSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("SimpleSchedulePolicy"),
ScheduleRunFrequency: pulumi.String(recoveryservices.ScheduleRunTypeDaily),
ScheduleRunTimes: pulumi.StringArray{
pulumi.String("2018-01-24T02:00:00Z"),
},
},
TimeZone: pulumi.String("Pacific Standard Time"),
},
ResourceGroupName: pulumi.String("SwaggerTestRg"),
VaultName: pulumi.String("NetSDKTestRsVault"),
})
if err != nil {
return err
}
return nil
})
}
terraform {
required_providers {
azure-native = {
source = "pulumi/azure-native"
}
}
}
resource "azure-native_recoveryservices_protection_policy" "protectionPolicy" {
lifecycle {
create_before_destroy = true
}
policy_name = "testPolicy1"
properties = {
backup_management_type = "AzureIaasVM"
retention_policy = {
daily_schedule = {
retention_duration = {
count = 1
duration_type = "Days"
}
retention_times = ["2018-01-24T02:00:00Z"]
}
retention_policy_type = "LongTermRetentionPolicy"
}
schedule_policy = {
schedule_policy_type = "SimpleSchedulePolicy"
schedule_run_frequency = "Daily"
schedule_run_times = ["2018-01-24T02:00:00Z"]
}
time_zone = "Pacific Standard Time"
}
resource_group_name = "SwaggerTestRg"
vault_name = "NetSDKTestRsVault"
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicy;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureFileShareProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs;
import com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleRetentionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.LongTermSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.SimpleSchedulePolicyV2Args;
import com.pulumi.azurenative.recoveryservices.inputs.AzureIaaSVMProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureSqlProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.AzureVmWorkloadProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.GenericProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.inputs.MabProtectionPolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
.policyName("testPolicy1")
.properties(AzureIaaSVMProtectionPolicyArgs.builder()
.retentionPolicy(LongTermRetentionPolicyArgs.builder()
.dailySchedule(DailyRetentionScheduleArgs.builder()
.retentionDuration(RetentionDurationArgs.builder()
.count(1)
.durationType("Days")
.build())
.retentionTimes("2018-01-24T02:00:00Z")
.build())
.build())
.schedulePolicy(SimpleSchedulePolicyArgs.builder()
.scheduleRunFrequency("Daily")
.scheduleRunTimes("2018-01-24T02:00:00Z")
.build())
.timeZone("Pacific Standard Time")
.build())
.resourceGroupName("SwaggerTestRg")
.vaultName("NetSDKTestRsVault")
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const protectionPolicy = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicy", {
policyName: "testPolicy1",
properties: {
backupManagementType: "AzureIaasVM",
retentionPolicy: {
dailySchedule: {
retentionDuration: {
count: 1,
durationType: azure_native.recoveryservices.RetentionDurationType.Days,
},
retentionTimes: ["2018-01-24T02:00:00Z"],
},
retentionPolicyType: "LongTermRetentionPolicy",
},
schedulePolicy: {
schedulePolicyType: "SimpleSchedulePolicy",
scheduleRunFrequency: azure_native.recoveryservices.ScheduleRunType.Daily,
scheduleRunTimes: ["2018-01-24T02:00:00Z"],
},
timeZone: "Pacific Standard Time",
},
resourceGroupName: "SwaggerTestRg",
vaultName: "NetSDKTestRsVault",
});
import pulumi
import pulumi_azure_native as azure_native
protection_policy = azure_native.recoveryservices.ProtectionPolicy("protectionPolicy",
policy_name="testPolicy1",
properties={
"backup_management_type": "AzureIaasVM",
"retention_policy": {
"daily_schedule": {
"retention_duration": {
"count": 1,
"duration_type": azure_native.recoveryservices.RetentionDurationType.DAYS,
},
"retention_times": ["2018-01-24T02:00:00Z"],
},
"retention_policy_type": "LongTermRetentionPolicy",
},
"schedule_policy": {
"schedule_policy_type": "SimpleSchedulePolicy",
"schedule_run_frequency": azure_native.recoveryservices.ScheduleRunType.DAILY,
"schedule_run_times": ["2018-01-24T02:00:00Z"],
},
"time_zone": "Pacific Standard Time",
},
resource_group_name="SwaggerTestRg",
vault_name="NetSDKTestRsVault")
resources:
protectionPolicy:
type: azure-native:recoveryservices:ProtectionPolicy
properties:
policyName: testPolicy1
properties:
backupManagementType: AzureIaasVM
retentionPolicy:
dailySchedule:
retentionDuration:
count: 1
durationType: Days
retentionTimes:
- 2018-01-24T02:00:00Z
retentionPolicyType: LongTermRetentionPolicy
schedulePolicy:
schedulePolicyType: SimpleSchedulePolicy
scheduleRunFrequency: Daily
scheduleRunTimes:
- 2018-01-24T02:00:00Z
timeZone: Pacific Standard Time
resourceGroupName: SwaggerTestRg
vaultName: NetSDKTestRsVault
Create ProtectionPolicy Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
@overload
def ProtectionPolicy(resource_name: str,
args: ProtectionPolicyArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProtectionPolicy(resource_name: str,
opts: Optional[ResourceOptions] = None,
resource_group_name: Optional[str] = None,
vault_name: Optional[str] = None,
e_tag: Optional[str] = None,
location: Optional[str] = None,
policy_name: Optional[str] = None,
properties: Optional[Union[AzureFileShareProtectionPolicyArgs, AzureIaaSVMProtectionPolicyArgs, AzureSqlProtectionPolicyArgs, AzureVmWorkloadProtectionPolicyArgs, GenericProtectionPolicyArgs, MabProtectionPolicyArgs]] = None,
tags: Optional[Mapping[str, str]] = None)
type: azure-native:recoveryservices:ProtectionPolicy
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "azure-native_recoveryservices_protection_policy" "name" {
# resource properties
}
Parameters
- resource_name
str
- The unique name of the resource.
- args
ProtectionPolicyArgs
- The arguments to resource properties.
- opts
ResourceOptions
- Bag of options to control resource's behavior.
- ctx
Context
- Context object for the current deployment.
- name
string
- The unique name of the resource.
- args
ProtectionPolicyArgs
- The arguments to resource properties.
- opts
ResourceOption
- Bag of options to control resource's behavior.
- name
String
- The unique name of the resource.
- args
ProtectionPolicyArgs
- The arguments to resource properties.
- options
CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var protectionPolicyResource = new AzureNative.RecoveryServices.ProtectionPolicy("protectionPolicyResource", new()
{
ResourceGroupName = "string",
VaultName = "string",
ETag = "string",
Location = "string",
PolicyName = "string",
Properties = new AzureNative.RecoveryServices.Inputs.AzureFileShareProtectionPolicyArgs
{
BackupManagementType = "AzureStorage",
ProtectedItemsCount = 0,
ResourceGuardOperationRequests = new[]
{
"string",
},
RetentionPolicy = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
RetentionPolicyType = "LongTermRetentionPolicy",
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionTimes = new[]
{
"string",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionScheduleDaily = new AzureNative.RecoveryServices.Inputs.DailyRetentionFormatArgs
{
DaysOfTheMonth = new[]
{
new AzureNative.RecoveryServices.Inputs.DayArgs
{
Date = 0,
IsLast = false,
},
},
},
RetentionScheduleFormatType = "string",
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"string",
},
},
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionTimes = new[]
{
"string",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.Invalid,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionScheduleDaily = new AzureNative.RecoveryServices.Inputs.DailyRetentionFormatArgs
{
DaysOfTheMonth = new[]
{
new AzureNative.RecoveryServices.Inputs.DayArgs
{
Date = 0,
IsLast = false,
},
},
},
RetentionScheduleFormatType = "string",
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"string",
},
},
},
SchedulePolicy = new AzureNative.RecoveryServices.Inputs.LogSchedulePolicyArgs
{
SchedulePolicyType = "LogSchedulePolicy",
ScheduleFrequencyInMins = 0,
},
TimeZone = "string",
VaultRetentionPolicy = new AzureNative.RecoveryServices.Inputs.VaultRetentionPolicyArgs
{
SnapshotRetentionInDays = 0,
VaultRetention = new AzureNative.RecoveryServices.Inputs.LongTermRetentionPolicyArgs
{
RetentionPolicyType = "LongTermRetentionPolicy",
DailySchedule = new AzureNative.RecoveryServices.Inputs.DailyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionTimes = new[]
{
"string",
},
},
MonthlySchedule = new AzureNative.RecoveryServices.Inputs.MonthlyRetentionScheduleArgs
{
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionScheduleDaily = new AzureNative.RecoveryServices.Inputs.DailyRetentionFormatArgs
{
DaysOfTheMonth = new[]
{
new AzureNative.RecoveryServices.Inputs.DayArgs
{
Date = 0,
IsLast = false,
},
},
},
RetentionScheduleFormatType = "string",
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"string",
},
},
WeeklySchedule = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionScheduleArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionTimes = new[]
{
"string",
},
},
YearlySchedule = new AzureNative.RecoveryServices.Inputs.YearlyRetentionScheduleArgs
{
MonthsOfYear = new[]
{
AzureNative.RecoveryServices.MonthOfYear.Invalid,
},
RetentionDuration = new AzureNative.RecoveryServices.Inputs.RetentionDurationArgs
{
Count = 0,
DurationType = "string",
},
RetentionScheduleDaily = new AzureNative.RecoveryServices.Inputs.DailyRetentionFormatArgs
{
DaysOfTheMonth = new[]
{
new AzureNative.RecoveryServices.Inputs.DayArgs
{
Date = 0,
IsLast = false,
},
},
},
RetentionScheduleFormatType = "string",
RetentionScheduleWeekly = new AzureNative.RecoveryServices.Inputs.WeeklyRetentionFormatArgs
{
DaysOfTheWeek = new[]
{
AzureNative.RecoveryServices.DayOfWeek.Sunday,
},
WeeksOfTheMonth = new[]
{
AzureNative.RecoveryServices.WeekOfMonth.First,
},
},
RetentionTimes = new[]
{
"string",
},
},
},
},
WorkLoadType = "string",
},
Tags =
{
{ "string", "string" },
},
});
example, err := recoveryservices.NewProtectionPolicy(ctx, "protectionPolicyResource", &recoveryservices.ProtectionPolicyArgs{
ResourceGroupName: pulumi.String("string"),
VaultName: pulumi.String("string"),
ETag: pulumi.String("string"),
Location: pulumi.String("string"),
PolicyName: pulumi.String("string"),
Properties: &*recoveryservices.AzureFileShareProtectionPolicyArgs{
BackupManagementType: pulumi.String("AzureStorage"),
ProtectedItemsCount: pulumi.Int(0),
ResourceGuardOperationRequests: pulumi.StringArray{
pulumi.String("string"),
},
RetentionPolicy: &recoveryservices.LongTermRetentionPolicyArgs{
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionScheduleDaily: &recoveryservices.DailyRetentionFormatArgs{
DaysOfTheMonth: recoveryservices.DayArray{
&recoveryservices.DayArgs{
Date: pulumi.Int(0),
IsLast: pulumi.Bool(false),
},
},
},
RetentionScheduleFormatType: pulumi.String("string"),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearInvalid,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionScheduleDaily: &recoveryservices.DailyRetentionFormatArgs{
DaysOfTheMonth: recoveryservices.DayArray{
&recoveryservices.DayArgs{
Date: pulumi.Int(0),
IsLast: pulumi.Bool(false),
},
},
},
RetentionScheduleFormatType: pulumi.String("string"),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
},
SchedulePolicy: &recoveryservices.LogSchedulePolicyArgs{
SchedulePolicyType: pulumi.String("LogSchedulePolicy"),
ScheduleFrequencyInMins: pulumi.Int(0),
},
TimeZone: pulumi.String("string"),
VaultRetentionPolicy: &recoveryservices.VaultRetentionPolicyArgs{
SnapshotRetentionInDays: pulumi.Int(0),
VaultRetention: &recoveryservices.LongTermRetentionPolicyArgs{
RetentionPolicyType: pulumi.String("LongTermRetentionPolicy"),
DailySchedule: &recoveryservices.DailyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
MonthlySchedule: &recoveryservices.MonthlyRetentionScheduleArgs{
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionScheduleDaily: &recoveryservices.DailyRetentionFormatArgs{
DaysOfTheMonth: recoveryservices.DayArray{
&recoveryservices.DayArgs{
Date: pulumi.Int(0),
IsLast: pulumi.Bool(false),
},
},
},
RetentionScheduleFormatType: pulumi.String("string"),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
WeeklySchedule: &recoveryservices.WeeklyRetentionScheduleArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
YearlySchedule: &recoveryservices.YearlyRetentionScheduleArgs{
MonthsOfYear: recoveryservices.MonthOfYearArray{
recoveryservices.MonthOfYearInvalid,
},
RetentionDuration: &recoveryservices.RetentionDurationArgs{
Count: pulumi.Int(0),
DurationType: pulumi.String("string"),
},
RetentionScheduleDaily: &recoveryservices.DailyRetentionFormatArgs{
DaysOfTheMonth: recoveryservices.DayArray{
&recoveryservices.DayArgs{
Date: pulumi.Int(0),
IsLast: pulumi.Bool(false),
},
},
},
RetentionScheduleFormatType: pulumi.String("string"),
RetentionScheduleWeekly: &recoveryservices.WeeklyRetentionFormatArgs{
DaysOfTheWeek: recoveryservices.DayOfWeekArray{
recoveryservices.DayOfWeekSunday,
},
WeeksOfTheMonth: recoveryservices.WeekOfMonthArray{
recoveryservices.WeekOfMonthFirst,
},
},
RetentionTimes: pulumi.StringArray{
pulumi.String("string"),
},
},
},
},
WorkLoadType: pulumi.String("string"),
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
resource "azure-native_recoveryservices_protection_policy" "protectionPolicyResource" {
lifecycle {
create_before_destroy = true
}
resource_group_name = "string"
vault_name = "string"
e_tag = "string"
location = "string"
policy_name = "string"
properties = {
backup_management_type = "AzureStorage"
protected_items_count = 0
resource_guard_operation_requests = ["string"]
retention_policy = {
retention_policy_type = "LongTermRetentionPolicy"
daily_schedule = {
retention_duration = {
count = 0
duration_type = "string"
}
retention_times = ["string"]
}
monthly_schedule = {
retention_duration = {
count = 0
duration_type = "string"
}
retention_schedule_daily = {
days_of_the_month = [{
date = 0
is_last = false
}]
}
retention_schedule_format_type = "string"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["string"]
}
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 0
duration_type = "string"
}
retention_times = ["string"]
}
yearly_schedule = {
months_of_year = ["Invalid"]
retention_duration = {
count = 0
duration_type = "string"
}
retention_schedule_daily = {
days_of_the_month = [{
date = 0
is_last = false
}]
}
retention_schedule_format_type = "string"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["string"]
}
}
schedule_policy = {
schedule_policy_type = "LogSchedulePolicy"
schedule_frequency_in_mins = 0
}
time_zone = "string"
vault_retention_policy = {
snapshot_retention_in_days = 0
vault_retention = {
retention_policy_type = "LongTermRetentionPolicy"
daily_schedule = {
retention_duration = {
count = 0
duration_type = "string"
}
retention_times = ["string"]
}
monthly_schedule = {
retention_duration = {
count = 0
duration_type = "string"
}
retention_schedule_daily = {
days_of_the_month = [{
date = 0
is_last = false
}]
}
retention_schedule_format_type = "string"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["string"]
}
weekly_schedule = {
days_of_the_week = ["Sunday"]
retention_duration = {
count = 0
duration_type = "string"
}
retention_times = ["string"]
}
yearly_schedule = {
months_of_year = ["Invalid"]
retention_duration = {
count = 0
duration_type = "string"
}
retention_schedule_daily = {
days_of_the_month = [{
date = 0
is_last = false
}]
}
retention_schedule_format_type = "string"
retention_schedule_weekly = {
days_of_the_week = ["Sunday"]
weeks_of_the_month = ["First"]
}
retention_times = ["string"]
}
}
}
work_load_type = "string"
}
tags = {
"string" = "string"
}
}
var protectionPolicyResource = new ProtectionPolicy("protectionPolicyResource", ProtectionPolicyArgs.builder()
.resourceGroupName("string")
.vaultName("string")
.eTag("string")
.location("string")
.policyName("string")
.properties(AzureFileShareProtectionPolicyArgs.builder()
.protectedItemsCount(0)
.resourceGuardOperationRequests("string")
.retentionPolicy(com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs.builder()
.dailySchedule(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs.builder()
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionTimes("string")
.build())
.monthlySchedule(com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs.builder()
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionScheduleDaily(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionFormatArgs.builder()
.daysOfTheMonth(com.pulumi.azurenative.recoveryservices.inputs.DayArgs.builder()
.date(0)
.isLast(false)
.build())
.build())
.retentionScheduleFormatType("string")
.retentionScheduleWeekly(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("string")
.build())
.weeklySchedule(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionTimes("string")
.build())
.yearlySchedule(com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs.builder()
.monthsOfYear("Invalid")
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionScheduleDaily(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionFormatArgs.builder()
.daysOfTheMonth(com.pulumi.azurenative.recoveryservices.inputs.DayArgs.builder()
.date(0)
.isLast(false)
.build())
.build())
.retentionScheduleFormatType("string")
.retentionScheduleWeekly(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("string")
.build())
.build())
.schedulePolicy(com.pulumi.azurenative.recoveryservices.inputs.LogSchedulePolicyArgs.builder()
.scheduleFrequencyInMins(0)
.build())
.timeZone("string")
.vaultRetentionPolicy(VaultRetentionPolicyArgs.builder()
.snapshotRetentionInDays(0)
.vaultRetention(com.pulumi.azurenative.recoveryservices.inputs.LongTermRetentionPolicyArgs.builder()
.dailySchedule(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionScheduleArgs.builder()
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionTimes("string")
.build())
.monthlySchedule(com.pulumi.azurenative.recoveryservices.inputs.MonthlyRetentionScheduleArgs.builder()
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionScheduleDaily(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionFormatArgs.builder()
.daysOfTheMonth(com.pulumi.azurenative.recoveryservices.inputs.DayArgs.builder()
.date(0)
.isLast(false)
.build())
.build())
.retentionScheduleFormatType("string")
.retentionScheduleWeekly(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("string")
.build())
.weeklySchedule(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionScheduleArgs.builder()
.daysOfTheWeek("Sunday")
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionTimes("string")
.build())
.yearlySchedule(com.pulumi.azurenative.recoveryservices.inputs.YearlyRetentionScheduleArgs.builder()
.monthsOfYear("Invalid")
.retentionDuration(com.pulumi.azurenative.recoveryservices.inputs.RetentionDurationArgs.builder()
.count(0)
.durationType("string")
.build())
.retentionScheduleDaily(com.pulumi.azurenative.recoveryservices.inputs.DailyRetentionFormatArgs.builder()
.daysOfTheMonth(com.pulumi.azurenative.recoveryservices.inputs.DayArgs.builder()
.date(0)
.isLast(false)
.build())
.build())
.retentionScheduleFormatType("string")
.retentionScheduleWeekly(com.pulumi.azurenative.recoveryservices.inputs.WeeklyRetentionFormatArgs.builder()
.daysOfTheWeek("Sunday")
.weeksOfTheMonth("First")
.build())
.retentionTimes("string")
.build())
.build())
.build())
.workLoadType("string")
.build())
.tags(Map.of("string", "string"))
.build());
protection_policy_resource = azure_native.recoveryservices.ProtectionPolicy("protectionPolicyResource",
resource_group_name="string",
vault_name="string",
e_tag="string",
location="string",
policy_name="string",
properties={
"backup_management_type": "AzureStorage",
"protected_items_count": 0,
"resource_guard_operation_requests": ["string"],
"retention_policy": {
"retention_policy_type": "LongTermRetentionPolicy",
"daily_schedule": {
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_times": ["string"],
},
"monthly_schedule": {
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_schedule_daily": {
"days_of_the_month": [{
"date": 0,
"is_last": False,
}],
},
"retention_schedule_format_type": "string",
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["string"],
},
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_times": ["string"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.INVALID],
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_schedule_daily": {
"days_of_the_month": [{
"date": 0,
"is_last": False,
}],
},
"retention_schedule_format_type": "string",
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["string"],
},
},
"schedule_policy": {
"schedule_policy_type": "LogSchedulePolicy",
"schedule_frequency_in_mins": 0,
},
"time_zone": "string",
"vault_retention_policy": {
"snapshot_retention_in_days": 0,
"vault_retention": {
"retention_policy_type": "LongTermRetentionPolicy",
"daily_schedule": {
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_times": ["string"],
},
"monthly_schedule": {
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_schedule_daily": {
"days_of_the_month": [{
"date": 0,
"is_last": False,
}],
},
"retention_schedule_format_type": "string",
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["string"],
},
"weekly_schedule": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_times": ["string"],
},
"yearly_schedule": {
"months_of_year": [azure_native.recoveryservices.MonthOfYear.INVALID],
"retention_duration": {
"count": 0,
"duration_type": "string",
},
"retention_schedule_daily": {
"days_of_the_month": [{
"date": 0,
"is_last": False,
}],
},
"retention_schedule_format_type": "string",
"retention_schedule_weekly": {
"days_of_the_week": [azure_native.recoveryservices.DayOfWeek.SUNDAY],
"weeks_of_the_month": [azure_native.recoveryservices.WeekOfMonth.FIRST],
},
"retention_times": ["string"],
},
},
},
"work_load_type": "string",
},
tags={
"string": "string",
})
const protectionPolicyResource = new azure_native.recoveryservices.ProtectionPolicy("protectionPolicyResource", {
resourceGroupName: "string",
vaultName: "string",
eTag: "string",
location: "string",
policyName: "string",
properties: {
backupManagementType: "AzureStorage",
protectedItemsCount: 0,
resourceGuardOperationRequests: ["string"],
retentionPolicy: {
retentionPolicyType: "LongTermRetentionPolicy",
dailySchedule: {
retentionDuration: {
count: 0,
durationType: "string",
},
retentionTimes: ["string"],
},
monthlySchedule: {
retentionDuration: {
count: 0,
durationType: "string",
},
retentionScheduleDaily: {
daysOfTheMonth: [{
date: 0,
isLast: false,
}],
},
retentionScheduleFormatType: "string",
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["string"],
},
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 0,
durationType: "string",
},
retentionTimes: ["string"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.Invalid],
retentionDuration: {
count: 0,
durationType: "string",
},
retentionScheduleDaily: {
daysOfTheMonth: [{
date: 0,
isLast: false,
}],
},
retentionScheduleFormatType: "string",
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["string"],
},
},
schedulePolicy: {
schedulePolicyType: "LogSchedulePolicy",
scheduleFrequencyInMins: 0,
},
timeZone: "string",
vaultRetentionPolicy: {
snapshotRetentionInDays: 0,
vaultRetention: {
retentionPolicyType: "LongTermRetentionPolicy",
dailySchedule: {
retentionDuration: {
count: 0,
durationType: "string",
},
retentionTimes: ["string"],
},
monthlySchedule: {
retentionDuration: {
count: 0,
durationType: "string",
},
retentionScheduleDaily: {
daysOfTheMonth: [{
date: 0,
isLast: false,
}],
},
retentionScheduleFormatType: "string",
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["string"],
},
weeklySchedule: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
retentionDuration: {
count: 0,
durationType: "string",
},
retentionTimes: ["string"],
},
yearlySchedule: {
monthsOfYear: [azure_native.recoveryservices.MonthOfYear.Invalid],
retentionDuration: {
count: 0,
durationType: "string",
},
retentionScheduleDaily: {
daysOfTheMonth: [{
date: 0,
isLast: false,
}],
},
retentionScheduleFormatType: "string",
retentionScheduleWeekly: {
daysOfTheWeek: [azure_native.recoveryservices.DayOfWeek.Sunday],
weeksOfTheMonth: [azure_native.recoveryservices.WeekOfMonth.First],
},
retentionTimes: ["string"],
},
},
},
workLoadType: "string",
},
tags: {
string: "string",
},
});
type: azure-native:recoveryservices:ProtectionPolicy
properties:
eTag: string
location: string
policyName: string
properties:
backupManagementType: AzureStorage
protectedItemsCount: 0
resourceGuardOperationRequests:
- string
retentionPolicy:
dailySchedule:
retentionDuration:
count: 0
durationType: string
retentionTimes:
- string
monthlySchedule:
retentionDuration:
count: 0
durationType: string
retentionScheduleDaily:
daysOfTheMonth:
- date: 0
isLast: false
retentionScheduleFormatType: string
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- string
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 0
durationType: string
retentionTimes:
- string
yearlySchedule:
monthsOfYear:
- Invalid
retentionDuration:
count: 0
durationType: string
retentionScheduleDaily:
daysOfTheMonth:
- date: 0
isLast: false
retentionScheduleFormatType: string
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- string
schedulePolicy:
scheduleFrequencyInMins: 0
schedulePolicyType: LogSchedulePolicy
timeZone: string
vaultRetentionPolicy:
snapshotRetentionInDays: 0
vaultRetention:
dailySchedule:
retentionDuration:
count: 0
durationType: string
retentionTimes:
- string
monthlySchedule:
retentionDuration:
count: 0
durationType: string
retentionScheduleDaily:
daysOfTheMonth:
- date: 0
isLast: false
retentionScheduleFormatType: string
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- string
retentionPolicyType: LongTermRetentionPolicy
weeklySchedule:
daysOfTheWeek:
- Sunday
retentionDuration:
count: 0
durationType: string
retentionTimes:
- string
yearlySchedule:
monthsOfYear:
- Invalid
retentionDuration:
count: 0
durationType: string
retentionScheduleDaily:
daysOfTheMonth:
- date: 0
isLast: false
retentionScheduleFormatType: string
retentionScheduleWeekly:
daysOfTheWeek:
- Sunday
weeksOfTheMonth:
- First
retentionTimes:
- string
workLoadType: string
resourceGroupName: string
tags:
string: string
vaultName: string
ProtectionPolicy Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProtectionPolicy resource accepts the following input properties:
Outputs
All input properties are implicitly available as output properties. Additionally, the ProtectionPolicy resource produces the following output properties:
- AzureApiVersion
string
- The Azure API version of the resource.
- Id
string
- The provider-assigned unique ID for this managed resource.
- Name
string
- Resource name associated with the resource.
- Type
string
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- AzureApiVersion
string
- The Azure API version of the resource.
- Id
string
- The provider-assigned unique ID for this managed resource.
- Name
string
- Resource name associated with the resource.
- Type
string
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- azure_api_version
string
- The Azure API version of the resource.
- id
string
- The provider-assigned unique ID for this managed resource.
- name
string
- Resource name associated with the resource.
- type
string
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- azureApiVersion
String
- The Azure API version of the resource.
- id
String
- The provider-assigned unique ID for this managed resource.
- name
String
- Resource name associated with the resource.
- type
String
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- azureApiVersion
string
- The Azure API version of the resource.
- id
string
- The provider-assigned unique ID for this managed resource.
- name
string
- Resource name associated with the resource.
- type
string
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- azure_api_version
str
- The Azure API version of the resource.
- id
str
- The provider-assigned unique ID for this managed resource.
- name
str
- Resource name associated with the resource.
- type
str
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
- azureApiVersion
String
- The Azure API version of the resource.
- id
String
- The provider-assigned unique ID for this managed resource.
- name
String
- Resource name associated with the resource.
- type
String
- Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/...
Look up Existing ProtectionPolicy Resource
Get an existing ProtectionPolicy resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
func GetProtectionPolicy(ctx *Context, name string, id IDInput, state *ProtectionPolicyState, opts ...ResourceOption) (*ProtectionPolicy, error)
public static ProtectionPolicy get(String name, Output<String> id, CustomResourceOptions options)
resources: existingProtectionPolicy: type: azure-native:recoveryservices:ProtectionPolicy get: id: ${id}
import {
to = azure-native_recoveryservices_protection_policy.example
id = "${id}"
}
- name
string
- The unique name of the resulting resource.
- id
Input<ID>
- The unique provider ID of the resource to look up.
- opts
CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
str
- The unique name of the resulting resource.
- id
str
- The unique provider ID of the resource to look up.
- opts
ResourceOptions
- Bag of options to control resource's behavior.
- ctx
Context
- Context object for the current deployment.
- name
string
- The unique name of the resulting resource.
- id
IDInput
- The unique provider ID of the resource to look up.
- state
ProtectionPolicyState
- Pass nil. This resource has no state arguments.
- opts
ResourceOption
- Bag of options to control resource's behavior.
- name
string
- The unique name of the resulting resource.
- id
Input<string>
- The unique provider ID of the resource to look up.
- opts
CustomResourceOptions
- Bag of options to control resource's behavior.
- name
String
- The unique name of the resulting resource.
- id
Output<String>
- The unique provider ID of the resource to look up.
- options
CustomResourceOptions
- Bag of options to control resource's behavior.
Supporting Types
AzureFileShareProtectionPolicy, AzureFileShareProtectionPolicyArgs
AzureStorage backup policy.
AzureFileShareProtectionPolicyResponse
AzureStorage backup policy.
AzureIaaSVMProtectionPolicy, AzureIaaSVMProtectionPolicyArgs
IaaS VM workload-specific backup policy.
AzureIaaSVMProtectionPolicyResponse
IaaS VM workload-specific backup policy.
AzureSqlProtectionPolicy, AzureSqlProtectionPolicyArgs
Azure SQL workload-specific backup policy.
AzureSqlProtectionPolicyResponse
Azure SQL workload-specific backup policy.
AzureVmWorkloadProtectionPolicy, AzureVmWorkloadProtectionPolicyArgs
Azure VM (Mercury) workload-specific backup policy.
AzureVmWorkloadProtectionPolicyResponse
Azure VM (Mercury) workload-specific backup policy.
Daily retention format.
Daily retention format.
DailyRetentionSchedule, DailyRetentionScheduleArgs
Daily retention schedule.
DailyRetentionScheduleResponse
Daily retention schedule.
DailySchedule, DailyScheduleArgs
DailyScheduleResponse
Day, DayArgs
Day of the week.
- Date
int
- Date of the month
- IsLast
bool
- Whether Date is last date of month
- Date
int
- Date of the month
- IsLast
bool
- Whether Date is last date of month
- date
number
- Date of the month
- is_last
bool
- Whether Date is last date of month
- date
Integer
- Date of the month
- isLast
Boolean
- Whether Date is last date of month
- date
number
- Date of the month
- isLast
boolean
- Whether Date is last date of month
- date
int
- Date of the month
- is_last
bool
- Whether Date is last date of month
- date
Number
- Date of the month
- isLast
Boolean
- Whether Date is last date of month
DayOfWeek
| Name | Value |
|---|
| Sunday | Sunday |
| Monday | Monday |
| Tuesday | Tuesday |
| Wednesday | Wednesday |
| Thursday | Thursday |
| Friday | Friday |
| Saturday | Saturday |
| Name | Value |
|---|
| DayOfWeekSunday | Sunday |
| DayOfWeekMonday | Monday |
| DayOfWeekTuesday | Tuesday |
| DayOfWeekWednesday | Wednesday |
| DayOfWeekThursday | Thursday |
| DayOfWeekFriday | Friday |
| DayOfWeekSaturday | Saturday |
| Value |
|---|
Sunday |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
| Name | Value |
|---|
| Sunday | Sunday |
| Monday | Monday |
| Tuesday | Tuesday |
| Wednesday | Wednesday |
| Thursday | Thursday |
| Friday | Friday |
| Saturday | Saturday |
| Name | Value |
|---|
| Sunday | Sunday |
| Monday | Monday |
| Tuesday | Tuesday |
| Wednesday | Wednesday |
| Thursday | Thursday |
| Friday | Friday |
| Saturday | Saturday |
| Name | Value |
|---|
| SUNDAY | Sunday |
| MONDAY | Monday |
| TUESDAY | Tuesday |
| WEDNESDAY | Wednesday |
| THURSDAY | Thursday |
| FRIDAY | Friday |
| SATURDAY | Saturday |
| Value |
|---|
Sunday |
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
DayResponse
Day of the week.
- Date
int
- Date of the month
- IsLast
bool
- Whether Date is last date of month
- Date
int
- Date of the month
- IsLast
bool
- Whether Date is last date of month
- date
number
- Date of the month
- is_last
bool
- Whether Date is last date of month
- date
Integer
- Date of the month
- isLast
Boolean
- Whether Date is last date of month
- date
number
- Date of the month
- isLast
boolean
- Whether Date is last date of month
- date
int
- Date of the month
- is_last
bool
- Whether Date is last date of month
- date
Number
- Date of the month
- isLast
Boolean
- Whether Date is last date of month
GenericProtectionPolicy, GenericProtectionPolicyArgs
Azure VM (Mercury) workload-specific backup policy.
GenericProtectionPolicyResponse
Azure VM (Mercury) workload-specific backup policy.
HourlySchedule, HourlyScheduleArgs
HourlyScheduleResponse
IAASVMPolicyType
| Name | Value |
|---|
| Invalid | Invalid |
| V1 | V1 |
| V2 | V2 |
| Name | Value |
|---|
| IAASVMPolicyTypeInvalid | Invalid |
| IAASVMPolicyTypeV1 | V1 |
| IAASVMPolicyTypeV2 | V2 |
| Name | Value |
|---|
| Invalid | Invalid |
| V1 | V1 |
| V2 | V2 |
| Name | Value |
|---|
| Invalid | Invalid |
| V1 | V1 |
| V2 | V2 |
| Name | Value |
|---|
| INVALID | Invalid |
| V1 | V1 |
| V2 | V2 |
IaasVMSnapshotConsistencyType
| Name | Value |
|---|
| OnlyCrashConsistent | OnlyCrashConsistent |
| Name | Value |
|---|
| IaasVMSnapshotConsistencyTypeOnlyCrashConsistent | OnlyCrashConsistent |
| Name | Value |
|---|
| OnlyCrashConsistent | OnlyCrashConsistent |
| Name | Value |
|---|
| OnlyCrashConsistent | OnlyCrashConsistent |
| Name | Value |
|---|
| ONLY_CRASH_CONSISTENT | OnlyCrashConsistent |
InstantRPAdditionalDetails, InstantRPAdditionalDetailsArgs
InstantRPAdditionalDetailsResponse
LogSchedulePolicy, LogSchedulePolicyArgs
Log policy schedule.
LogSchedulePolicyResponse
Log policy schedule.
LongTermRetentionPolicy, LongTermRetentionPolicyArgs
Long term retention policy.
LongTermRetentionPolicyResponse
Long term retention policy.
LongTermSchedulePolicy, LongTermSchedulePolicyArgs
Long term policy schedule.
LongTermSchedulePolicyResponse
Long term policy schedule.
MabProtectionPolicy, MabProtectionPolicyArgs
Mab container-specific backup policy.
MabProtectionPolicyResponse
Mab container-specific backup policy.
MonthOfYear
| Name | Value |
|---|
| Invalid | Invalid |
| January | January |
| February | February |
| March | March |
| April | April |
| May | May |
| June | June |
| July | July |
| August | August |
| September | September |
| October | October |
| November | November |
| December | December |
| Name | Value |
|---|
| MonthOfYearInvalid | Invalid |
| MonthOfYearJanuary | January |
| MonthOfYearFebruary | February |
| MonthOfYearMarch | March |
| MonthOfYearApril | April |
| MonthOfYearMay | May |
| MonthOfYearJune | June |
| MonthOfYearJuly | July |
| MonthOfYearAugust | August |
| MonthOfYearSeptember | September |
| MonthOfYearOctober | October |
| MonthOfYearNovember | November |
| MonthOfYearDecember | December |
| Value |
|---|
Invalid |
January |
February |
March |
April |
May |
June |
July |
August |
September |
October |
November |
December |
| Name | Value |
|---|
| Invalid | Invalid |
| January | January |
| February | February |
| March | March |
| April | April |
| May | May |
| June | June |
| July | July |
| August | August |
| September | September |
| October | October |
| November | November |
| December | December |
| Name | Value |
|---|
| Invalid | Invalid |
| January | January |
| February | February |
| March | March |
| April | April |
| May | May |
| June | June |
| July | July |
| August | August |
| September | September |
| October | October |
| November | November |
| December | December |
| Name | Value |
|---|
| INVALID | Invalid |
| JANUARY | January |
| FEBRUARY | February |
| MARCH | March |
| APRIL | April |
| MAY | May |
| JUNE | June |
| JULY | July |
| AUGUST | August |
| SEPTEMBER | September |
| OCTOBER | October |
| NOVEMBER | November |
| DECEMBER | December |
| Value |
|---|
Invalid |
January |
February |
March |
April |
May |
June |
July |
August |
September |
October |
November |
December |
MonthlyRetentionSchedule, MonthlyRetentionScheduleArgs
Monthly retention schedule.
MonthlyRetentionScheduleResponse
Monthly retention schedule.
PolicyType
Type of backup policy type
| Name | Value |
|---|
| Invalid | Invalid |
| Full | Full |
| Differential | Differential |
| Log | Log |
| CopyOnlyFull | CopyOnlyFull |
| Incremental | Incremental |
| SnapshotFull | SnapshotFull |
| SnapshotCopyOnlyFull | SnapshotCopyOnlyFull |
| Name | Value |
|---|
| PolicyTypeInvalid | Invalid |
| PolicyTypeFull | Full |
| PolicyTypeDifferential | Differential |
| PolicyTypeLog | Log |
| PolicyTypeCopyOnlyFull | CopyOnlyFull |
| PolicyTypeIncremental | Incremental |
| PolicyTypeSnapshotFull | SnapshotFull |
| PolicyTypeSnapshotCopyOnlyFull | SnapshotCopyOnlyFull |
| Value |
|---|
Invalid |
Full |
Differential |
Log |
CopyOnlyFull |
Incremental |
SnapshotFull |
SnapshotCopyOnlyFull |
| Name | Value |
|---|
| Invalid | Invalid |
| Full | Full |
| Differential | Differential |
| Log | Log |
| CopyOnlyFull | CopyOnlyFull |
| Incremental | Incremental |
| SnapshotFull | SnapshotFull |
| SnapshotCopyOnlyFull | SnapshotCopyOnlyFull |
| Name | Value |
|---|
| Invalid | Invalid |
| Full | Full |
| Differential | Differential |
| Log | Log |
| CopyOnlyFull | CopyOnlyFull |
| Incremental | Incremental |
| SnapshotFull | SnapshotFull |
| SnapshotCopyOnlyFull | SnapshotCopyOnlyFull |
| Name | Value |
|---|
| INVALID | Invalid |
| FULL | Full |
| DIFFERENTIAL | Differential |
| LOG | Log |
| COPY_ONLY_FULL | CopyOnlyFull |
| INCREMENTAL | Incremental |
| SNAPSHOT_FULL | SnapshotFull |
| SNAPSHOT_COPY_ONLY_FULL | SnapshotCopyOnlyFull |
| Value |
|---|
Invalid |
Full |
Differential |
Log |
CopyOnlyFull |
Incremental |
SnapshotFull |
SnapshotCopyOnlyFull |
RetentionDuration, RetentionDurationArgs
Retention duration.
- Count
int
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- DurationType
string | RetentionDurationType
- Retention duration type of retention policy.
- count
Integer
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- durationType
String | RetentionDurationType
- Retention duration type of retention policy.
- count
number
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- durationType
string | RetentionDurationType
- Retention duration type of retention policy.
- count
int
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- duration_type
str | RetentionDurationType
- Retention duration type of retention policy.
RetentionDurationResponse
Retention duration.
- Count
int
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- DurationType
string
- Retention duration type of retention policy.
- Count
int
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- DurationType
string
- Retention duration type of retention policy.
- count
number
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- duration_type
string
- Retention duration type of retention policy.
- count
Integer
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- durationType
String
- Retention duration type of retention policy.
- count
number
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- durationType
string
- Retention duration type of retention policy.
- count
int
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- duration_type
str
- Retention duration type of retention policy.
- count
Number
- Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
- durationType
String
- Retention duration type of retention policy.
RetentionDurationType
Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
| Name | Value |
|---|
| Invalid | Invalid |
| Days | Days |
| Weeks | Weeks |
| Months | Months |
| Years | Years |
| Name | Value |
|---|
| RetentionDurationTypeInvalid | Invalid |
| RetentionDurationTypeDays | Days |
| RetentionDurationTypeWeeks | Weeks |
| RetentionDurationTypeMonths | Months |
| RetentionDurationTypeYears | Years |
| Value |
|---|
Invalid |
Days |
Weeks |
Months |
Years |
| Name | Value |
|---|
| Invalid | Invalid |
| Days | Days |
| Weeks | Weeks |
| Months | Months |
| Years | Years |
| Name | Value |
|---|
| Invalid | Invalid |
| Days | Days |
| Weeks | Weeks |
| Months | Months |
| Years | Years |
| Name | Value |
|---|
| INVALID | Invalid |
| DAYS | Days |
| WEEKS | Weeks |
| MONTHS | Months |
| YEARS | Years |
| Value |
|---|
Invalid |
Days |
Weeks |
Months |
Years |
Retention schedule format for yearly retention policy.
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Name | Value |
|---|
| RetentionScheduleFormatInvalid | Invalid |
| RetentionScheduleFormatDaily | Daily |
| RetentionScheduleFormatWeekly | Weekly |
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Name | Value |
|---|
| INVALID | Invalid |
| DAILY | Daily |
| WEEKLY | Weekly |
ScheduleRunType
Frequency of the schedule operation of this policy.
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Hourly | Hourly |
| Name | Value |
|---|
| ScheduleRunTypeInvalid | Invalid |
| ScheduleRunTypeDaily | Daily |
| ScheduleRunTypeWeekly | Weekly |
| ScheduleRunTypeHourly | Hourly |
| Value |
|---|
Invalid |
Daily |
Weekly |
Hourly |
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Hourly | Hourly |
| Name | Value |
|---|
| Invalid | Invalid |
| Daily | Daily |
| Weekly | Weekly |
| Hourly | Hourly |
| Name | Value |
|---|
| INVALID | Invalid |
| DAILY | Daily |
| WEEKLY | Weekly |
| HOURLY | Hourly |
| Value |
|---|
Invalid |
Daily |
Weekly |
Hourly |
Settings, SettingsArgs
Common settings field for backup management
- IsCompression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- Issqlcompression
bool
- SQL compression flag
- TimeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- IsCompression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- Issqlcompression
bool
- SQL compression flag
- TimeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- is_compression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
bool
- SQL compression flag
- time_zone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
Boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
Boolean
- SQL compression flag
- timeZone
String
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
boolean
- SQL compression flag
- timeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- is_compression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
bool
- SQL compression flag
- time_zone
str
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
Boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
Boolean
- SQL compression flag
- timeZone
String
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
SettingsResponse
Common settings field for backup management
- IsCompression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- Issqlcompression
bool
- SQL compression flag
- TimeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- IsCompression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- Issqlcompression
bool
- SQL compression flag
- TimeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- is_compression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
bool
- SQL compression flag
- time_zone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
Boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
Boolean
- SQL compression flag
- timeZone
String
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
boolean
- SQL compression flag
- timeZone
string
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- is_compression
bool
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
bool
- SQL compression flag
- time_zone
str
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
- isCompression
Boolean
- Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
- issqlcompression
Boolean
- SQL compression flag
- timeZone
String
- TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time".
SimpleRetentionPolicy, SimpleRetentionPolicyArgs
Simple policy retention.
SimpleRetentionPolicyResponse
Simple policy retention.
SimpleSchedulePolicy, SimpleSchedulePolicyArgs
Simple policy schedule.
SimpleSchedulePolicyResponse
Simple policy schedule.
SimpleSchedulePolicyV2, SimpleSchedulePolicyV2Args
The V2 policy schedule for IaaS that supports hourly backups.
SimpleSchedulePolicyV2Response
The V2 policy schedule for IaaS that supports hourly backups.
SnapshotBackupAdditionalDetails, SnapshotBackupAdditionalDetailsArgs
Snapshot Backup related fields for WorkloadType SaPHanaSystem
SnapshotBackupAdditionalDetailsResponse
Snapshot Backup related fields for WorkloadType SaPHanaSystem
SubProtectionPolicy, SubProtectionPolicyArgs
Sub-protection policy which includes schedule and retention
SubProtectionPolicyResponse
Sub-protection policy which includes schedule and retention
TieringMode
Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
| Name | Value |
|---|
| Invalid | Invalid |
| TierRecommended | TierRecommended |
| TierAfter | TierAfter |
| DoNotTier | DoNotTier |
| Name | Value |
|---|
| TieringModeInvalid | Invalid |
| TieringModeTierRecommended | TierRecommended |
| TieringModeTierAfter | TierAfter |
| TieringModeDoNotTier | DoNotTier |
| Value |
|---|
Invalid |
TierRecommended |
TierAfter |
DoNotTier |
| Name | Value |
|---|
| Invalid | Invalid |
| TierRecommended | TierRecommended |
| TierAfter | TierAfter |
| DoNotTier | DoNotTier |
| Name | Value |
|---|
| Invalid | Invalid |
| TierRecommended | TierRecommended |
| TierAfter | TierAfter |
| DoNotTier | DoNotTier |
| Name | Value |
|---|
| INVALID | Invalid |
| TIER_RECOMMENDED | TierRecommended |
| TIER_AFTER | TierAfter |
| DO_NOT_TIER | DoNotTier |
| Value |
|---|
Invalid |
TierRecommended |
TierAfter |
DoNotTier |
TieringPolicy, TieringPolicyArgs
Tiering Policy for a target tier.
If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that tier
- Duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- DurationType
string | Pulumi.AzureNative.RecoveryServices.RetentionDurationType
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- TieringMode
string | Pulumi.AzureNative.RecoveryServices.TieringMode
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- Duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- DurationType
string | RetentionDurationType
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- TieringMode
string | TieringMode
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
Integer
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- durationType
String | RetentionDurationType
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tieringMode
String | TieringMode
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
number
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- durationType
string | RetentionDurationType
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tieringMode
string | TieringMode
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- duration_type
str | RetentionDurationType
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tiering_mode
str | TieringMode
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
TieringPolicyResponse
Tiering Policy for a target tier.
If the policy is not specified for a given target tier, service retains the existing configured tiering policy for that tier
- Duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- DurationType
string
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- TieringMode
string
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- Duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- DurationType
string
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- TieringMode
string
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
number
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- duration_type
string
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tiering_mode
string
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
Integer
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- durationType
String
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tieringMode
String
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
number
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- durationType
string
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tieringMode
string
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
int
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- duration_type
str
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tiering_mode
str
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
- duration
Number
- Number of days/weeks/months/years to retain backups in current tier before tiering.
Used only if TieringMode is set to TierAfter
- durationType
String
- Retention duration type: days/weeks/months/years
Used only if TieringMode is set to TierAfter
- tieringMode
String
- Tiering Mode to control automatic tiering of recovery points. Supported values are:
- TierRecommended: Tier all recovery points recommended to be tiered
- TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
- DoNotTier: Do not tier any recovery points
UserAssignedIdentityProperties, UserAssignedIdentityPropertiesArgs
User assigned managed identity properties
- ClientId
string
- The client ID of the assigned identity.
- PrincipalId
string
- The principal ID of the assigned identity.
- ClientId
string
- The client ID of the assigned identity.
- PrincipalId
string
- The principal ID of the assigned identity.
- client_id
string
- The client ID of the assigned identity.
- principal_id
string
- The principal ID of the assigned identity.
- clientId
String
- The client ID of the assigned identity.
- principalId
String
- The principal ID of the assigned identity.
- clientId
string
- The client ID of the assigned identity.
- principalId
string
- The principal ID of the assigned identity.
- client_id
str
- The client ID of the assigned identity.
- principal_id
str
- The principal ID of the assigned identity.
- clientId
String
- The client ID of the assigned identity.
- principalId
String
- The principal ID of the assigned identity.
UserAssignedIdentityPropertiesResponse
User assigned managed identity properties
- ClientId
string
- The client ID of the assigned identity.
- PrincipalId
string
- The principal ID of the assigned identity.
- ClientId
string
- The client ID of the assigned identity.
- PrincipalId
string
- The principal ID of the assigned identity.
- client_id
string
- The client ID of the assigned identity.
- principal_id
string
- The principal ID of the assigned identity.
- clientId
String
- The client ID of the assigned identity.
- principalId
String
- The principal ID of the assigned identity.
- clientId
string
- The client ID of the assigned identity.
- principalId
string
- The principal ID of the assigned identity.
- client_id
str
- The client ID of the assigned identity.
- principal_id
str
- The principal ID of the assigned identity.
- clientId
String
- The client ID of the assigned identity.
- principalId
String
- The principal ID of the assigned identity.
UserAssignedManagedIdentityDetails, UserAssignedManagedIdentityDetailsArgs
User assigned managed identity details
UserAssignedManagedIdentityDetailsResponse
User assigned managed identity details
VaultRetentionPolicy, VaultRetentionPolicyArgs
Vault retention policy for AzureFileShare
VaultRetentionPolicyResponse
Vault retention policy for AzureFileShare
WeekOfMonth
| Name | Value |
|---|
| First | First |
| Second | Second |
| Third | Third |
| Fourth | Fourth |
| Last | Last |
| Invalid | Invalid |
| Name | Value |
|---|
| WeekOfMonthFirst | First |
| WeekOfMonthSecond | Second |
| WeekOfMonthThird | Third |
| WeekOfMonthFourth | Fourth |
| WeekOfMonthLast | Last |
| WeekOfMonthInvalid | Invalid |
| Value |
|---|
First |
Second |
Third |
Fourth |
Last |
Invalid |
| Name | Value |
|---|
| First | First |
| Second | Second |
| Third | Third |
| Fourth | Fourth |
| Last | Last |
| Invalid | Invalid |
| Name | Value |
|---|
| First | First |
| Second | Second |
| Third | Third |
| Fourth | Fourth |
| Last | Last |
| Invalid | Invalid |
| Name | Value |
|---|
| FIRST | First |
| SECOND | Second |
| THIRD | Third |
| FOURTH | Fourth |
| LAST | Last |
| INVALID | Invalid |
| Value |
|---|
First |
Second |
Third |
Fourth |
Last |
Invalid |
Weekly retention format.
Weekly retention format.
WeeklyRetentionSchedule, WeeklyRetentionScheduleArgs
Weekly retention schedule.
WeeklyRetentionScheduleResponse
Weekly retention schedule.
WeeklySchedule, WeeklyScheduleArgs
WeeklyScheduleResponse
WorkloadType
Type of workload for the backup management
| Name | Value |
|---|
| Invalid | Invalid |
| VM | VM |
| FileFolder | FileFolder |
| AzureSqlDb | AzureSqlDb |
| SQLDB | SQLDB |
| Exchange | Exchange |
| Sharepoint | Sharepoint |
| VMwareVM | VMwareVM |
| SystemState | SystemState |
| Client | Client |
| GenericDataSource | GenericDataSource |
| SQLDataBase | SQLDataBase |
| AzureFileShare | AzureFileShare |
| SAPHanaDatabase | SAPHanaDatabase |
| SAPAseDatabase | SAPAseDatabase |
| SAPHanaDBInstance | SAPHanaDBInstance |
| Name | Value |
|---|
| WorkloadTypeInvalid | Invalid |
| WorkloadTypeVM | VM |
| WorkloadTypeFileFolder | FileFolder |
| WorkloadTypeAzureSqlDb | AzureSqlDb |
| WorkloadTypeSQLDB | SQLDB |
| WorkloadTypeExchange | Exchange |
| WorkloadTypeSharepoint | Sharepoint |
| WorkloadTypeVMwareVM | VMwareVM |
| WorkloadTypeSystemState | SystemState |
| WorkloadTypeClient | Client |
| WorkloadTypeGenericDataSource | GenericDataSource |
| WorkloadTypeSQLDataBase | SQLDataBase |
| WorkloadTypeAzureFileShare | AzureFileShare |
| WorkloadTypeSAPHanaDatabase | SAPHanaDatabase |
| WorkloadTypeSAPAseDatabase | SAPAseDatabase |
| WorkloadTypeSAPHanaDBInstance | SAPHanaDBInstance |
| Value |
|---|
Invalid |
VM |
FileFolder |
AzureSqlDb |
SQLDB |
Exchange |
Sharepoint |
VMwareVM |
SystemState |
Client |
GenericDataSource |
SQLDataBase |
AzureFileShare |
SAPHanaDatabase |
SAPAseDatabase |
SAPHanaDBInstance |
| Name | Value |
|---|
| Invalid | Invalid |
| VM | VM |
| FileFolder | FileFolder |
| AzureSqlDb | AzureSqlDb |
| SQLDB | SQLDB |
| Exchange | Exchange |
| Sharepoint | Sharepoint |
| VMwareVM | VMwareVM |
| SystemState | SystemState |
| Client | Client |
| GenericDataSource | GenericDataSource |
| SQLDataBase | SQLDataBase |
| AzureFileShare | AzureFileShare |
| SAPHanaDatabase | SAPHanaDatabase |
| SAPAseDatabase | SAPAseDatabase |
| SAPHanaDBInstance | SAPHanaDBInstance |
| Name | Value |
|---|
| Invalid | Invalid |
| VM | VM |
| FileFolder | FileFolder |
| AzureSqlDb | AzureSqlDb |
| SQLDB | SQLDB |
| Exchange | Exchange |
| Sharepoint | Sharepoint |
| VMwareVM | VMwareVM |
| SystemState | SystemState |
| Client | Client |
| GenericDataSource | GenericDataSource |
| SQLDataBase | SQLDataBase |
| AzureFileShare | AzureFileShare |
| SAPHanaDatabase | SAPHanaDatabase |
| SAPAseDatabase | SAPAseDatabase |
| SAPHanaDBInstance | SAPHanaDBInstance |
| Name | Value |
|---|
| INVALID | Invalid |
| VM | VM |
| FILE_FOLDER | FileFolder |
| AZURE_SQL_DB | AzureSqlDb |
| SQLDB | SQLDB |
| EXCHANGE | Exchange |
| SHAREPOINT | Sharepoint |
| V_MWARE_VM | VMwareVM |
| SYSTEM_STATE | SystemState |
| CLIENT | Client |
| GENERIC_DATA_SOURCE | GenericDataSource |
| SQL_DATA_BASE | SQLDataBase |
| AZURE_FILE_SHARE | AzureFileShare |
| SAP_HANA_DATABASE | SAPHanaDatabase |
| SAPASE_DATABASE | SAPAseDatabase |
| SAP_HANA_DB_INSTANCE | SAPHanaDBInstance |
| Value |
|---|
Invalid |
VM |
FileFolder |
AzureSqlDb |
SQLDB |
Exchange |
Sharepoint |
VMwareVM |
SystemState |
Client |
GenericDataSource |
SQLDataBase |
AzureFileShare |
SAPHanaDatabase |
SAPAseDatabase |
SAPHanaDBInstance |
YearlyRetentionSchedule, YearlyRetentionScheduleArgs
Yearly retention schedule.
YearlyRetentionScheduleResponse
Yearly retention schedule.
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:recoveryservices:ProtectionPolicy testPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0