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

com.pulumi.azure.compute.kotlin.AvailabilitySetArgs.kt Maven / Gradle / Ivy

@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.azure.compute.kotlin

import com.pulumi.azure.compute.AvailabilitySetArgs.builder
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Boolean
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Manages an Availability Set for Virtual Machines.
 * ## Example Usage
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as azure from "@pulumi/azure";
 * const example = new azure.core.ResourceGroup("example", {
 *     name: "example-resources",
 *     location: "West Europe",
 * });
 * const exampleAvailabilitySet = new azure.compute.AvailabilitySet("example", {
 *     name: "example-aset",
 *     location: example.location,
 *     resourceGroupName: example.name,
 *     tags: {
 *         environment: "Production",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_azure as azure
 * example = azure.core.ResourceGroup("example",
 *     name="example-resources",
 *     location="West Europe")
 * example_availability_set = azure.compute.AvailabilitySet("example",
 *     name="example-aset",
 *     location=example.location,
 *     resource_group_name=example.name,
 *     tags={
 *         "environment": "Production",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Azure = Pulumi.Azure;
 * return await Deployment.RunAsync(() =>
 * {
 *     var example = new Azure.Core.ResourceGroup("example", new()
 *     {
 *         Name = "example-resources",
 *         Location = "West Europe",
 *     });
 *     var exampleAvailabilitySet = new Azure.Compute.AvailabilitySet("example", new()
 *     {
 *         Name = "example-aset",
 *         Location = example.Location,
 *         ResourceGroupName = example.Name,
 *         Tags =
 *         {
 *             { "environment", "Production" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/compute"
 * 	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
 * 			Name:     pulumi.String("example-resources"),
 * 			Location: pulumi.String("West Europe"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewAvailabilitySet(ctx, "example", &compute.AvailabilitySetArgs{
 * 			Name:              pulumi.String("example-aset"),
 * 			Location:          example.Location,
 * 			ResourceGroupName: example.Name,
 * 			Tags: pulumi.StringMap{
 * 				"environment": pulumi.String("Production"),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.azure.core.ResourceGroup;
 * import com.pulumi.azure.core.ResourceGroupArgs;
 * import com.pulumi.azure.compute.AvailabilitySet;
 * import com.pulumi.azure.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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
 *             .name("example-resources")
 *             .location("West Europe")
 *             .build());
 *         var exampleAvailabilitySet = new AvailabilitySet("exampleAvailabilitySet", AvailabilitySetArgs.builder()
 *             .name("example-aset")
 *             .location(example.location())
 *             .resourceGroupName(example.name())
 *             .tags(Map.of("environment", "Production"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   example:
 *     type: azure:core:ResourceGroup
 *     properties:
 *       name: example-resources
 *       location: West Europe
 *   exampleAvailabilitySet:
 *     type: azure:compute:AvailabilitySet
 *     name: example
 *     properties:
 *       name: example-aset
 *       location: ${example.location}
 *       resourceGroupName: ${example.name}
 *       tags:
 *         environment: Production
 * ```
 * 
 * ## Import
 * Availability Sets can be imported using the `resource id`, e.g.
 * ```sh
 * $ pulumi import azure:compute/availabilitySet:AvailabilitySet group1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/availabilitySets/webAvailSet
 * ```
 * @property location Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
 * @property managed Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `true`. Changing this forces a new resource to be created.
 * @property name Specifies the name of the availability set. Changing this forces a new resource to be created.
 * @property platformFaultDomainCount Specifies the number of fault domains that are used. Defaults to `3`. Changing this forces a new resource to be created.
 * > **NOTE:** The number of Fault Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
 * @property platformUpdateDomainCount Specifies the number of update domains that are used. Defaults to `5`. Changing this forces a new resource to be created.
 * > **NOTE:** The number of Update Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
 * @property proximityPlacementGroupId The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created.
 * @property resourceGroupName The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
 * @property tags A mapping of tags to assign to the resource.
 */
public data class AvailabilitySetArgs(
    public val location: Output? = null,
    public val managed: Output? = null,
    public val name: Output? = null,
    public val platformFaultDomainCount: Output? = null,
    public val platformUpdateDomainCount: Output? = null,
    public val proximityPlacementGroupId: Output? = null,
    public val resourceGroupName: Output? = null,
    public val tags: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.azure.compute.AvailabilitySetArgs =
        com.pulumi.azure.compute.AvailabilitySetArgs.builder()
            .location(location?.applyValue({ args0 -> args0 }))
            .managed(managed?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .platformFaultDomainCount(platformFaultDomainCount?.applyValue({ args0 -> args0 }))
            .platformUpdateDomainCount(platformUpdateDomainCount?.applyValue({ args0 -> args0 }))
            .proximityPlacementGroupId(proximityPlacementGroupId?.applyValue({ args0 -> args0 }))
            .resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 }))
            .tags(
                tags?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.key.to(args0.value)
                    }).toMap()
                }),
            ).build()
}

/**
 * Builder for [AvailabilitySetArgs].
 */
@PulumiTagMarker
public class AvailabilitySetArgsBuilder internal constructor() {
    private var location: Output? = null

    private var managed: Output? = null

    private var name: Output? = null

    private var platformFaultDomainCount: Output? = null

    private var platformUpdateDomainCount: Output? = null

    private var proximityPlacementGroupId: Output? = null

    private var resourceGroupName: Output? = null

    private var tags: Output>? = null

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("ehdqjdxnffujwwqo")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `true`. Changing this forces a new resource to be created.
     */
    @JvmName("cwfpwxqjhfacntnl")
    public suspend fun managed(`value`: Output) {
        this.managed = value
    }

    /**
     * @param value Specifies the name of the availability set. Changing this forces a new resource to be created.
     */
    @JvmName("vmwvtxovrngoheqa")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Specifies the number of fault domains that are used. Defaults to `3`. Changing this forces a new resource to be created.
     * > **NOTE:** The number of Fault Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
     */
    @JvmName("loawiyerdkpohosk")
    public suspend fun platformFaultDomainCount(`value`: Output) {
        this.platformFaultDomainCount = value
    }

    /**
     * @param value Specifies the number of update domains that are used. Defaults to `5`. Changing this forces a new resource to be created.
     * > **NOTE:** The number of Update Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
     */
    @JvmName("fhxuaforbixgttkh")
    public suspend fun platformUpdateDomainCount(`value`: Output) {
        this.platformUpdateDomainCount = value
    }

    /**
     * @param value The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created.
     */
    @JvmName("vrxldmkmdmdqbpgq")
    public suspend fun proximityPlacementGroupId(`value`: Output) {
        this.proximityPlacementGroupId = value
    }

    /**
     * @param value The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
     */
    @JvmName("npysaytjhgrdfykn")
    public suspend fun resourceGroupName(`value`: Output) {
        this.resourceGroupName = value
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("udnqqdkudkfqsmda")
    public suspend fun tags(`value`: Output>) {
        this.tags = value
    }

    /**
     * @param value Specifies the supported Azure location where the resource exists. Changing this forces a new resource to be created.
     */
    @JvmName("pnjyvahalnjtplpm")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Specifies whether the availability set is managed or not. Possible values are `true` (to specify aligned) or `false` (to specify classic). Default is `true`. Changing this forces a new resource to be created.
     */
    @JvmName("exfyuqmhsvjfxetw")
    public suspend fun managed(`value`: Boolean?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.managed = mapped
    }

    /**
     * @param value Specifies the name of the availability set. Changing this forces a new resource to be created.
     */
    @JvmName("fwnlhngbxjycplea")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Specifies the number of fault domains that are used. Defaults to `3`. Changing this forces a new resource to be created.
     * > **NOTE:** The number of Fault Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
     */
    @JvmName("botlhbsyvdrhmhma")
    public suspend fun platformFaultDomainCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.platformFaultDomainCount = mapped
    }

    /**
     * @param value Specifies the number of update domains that are used. Defaults to `5`. Changing this forces a new resource to be created.
     * > **NOTE:** The number of Update Domains varies depending on which Azure Region you're using. More information about update and fault domains and how they work can be found [here](https://learn.microsoft.com/en-us/azure/virtual-machines/availability-set-overview).
     */
    @JvmName("gcafxqbxoqbmaepx")
    public suspend fun platformUpdateDomainCount(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.platformUpdateDomainCount = mapped
    }

    /**
     * @param value The ID of the Proximity Placement Group to which this Virtual Machine should be assigned. Changing this forces a new resource to be created.
     */
    @JvmName("uwdtsaaysinvyfyh")
    public suspend fun proximityPlacementGroupId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.proximityPlacementGroupId = mapped
    }

    /**
     * @param value The name of the resource group in which to create the availability set. Changing this forces a new resource to be created.
     */
    @JvmName("ticeyokbaobtgvdu")
    public suspend fun resourceGroupName(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.resourceGroupName = mapped
    }

    /**
     * @param value A mapping of tags to assign to the resource.
     */
    @JvmName("wdytcwpexpktwips")
    public suspend fun tags(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    /**
     * @param values A mapping of tags to assign to the resource.
     */
    @JvmName("hukialheqgsaragn")
    public fun tags(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.tags = mapped
    }

    internal fun build(): AvailabilitySetArgs = AvailabilitySetArgs(
        location = location,
        managed = managed,
        name = name,
        platformFaultDomainCount = platformFaultDomainCount,
        platformUpdateDomainCount = platformUpdateDomainCount,
        proximityPlacementGroupId = proximityPlacementGroupId,
        resourceGroupName = resourceGroupName,
        tags = tags,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy