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

com.pulumi.azurenative.compute.AvailabilitySet 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.compute;

import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.compute.AvailabilitySetArgs;
import com.pulumi.azurenative.compute.outputs.InstanceViewStatusResponse;
import com.pulumi.azurenative.compute.outputs.SkuResponse;
import com.pulumi.azurenative.compute.outputs.SubResourceResponse;
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.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;

/**
 * Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability set.
 * Azure REST API version: 2023-03-01. Prior API version in Azure Native 1.x: 2020-12-01.
 * 
 * Other available API versions: 2016-04-30-preview, 2023-07-01, 2023-09-01, 2024-03-01, 2024-07-01.
 * 
 * ## Example Usage
 * ### Create an availability set.
 * 
 * 
 * {@code
 * package generated_program;
 * 
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azurenative.compute.AvailabilitySet;
 * import com.pulumi.azurenative.compute.AvailabilitySetArgs;
 * 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 availabilitySet = new AvailabilitySet("availabilitySet", AvailabilitySetArgs.builder()
 *             .availabilitySetName("myAvailabilitySet")
 *             .location("westus")
 *             .platformFaultDomainCount(2)
 *             .platformUpdateDomainCount(20)
 *             .resourceGroupName("myResourceGroup")
 *             .build());
 * 
 *     }
 * }
 * 
 * }
 * 
* * ## Import * * An existing resource can be imported using its type token, name, and identifier, e.g. * * ```sh * $ pulumi import azure-native:compute:AvailabilitySet myAvailabilitySet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} * ``` * */ @ResourceType(type="azure-native:compute:AvailabilitySet") public class AvailabilitySet extends com.pulumi.resources.CustomResource { /** * Resource location * */ @Export(name="location", refs={String.class}, tree="[0]") private Output location; /** * @return Resource location * */ public Output location() { return this.location; } /** * Resource name * */ @Export(name="name", refs={String.class}, tree="[0]") private Output name; /** * @return Resource name * */ public Output name() { return this.name; } /** * Fault Domain count. * */ @Export(name="platformFaultDomainCount", refs={Integer.class}, tree="[0]") private Output platformFaultDomainCount; /** * @return Fault Domain count. * */ public Output> platformFaultDomainCount() { return Codegen.optional(this.platformFaultDomainCount); } /** * Update Domain count. * */ @Export(name="platformUpdateDomainCount", refs={Integer.class}, tree="[0]") private Output platformUpdateDomainCount; /** * @return Update Domain count. * */ public Output> platformUpdateDomainCount() { return Codegen.optional(this.platformUpdateDomainCount); } /** * Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. * */ @Export(name="proximityPlacementGroup", refs={SubResourceResponse.class}, tree="[0]") private Output proximityPlacementGroup; /** * @return Specifies information about the proximity placement group that the availability set should be assigned to. Minimum api-version: 2018-04-01. * */ public Output> proximityPlacementGroup() { return Codegen.optional(this.proximityPlacementGroup); } /** * Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. * */ @Export(name="sku", refs={SkuResponse.class}, tree="[0]") private Output sku; /** * @return Sku of the availability set, only name is required to be set. See AvailabilitySetSkuTypes for possible set of values. Use 'Aligned' for virtual machines with managed disks and 'Classic' for virtual machines with unmanaged disks. Default value is 'Classic'. * */ public Output> sku() { return Codegen.optional(this.sku); } /** * The resource status information. * */ @Export(name="statuses", refs={List.class,InstanceViewStatusResponse.class}, tree="[0,1]") private Output> statuses; /** * @return The resource status information. * */ public Output> statuses() { return this.statuses; } /** * 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 * */ @Export(name="type", refs={String.class}, tree="[0]") private Output type; /** * @return Resource type * */ public Output type() { return this.type; } /** * A list of references to all virtual machines in the availability set. * */ @Export(name="virtualMachines", refs={List.class,SubResourceResponse.class}, tree="[0,1]") private Output> virtualMachines; /** * @return A list of references to all virtual machines in the availability set. * */ public Output>> virtualMachines() { return Codegen.optional(this.virtualMachines); } /** * * @param name The _unique_ name of the resulting resource. */ public AvailabilitySet(java.lang.String name) { this(name, AvailabilitySetArgs.Empty); } /** * * @param name The _unique_ name of the resulting resource. * @param args The arguments to use to populate this resource's properties. */ public AvailabilitySet(java.lang.String name, AvailabilitySetArgs 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 AvailabilitySet(java.lang.String name, AvailabilitySetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:AvailabilitySet", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false); } private AvailabilitySet(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { super("azure-native:compute:AvailabilitySet", name, null, makeResourceOptions(options, id), false); } private static AvailabilitySetArgs makeArgs(AvailabilitySetArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) { if (options != null && options.getUrn().isPresent()) { return null; } return args == null ? AvailabilitySetArgs.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:compute/v20150615:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20160330:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20160430preview:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20170330:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20171201:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20180401:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20180601:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20181001:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20190301:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20190701:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20191201:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20200601:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20201201:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20210301:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20210401:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20210701:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20211101:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20220301:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20220801:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20221101:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20230301:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20230701:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20230901:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20240301:AvailabilitySet").build()), Output.of(Alias.builder().type("azure-native:compute/v20240701:AvailabilitySet").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 AvailabilitySet get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) { return new AvailabilitySet(name, id, options); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy