
com.pulumi.azurenative.maintenance.MaintenanceConfiguration 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.maintenance;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.maintenance.MaintenanceConfigurationArgs;
import com.pulumi.azurenative.maintenance.outputs.InputPatchConfigurationResponse;
import com.pulumi.azurenative.maintenance.outputs.MaintenanceOverridePropertiesResponse;
import com.pulumi.azurenative.maintenance.outputs.SystemDataResponse;
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.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Maintenance configuration record type
* Azure REST API version: 2022-11-01-preview. Prior API version in Azure Native 1.x: 2020-04-01.
*
* Other available API versions: 2023-04-01, 2023-09-01-preview, 2023-10-01-preview.
*
* ## Example Usage
* ### MaintenanceConfigurations_CreateOrUpdateForResource
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.maintenance.MaintenanceConfiguration;
* import com.pulumi.azurenative.maintenance.MaintenanceConfigurationArgs;
* 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 maintenanceConfiguration = new MaintenanceConfiguration("maintenanceConfiguration", MaintenanceConfigurationArgs.builder()
* .duration("05:00")
* .expirationDateTime("9999-12-31 00:00")
* .location("westus2")
* .maintenanceScope("OSImage")
* .namespace("Microsoft.Maintenance")
* .recurEvery("Day")
* .resourceGroupName("examplerg")
* .resourceName("configuration1")
* .startDateTime("2020-04-30 08:00")
* .timeZone("Pacific Standard Time")
* .visibility("Custom")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:maintenance:MaintenanceConfiguration configuration1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Maintenance/maintenanceConfigurations/{resourceName}
* ```
*
*/
@ResourceType(type="azure-native:maintenance:MaintenanceConfiguration")
public class MaintenanceConfiguration extends com.pulumi.resources.CustomResource {
/**
* Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.
*
*/
@Export(name="duration", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> duration;
/**
* @return Duration of the maintenance window in HH:mm format. If not provided, default value will be used based on maintenance scope provided. Example: 05:00.
*
*/
public Output> duration() {
return Codegen.optional(this.duration);
}
/**
* Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.
*
*/
@Export(name="expirationDateTime", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> expirationDateTime;
/**
* @return Effective expiration date of the maintenance window in YYYY-MM-DD hh:mm format. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone. Expiration date must be set to a future date. If not provided, it will be set to the maximum datetime 9999-12-31 23:59:59.
*
*/
public Output> expirationDateTime() {
return Codegen.optional(this.expirationDateTime);
}
/**
* Gets or sets extensionProperties of the maintenanceConfiguration
*
*/
@Export(name="extensionProperties", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> extensionProperties;
/**
* @return Gets or sets extensionProperties of the maintenanceConfiguration
*
*/
public Output>> extensionProperties() {
return Codegen.optional(this.extensionProperties);
}
/**
* The input parameters to be passed to the patch run operation.
*
*/
@Export(name="installPatches", refs={InputPatchConfigurationResponse.class}, tree="[0]")
private Output* @Nullable */ InputPatchConfigurationResponse> installPatches;
/**
* @return The input parameters to be passed to the patch run operation.
*
*/
public Output> installPatches() {
return Codegen.optional(this.installPatches);
}
/**
* Gets or sets location of the resource
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> location;
/**
* @return Gets or sets location of the resource
*
*/
public Output> location() {
return Codegen.optional(this.location);
}
/**
* Gets or sets maintenanceScope of the configuration
*
*/
@Export(name="maintenanceScope", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> maintenanceScope;
/**
* @return Gets or sets maintenanceScope of the configuration
*
*/
public Output> maintenanceScope() {
return Codegen.optional(this.maintenanceScope);
}
/**
* Name of the resource
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Name of the resource
*
*/
public Output name() {
return this.name;
}
/**
* Gets or sets namespace of the resource
*
*/
@Export(name="namespace", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> namespace;
/**
* @return Gets or sets namespace of the resource
*
*/
public Output> namespace() {
return Codegen.optional(this.namespace);
}
/**
* Override Properties for the maintenance Configuration.
*
*/
@Export(name="overrides", refs={List.class,MaintenanceOverridePropertiesResponse.class}, tree="[0,1]")
private Output* @Nullable */ List> overrides;
/**
* @return Override Properties for the maintenance Configuration.
*
*/
public Output>> overrides() {
return Codegen.optional(this.overrides);
}
/**
* Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.
*
*/
@Export(name="recurEvery", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> recurEvery;
/**
* @return Rate at which a Maintenance window is expected to recur. The rate can be expressed as daily, weekly, or monthly schedules. Daily schedule are formatted as recurEvery: [Frequency as integer]['Day(s)']. If no frequency is provided, the default frequency is 1. Daily schedule examples are recurEvery: Day, recurEvery: 3Days. Weekly schedule are formatted as recurEvery: [Frequency as integer]['Week(s)'] [Optional comma separated list of weekdays Monday-Sunday]. Weekly schedule examples are recurEvery: 3Weeks, recurEvery: Week Saturday,Sunday. Monthly schedules are formatted as [Frequency as integer]['Month(s)'] [Comma separated list of month days] or [Frequency as integer]['Month(s)'] [Week of Month (First, Second, Third, Fourth, Last)] [Weekday Monday-Sunday] [Optional Offset(No. of days)]. Offset value must be between -6 to 6 inclusive. Monthly schedule examples are recurEvery: Month, recurEvery: 2Months, recurEvery: Month day23,day24, recurEvery: Month Last Sunday, recurEvery: Month Fourth Monday, recurEvery: Month Last Sunday Offset-3, recurEvery: Month Third Sunday Offset6.
*
*/
public Output> recurEvery() {
return Codegen.optional(this.recurEvery);
}
/**
* Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone.
*
*/
@Export(name="startDateTime", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> startDateTime;
/**
* @return Effective start date of the maintenance window in YYYY-MM-DD hh:mm format. The start date can be set to either the current date or future date. The window will be created in the time zone provided and adjusted to daylight savings according to that time zone.
*
*/
public Output> startDateTime() {
return Codegen.optional(this.startDateTime);
}
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
@Export(name="systemData", refs={SystemDataResponse.class}, tree="[0]")
private Output systemData;
/**
* @return Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
*/
public Output systemData() {
return this.systemData;
}
/**
* Gets or sets tags of the resource
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Gets or sets tags of the resource
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.
*
*/
@Export(name="timeZone", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> timeZone;
/**
* @return Name of the timezone. List of timezones can be obtained by executing [System.TimeZoneInfo]::GetSystemTimeZones() in PowerShell. Example: Pacific Standard Time, UTC, W. Europe Standard Time, Korea Standard Time, Cen. Australia Standard Time.
*
*/
public Output> timeZone() {
return Codegen.optional(this.timeZone);
}
/**
* Type of the resource
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return Type of the resource
*
*/
public Output type() {
return this.type;
}
/**
* Gets or sets the visibility of the configuration. The default value is 'Custom'
*
*/
@Export(name="visibility", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> visibility;
/**
* @return Gets or sets the visibility of the configuration. The default value is 'Custom'
*
*/
public Output> visibility() {
return Codegen.optional(this.visibility);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public MaintenanceConfiguration(java.lang.String name) {
this(name, MaintenanceConfigurationArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public MaintenanceConfiguration(java.lang.String name, MaintenanceConfigurationArgs 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 MaintenanceConfiguration(java.lang.String name, MaintenanceConfigurationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:maintenance:MaintenanceConfiguration", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private MaintenanceConfiguration(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:maintenance:MaintenanceConfiguration", name, null, makeResourceOptions(options, id), false);
}
private static MaintenanceConfigurationArgs makeArgs(MaintenanceConfigurationArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? MaintenanceConfigurationArgs.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:maintenance/v20180601preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20200401:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20200701preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20210401preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20210501:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20210901preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20220701preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20221101preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20230401:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20230901preview:MaintenanceConfiguration").build()),
Output.of(Alias.builder().type("azure-native:maintenance/v20231001preview:MaintenanceConfiguration").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 MaintenanceConfiguration get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new MaintenanceConfiguration(name, id, options);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy