
com.pulumi.azure.compute.kotlin.OrchestratedVirtualMachineScaleSet.kt Maven / Gradle / Ivy
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.compute.kotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetAdditionalCapabilities
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetAutomaticInstanceRepair
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetBootDiagnostics
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetDataDisk
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetExtension
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetIdentity
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetNetworkInterface
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetOsDisk
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetOsProfile
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetPlan
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetPriorityMix
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetSourceImageReference
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetTerminationNotification
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Double
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetAdditionalCapabilities.Companion.toKotlin as orchestratedVirtualMachineScaleSetAdditionalCapabilitiesToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetAutomaticInstanceRepair.Companion.toKotlin as orchestratedVirtualMachineScaleSetAutomaticInstanceRepairToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetBootDiagnostics.Companion.toKotlin as orchestratedVirtualMachineScaleSetBootDiagnosticsToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetDataDisk.Companion.toKotlin as orchestratedVirtualMachineScaleSetDataDiskToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetExtension.Companion.toKotlin as orchestratedVirtualMachineScaleSetExtensionToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetIdentity.Companion.toKotlin as orchestratedVirtualMachineScaleSetIdentityToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetNetworkInterface.Companion.toKotlin as orchestratedVirtualMachineScaleSetNetworkInterfaceToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetOsDisk.Companion.toKotlin as orchestratedVirtualMachineScaleSetOsDiskToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetOsProfile.Companion.toKotlin as orchestratedVirtualMachineScaleSetOsProfileToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetPlan.Companion.toKotlin as orchestratedVirtualMachineScaleSetPlanToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetPriorityMix.Companion.toKotlin as orchestratedVirtualMachineScaleSetPriorityMixToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetSourceImageReference.Companion.toKotlin as orchestratedVirtualMachineScaleSetSourceImageReferenceToKotlin
import com.pulumi.azure.compute.kotlin.outputs.OrchestratedVirtualMachineScaleSetTerminationNotification.Companion.toKotlin as orchestratedVirtualMachineScaleSetTerminationNotificationToKotlin
/**
* Builder for [OrchestratedVirtualMachineScaleSet].
*/
@PulumiTagMarker
public class OrchestratedVirtualMachineScaleSetResourceBuilder internal constructor() {
public var name: String? = null
public var args: OrchestratedVirtualMachineScaleSetArgs = OrchestratedVirtualMachineScaleSetArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend OrchestratedVirtualMachineScaleSetArgsBuilder.() -> Unit) {
val builder = OrchestratedVirtualMachineScaleSetArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): OrchestratedVirtualMachineScaleSet {
val builtJavaResource =
com.pulumi.azure.compute.OrchestratedVirtualMachineScaleSet(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return OrchestratedVirtualMachineScaleSet(builtJavaResource)
}
}
/**
* Manages an Virtual Machine Scale Set in Flexible Orchestration Mode.
* ## Disclaimers
* > **Note:** As of the **v2.86.0** (November 19, 2021) release of the provider this resource will only create Virtual Machine Scale Sets with the **Flexible** Orchestration Mode.
* > **Note:** All arguments including the administrator login and password will be stored in the raw state as plain-text. [Read more about sensitive data in state](https://www.terraform.io/docs/state/sensitive-data.html).
* ## 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 exampleOrchestratedVirtualMachineScaleSet = new azure.compute.OrchestratedVirtualMachineScaleSet("example", {
* name: "example-VMSS",
* location: example.location,
* resourceGroupName: example.name,
* platformFaultDomainCount: 1,
* zones: ["1"],
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.core.ResourceGroup("example",
* name="example-resources",
* location="West Europe")
* example_orchestrated_virtual_machine_scale_set = azure.compute.OrchestratedVirtualMachineScaleSet("example",
* name="example-VMSS",
* location=example.location,
* resource_group_name=example.name,
* platform_fault_domain_count=1,
* zones=["1"])
* ```
* ```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 exampleOrchestratedVirtualMachineScaleSet = new Azure.Compute.OrchestratedVirtualMachineScaleSet("example", new()
* {
* Name = "example-VMSS",
* Location = example.Location,
* ResourceGroupName = example.Name,
* PlatformFaultDomainCount = 1,
* Zones = new[]
* {
* "1",
* },
* });
* });
* ```
* ```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.NewOrchestratedVirtualMachineScaleSet(ctx, "example", &compute.OrchestratedVirtualMachineScaleSetArgs{
* Name: pulumi.String("example-VMSS"),
* Location: example.Location,
* ResourceGroupName: example.Name,
* PlatformFaultDomainCount: pulumi.Int(1),
* Zones: pulumi.StringArray{
* pulumi.String("1"),
* },
* })
* 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.OrchestratedVirtualMachineScaleSet;
* import com.pulumi.azure.compute.OrchestratedVirtualMachineScaleSetArgs;
* 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 exampleOrchestratedVirtualMachineScaleSet = new OrchestratedVirtualMachineScaleSet("exampleOrchestratedVirtualMachineScaleSet", OrchestratedVirtualMachineScaleSetArgs.builder()
* .name("example-VMSS")
* .location(example.location())
* .resourceGroupName(example.name())
* .platformFaultDomainCount(1)
* .zones("1")
* .build());
* }
* }
* ```
* ```yaml
* resources:
* example:
* type: azure:core:ResourceGroup
* properties:
* name: example-resources
* location: West Europe
* exampleOrchestratedVirtualMachineScaleSet:
* type: azure:compute:OrchestratedVirtualMachineScaleSet
* name: example
* properties:
* name: example-VMSS
* location: ${example.location}
* resourceGroupName: ${example.name}
* platformFaultDomainCount: 1
* zones:
* - '1'
* ```
*
* ## Import
* An Virtual Machine Scale Set can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:compute/orchestratedVirtualMachineScaleSet:OrchestratedVirtualMachineScaleSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachineScaleSets/scaleset1
* ```
*/
public class OrchestratedVirtualMachineScaleSet internal constructor(
override val javaResource: com.pulumi.azure.compute.OrchestratedVirtualMachineScaleSet,
) : KotlinCustomResource(javaResource, OrchestratedVirtualMachineScaleSetMapper) {
/**
* An `additional_capabilities` block as defined below.
*/
public val additionalCapabilities:
Output?
get() = javaResource.additionalCapabilities().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetAdditionalCapabilitiesToKotlin(args0)
})
}).orElse(null)
})
/**
* An `automatic_instance_repair` block as defined below.
* > **Note:** To enable the `automatic_instance_repair`, the Orchestrated Virtual Machine Scale Set must have a valid [Application Health Extension](https://docs.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-health-extension).
*/
public val automaticInstanceRepair:
Output
get() = javaResource.automaticInstanceRepair().applyValue({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetAutomaticInstanceRepairToKotlin(args0)
})
})
/**
* A `boot_diagnostics` block as defined below.
*/
public val bootDiagnostics: Output?
get() = javaResource.bootDiagnostics().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetBootDiagnosticsToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies the ID of the Capacity Reservation Group which the Virtual Machine Scale Set should be allocated to. Changing this forces a new resource to be created.
* > **Note:** `capacity_reservation_group_id` cannot be specified with `proximity_placement_group_id`
* > **Note:** If `capacity_reservation_group_id` is specified the `single_placement_group` must be set to `false`.
*/
public val capacityReservationGroupId: Output?
get() = javaResource.capacityReservationGroupId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* One or more `data_disk` blocks as defined below.
*/
public val dataDisks: Output>?
get() = javaResource.dataDisks().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetDataDiskToKotlin(args0)
})
})
}).orElse(null)
})
/**
* Should disks attached to this Virtual Machine Scale Set be encrypted by enabling Encryption at Host?
*/
public val encryptionAtHostEnabled: Output?
get() = javaResource.encryptionAtHostEnabled().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Policy which should be used by Spot Virtual Machines that are Evicted from the Scale Set. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created.
*/
public val evictionPolicy: Output?
get() = javaResource.evictionPolicy().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* Should extension operations be allowed on the Virtual Machine Scale Set? Possible values are `true` or `false`. Defaults to `true`. Changing this forces a new Virtual Machine Scale Set to be created.
* > **Note:** `extension_operations_enabled` may only be set to `false` if there are no extensions defined in the `extension` field.
*/
public val extensionOperationsEnabled: Output
get() = javaResource.extensionOperationsEnabled().applyValue({ args0 -> args0 })
/**
* One or more `extension` blocks as defined below
*/
public val extensions: Output>
get() = javaResource.extensions().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetExtensionToKotlin(args0)
})
})
})
/**
* Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. Defaults to `PT1H30M`.
*/
public val extensionsTimeBudget: Output?
get() = javaResource.extensionsTimeBudget().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* An `identity` block as defined below.
*/
public val identity: Output?
get() = javaResource.identity().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetIdentityToKotlin(args0)
})
}).orElse(null)
})
/**
* The number of Virtual Machines in the Virtual Machine Scale Set.
*/
public val instances: Output
get() = javaResource.instances().applyValue({ args0 -> args0 })
/**
* Specifies the type of on-premise license (also known as Azure Hybrid Use Benefit) which should be used for this Virtual Machine Scale Set. Possible values are `None`, `Windows_Client` and `Windows_Server`.
*/
public val licenseType: Output?
get() = javaResource.licenseType().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The Azure location where the Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.
*/
public val location: Output
get() = javaResource.location().applyValue({ args0 -> args0 })
/**
* The maximum price you're willing to pay for each Virtual Machine in this Scale Set, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machines in the Scale Set will be evicted using the eviction_policy. Defaults to `-1`, which means that each Virtual Machine in the Scale Set should not be evicted for price reasons.
*/
public val maxBidPrice: Output?
get() = javaResource.maxBidPrice().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Virtual Machine Scale Set. Changing this forces a new resource to be created.
*/
public val name: Output
get() = javaResource.name().applyValue({ args0 -> args0 })
/**
* One or more `network_interface` blocks as defined below.
*/
public val networkInterfaces: Output>?
get() = javaResource.networkInterfaces().applyValue({ args0 ->
args0.map({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetNetworkInterfaceToKotlin(args0)
})
})
}).orElse(null)
})
/**
* An `os_disk` block as defined below.
*/
public val osDisk: Output?
get() = javaResource.osDisk().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetOsDiskToKotlin(args0)
})
}).orElse(null)
})
/**
* An `os_profile` block as defined below.
*/
public val osProfile: Output?
get() = javaResource.osProfile().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetOsProfileToKotlin(args0)
})
}).orElse(null)
})
/**
* A `plan` block as documented below. Changing this forces a new resource to be created.
*/
public val plan: Output?
get() = javaResource.plan().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetPlanToKotlin(args0)
})
}).orElse(null)
})
/**
* Specifies the number of fault domains that are used by this Virtual Machine Scale Set. 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).
*/
public val platformFaultDomainCount: Output
get() = javaResource.platformFaultDomainCount().applyValue({ args0 -> args0 })
/**
* The Priority of this Virtual Machine Scale Set. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this value forces a new resource.
*/
public val priority: Output?
get() = javaResource.priority().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* a `priority_mix` block as defined below
*/
public val priorityMix: Output?
get() = javaResource.priorityMix().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetPriorityMixToKotlin(args0)
})
}).orElse(null)
})
/**
* The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. Changing this forces a new resource to be created.
*/
public val proximityPlacementGroupId: Output?
get() = javaResource.proximityPlacementGroupId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* The name of the Resource Group in which the Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
/**
* Should this Virtual Machine Scale Set be limited to a Single Placement Group, which means the number of instances will be capped at 100 Virtual Machines. Possible values are `true` or `false`.
* > **Note:** `single_placement_group` behaves differently for Flexible orchestration Virtual Machine Scale Sets than it does for Uniform orchestration Virtual Machine Scale Sets. It is recommended that you do not define the `single_placement_group` field in your configuration file as the service will determine what this value should be based off of the value contained within the `sku_name` field of your configuration file. You may set the `single_placement_group` field to `true`, however once you set it to `false` you will not be able to revert it back to `true`.
*/
public val singlePlacementGroup: Output
get() = javaResource.singlePlacementGroup().applyValue({ args0 -> args0 })
/**
* The `name` of the SKU to be used by this Virtual Machine Scale Set. Valid values include: any of the [General purpose](https://docs.microsoft.com/azure/virtual-machines/sizes-general), [Compute optimized](https://docs.microsoft.com/azure/virtual-machines/sizes-compute), [Memory optimized](https://docs.microsoft.com/azure/virtual-machines/sizes-memory), [Storage optimized](https://docs.microsoft.com/azure/virtual-machines/sizes-storage), [GPU optimized](https://docs.microsoft.com/azure/virtual-machines/sizes-gpu), [FPGA optimized](https://docs.microsoft.com/azure/virtual-machines/sizes-field-programmable-gate-arrays), [High performance](https://docs.microsoft.com/azure/virtual-machines/sizes-hpc), or [Previous generation](https://docs.microsoft.com/azure/virtual-machines/sizes-previous-gen) virtual machine SKUs.
*/
public val skuName: Output?
get() = javaResource.skuName().applyValue({ args0 -> args0.map({ args0 -> args0 }).orElse(null) })
/**
* The ID of an Image which each Virtual Machine in this Scale Set should be based on. Possible Image ID types include `Image ID`s, `Shared Image ID`s, `Shared Image Version ID`s, `Community Gallery Image ID`s, `Community Gallery Image Version ID`s, `Shared Gallery Image ID`s and `Shared Gallery Image Version ID`s.
*/
public val sourceImageId: Output?
get() = javaResource.sourceImageId().applyValue({ args0 ->
args0.map({ args0 ->
args0
}).orElse(null)
})
/**
* A `source_image_reference` block as defined below.
*/
public val sourceImageReference: Output?
get() = javaResource.sourceImageReference().applyValue({ args0 ->
args0.map({ args0 ->
args0.let({ args0 ->
orchestratedVirtualMachineScaleSetSourceImageReferenceToKotlin(args0)
})
}).orElse(null)
})
/**
* A mapping of tags which should be assigned to this Virtual Machine Scale Set.
*/
public val tags: Output
© 2015 - 2025 Weber Informatics LLC | Privacy Policy