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

com.pulumi.azurenative.recoveryservices.ProtectionPolicy Maven / Gradle / Ivy

There is a newer version: 2.78.0
Show newest version
// *** 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 eTag; /** * @return Optional ETag. * */ public Output> eTag() { return Codegen.optional(this.eTag); } /** * Resource location. * */ @Export(name="location", refs={String.class}, tree="[0]") private Output 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 properties; /** * @return ProtectionPolicyResource properties * */ public Output properties() { return this.properties; } /** * Resource tags. * */ @Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]") private Output> tags; /** * @return Resource tags. * */ public Output>> tags() { return Codegen.optional(this.tags); } /** * Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... * */ public Output type() { return this.type; } /** * * @param name The _unique_ name of the resulting resource. */ public ProtectionPolicy(java.lang.String name) { this(name, ProtectionPolicyArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public ProtectionPolicy(java.lang.String name, ProtectionPolicyArgs args) { this(name, args, null); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. * @param options A bag of options that control this resource's behavior. */ public ProtectionPolicy(java.lang.String name, ProtectionPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:recoveryservices:ProtectionPolicy", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private ProtectionPolicy(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:recoveryservices:ProtectionPolicy", name, null, makeResourceOptions(options, id), false); } private static ProtectionPolicyArgs makeArgs(ProtectionPolicyArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? ProtectionPolicyArgs.Empty : args; } private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) { var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder() .version(Utilities.getVersion()) .aliases(List.of( Output.of(Alias.builder().type("azure-native:recoveryservices/v20160601:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20201001:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20201201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210101:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210201preview:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210210:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210301:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210401:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210601:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210701:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20210801:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20211001:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20211201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220101:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220301:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220401:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220601preview:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220901preview:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20220930preview:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20221001:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20230101:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20230201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20230401:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20230601:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20230801:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20240101:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20240201:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20240401:ProtectionPolicy").build()), Output.of(Alias.builder().type("azure-native:recoveryservices/v20240430preview:ProtectionPolicy").build()) )) .build(); return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id); } /** * Get an existing Host resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param options Optional settings to control the behavior of the CustomResource. */ public static ProtectionPolicy get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new ProtectionPolicy(name, id, options); } }