com.pulumi.azurenative.recoveryservices.ProtectionPolicy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.recoveryservices;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.recoveryservices.ProtectionPolicyArgs;
import com.pulumi.azurenative.recoveryservices.outputs.AzureFileShareProtectionPolicyResponse;
import com.pulumi.azurenative.recoveryservices.outputs.AzureIaaSVMProtectionPolicyResponse;
import com.pulumi.azurenative.recoveryservices.outputs.AzureSqlProtectionPolicyResponse;
import com.pulumi.azurenative.recoveryservices.outputs.AzureVmWorkloadProtectionPolicyResponse;
import com.pulumi.azurenative.recoveryservices.outputs.GenericProtectionPolicyResponse;
import com.pulumi.azurenative.recoveryservices.outputs.MabProtectionPolicyResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Object;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Base class for backup policy. Workload-specific backup policies are derived from this class.
* Azure REST API version: 2023-04-01. Prior API version in Azure Native 1.x: 2021-02-01.
*
* Other available API versions: 2016-06-01, 2023-06-01, 2023-08-01, 2024-01-01, 2024-02-01, 2024-04-01, 2024-04-30-preview.
*
* ## Example Usage
* ### Create or Update Daily Azure Storage Protection Policy
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("dailyPolicy2")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureStorage")
* .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())
* .retentionPolicyType("LongTermRetentionPolicy")
* .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()
* .schedulePolicyType("SimpleSchedulePolicy")
* .scheduleRunFrequency("Daily")
* .scheduleRunTimes("2021-09-29T08:00:00.000Z")
* .build())
* .timeZone("UTC")
* .workLoadType("AzureFileShare")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("swaggertestvault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Enhanced Azure Vm Protection Policy with Hourly backup
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("v2-daily-sample")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureIaasVM")
* .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())
* .retentionPolicyType("LongTermRetentionPolicy")
* .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())
* .schedulePolicyType("SimpleSchedulePolicyV2")
* .scheduleRunFrequency("Hourly")
* .build())
* .timeZone("India Standard Time")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("NetSDKTestRsVault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Enhanced Azure Vm Protection Policy with daily backup
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("v2-daily-sample")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureIaasVM")
* .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())
* .retentionPolicyType("LongTermRetentionPolicy")
* .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())
* .schedulePolicyType("SimpleSchedulePolicyV2")
* .scheduleRunFrequency("Daily")
* .build())
* .timeZone("India Standard Time")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("NetSDKTestRsVault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Full Azure Vm Protection Policy
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("testPolicy1")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureIaasVM")
* .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())
* .retentionPolicyType("LongTermRetentionPolicy")
* .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()
* .schedulePolicyType("SimpleSchedulePolicy")
* .scheduleRunDays(
* "Monday",
* "Wednesday",
* "Thursday")
* .scheduleRunFrequency("Weekly")
* .scheduleRunTimes("2018-01-24T10:00:00Z")
* .build())
* .timeZone("Pacific Standard Time")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("NetSDKTestRsVault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Full Azure Workload Protection Policy
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("testPolicy1")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureWorkload")
* .settings(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .subProtectionPolicy(
* %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
* %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
* %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
* .workLoadType("SQLDataBase")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("NetSDKTestRsVault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Hourly Azure Storage Protection Policy
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("newPolicy2")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureStorage")
* .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())
* .retentionPolicyType("LongTermRetentionPolicy")
* .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())
* .schedulePolicyType("SimpleSchedulePolicy")
* .scheduleRunFrequency("Hourly")
* .build())
* .timeZone("UTC")
* .workLoadType("AzureFileShare")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("swaggertestvault")
* .build());
*
* }
* }
*
* }
*
* ### Create or Update Simple Azure Vm Protection Policy
*
*
* {@code
* 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 java.util.List;
* import java.util.ArrayList;
* import java.util.Map;
* import java.io.File;
* import java.nio.file.Files;
* import java.nio.file.Paths;
*
* public class App {
* public static void main(String[] args) {
* Pulumi.run(App::stack);
* }
*
* public static void stack(Context ctx) {
* var protectionPolicy = new ProtectionPolicy("protectionPolicy", ProtectionPolicyArgs.builder()
* .policyName("testPolicy1")
* .properties(AzureFileShareProtectionPolicyArgs.builder()
* .backupManagementType("AzureIaasVM")
* .retentionPolicy(LongTermRetentionPolicyArgs.builder()
* .dailySchedule(DailyRetentionScheduleArgs.builder()
* .retentionDuration(RetentionDurationArgs.builder()
* .count(1)
* .durationType("Days")
* .build())
* .retentionTimes("2018-01-24T02:00:00Z")
* .build())
* .retentionPolicyType("LongTermRetentionPolicy")
* .build())
* .schedulePolicy(SimpleSchedulePolicyArgs.builder()
* .schedulePolicyType("SimpleSchedulePolicy")
* .scheduleRunFrequency("Daily")
* .scheduleRunTimes("2018-01-24T02:00:00Z")
* .build())
* .timeZone("Pacific Standard Time")
* .build())
* .resourceGroupName("SwaggerTestRg")
* .vaultName("NetSDKTestRsVault")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:recoveryservices:ProtectionPolicy testPolicy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}
* ```
*
*/
@ResourceType(type="azure-native:recoveryservices:ProtectionPolicy")
public class ProtectionPolicy extends com.pulumi.resources.CustomResource {
/**
* Optional ETag.
*
*/
@Export(name="eTag", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> eTag;
/**
* @return Optional ETag.
*
*/
public Output> eTag() {
return Codegen.optional(this.eTag);
}
/**
* Resource location.
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> location;
/**
* @return Resource location.
*
*/
public Output> location() {
return Codegen.optional(this.location);
}
/**
* Resource name associated with the resource.
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Resource name associated with the resource.
*
*/
public Output name() {
return this.name;
}
/**
* ProtectionPolicyResource properties
*
*/
@Export(name="properties", refs={Object.class}, tree="[0]")
private Output
© 2015 - 2024 Weber Informatics LLC | Privacy Policy