![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azurenative.avs.kotlin.PlacementPolicyArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-native-kotlin Show documentation
Show all versions of pulumi-azure-native-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azurenative.avs.kotlin
import com.pulumi.azurenative.avs.PlacementPolicyArgs.builder
import com.pulumi.azurenative.avs.kotlin.inputs.VmHostPlacementPolicyPropertiesArgs
import com.pulumi.azurenative.avs.kotlin.inputs.VmVmPlacementPolicyPropertiesArgs
import com.pulumi.core.Either
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* A vSphere Distributed Resource Scheduler (DRS) placement policy
* Azure REST API version: 2022-05-01. Prior API version in Azure Native 1.x: 2021-12-01.
* Other available API versions: 2023-03-01, 2023-09-01.
* ## Example Usage
* ### PlacementPolicies_CreateOrUpdate
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using AzureNative = Pulumi.AzureNative;
* return await Deployment.RunAsync(() =>
* {
* var placementPolicy = new AzureNative.AVS.PlacementPolicy("placementPolicy", new()
* {
* ClusterName = "cluster1",
* PlacementPolicyName = "policy1",
* PrivateCloudName = "cloud1",
* Properties = new AzureNative.AVS.Inputs.VmHostPlacementPolicyPropertiesArgs
* {
* AffinityStrength = AzureNative.AVS.AffinityStrength.Must,
* AffinityType = AzureNative.AVS.AffinityType.AntiAffinity,
* AzureHybridBenefitType = AzureNative.AVS.AzureHybridBenefitType.SqlHost,
* HostMembers = new[]
* {
* "fakehost22.nyc1.kubernetes.center",
* "fakehost23.nyc1.kubernetes.center",
* "fakehost24.nyc1.kubernetes.center",
* },
* Type = "VmHost",
* VmMembers = new[]
* {
* "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128",
* "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256",
* },
* },
* ResourceGroupName = "group1",
* });
* });
* ```
* ```go
* package main
* import (
* avs "github.com/pulumi/pulumi-azure-native-sdk/avs/v2"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* _, err := avs.NewPlacementPolicy(ctx, "placementPolicy", &avs.PlacementPolicyArgs{
* ClusterName: pulumi.String("cluster1"),
* PlacementPolicyName: pulumi.String("policy1"),
* PrivateCloudName: pulumi.String("cloud1"),
* Properties: &avs.VmHostPlacementPolicyPropertiesArgs{
* AffinityStrength: pulumi.String(avs.AffinityStrengthMust),
* AffinityType: pulumi.String(avs.AffinityTypeAntiAffinity),
* AzureHybridBenefitType: pulumi.String(avs.AzureHybridBenefitTypeSqlHost),
* HostMembers: pulumi.StringArray{
* pulumi.String("fakehost22.nyc1.kubernetes.center"),
* pulumi.String("fakehost23.nyc1.kubernetes.center"),
* pulumi.String("fakehost24.nyc1.kubernetes.center"),
* },
* Type: pulumi.String("VmHost"),
* VmMembers: pulumi.StringArray{
* pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128"),
* pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256"),
* },
* },
* ResourceGroupName: pulumi.String("group1"),
* })
* 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.azurenative.avs.PlacementPolicy;
* import com.pulumi.azurenative.avs.PlacementPolicyArgs;
* 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 placementPolicy = new PlacementPolicy("placementPolicy", PlacementPolicyArgs.builder()
* .clusterName("cluster1")
* .placementPolicyName("policy1")
* .privateCloudName("cloud1")
* .properties(VmHostPlacementPolicyPropertiesArgs.builder()
* .affinityStrength("Must")
* .affinityType("AntiAffinity")
* .azureHybridBenefitType("SqlHost")
* .hostMembers(
* "fakehost22.nyc1.kubernetes.center",
* "fakehost23.nyc1.kubernetes.center",
* "fakehost24.nyc1.kubernetes.center")
* .type("VmHost")
* .vmMembers(
* "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-128",
* "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/clusters/cluster1/virtualMachines/vm-256")
* .build())
* .resourceGroupName("group1")
* .build());
* }
* }
* ```
* ## Import
* An existing resource can be imported using its type token, name, and identifier, e.g.
* ```sh
* $ pulumi import azure-native:avs:PlacementPolicy policy1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/clusters/{clusterName}/placementPolicies/{placementPolicyName}
* ```
* @property clusterName Name of the cluster in the private cloud
* @property placementPolicyName Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy
* @property privateCloudName Name of the private cloud
* @property properties placement policy properties
* @property resourceGroupName The name of the resource group. The name is case insensitive.
*/
public data class PlacementPolicyArgs(
public val clusterName: Output? = null,
public val placementPolicyName: Output? = null,
public val privateCloudName: Output? = null,
public val properties: Output>? =
null,
public val resourceGroupName: Output? = null,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.azurenative.avs.PlacementPolicyArgs =
com.pulumi.azurenative.avs.PlacementPolicyArgs.builder()
.clusterName(clusterName?.applyValue({ args0 -> args0 }))
.placementPolicyName(placementPolicyName?.applyValue({ args0 -> args0 }))
.privateCloudName(privateCloudName?.applyValue({ args0 -> args0 }))
.properties(
properties?.applyValue({ args0 ->
args0.transform({ args0 ->
args0.let({ args0 ->
args0.toJava()
})
}, { args0 -> args0.let({ args0 -> args0.toJava() }) })
}),
)
.resourceGroupName(resourceGroupName?.applyValue({ args0 -> args0 })).build()
}
/**
* Builder for [PlacementPolicyArgs].
*/
@PulumiTagMarker
public class PlacementPolicyArgsBuilder internal constructor() {
private var clusterName: Output? = null
private var placementPolicyName: Output? = null
private var privateCloudName: Output? = null
private var properties:
Output>? = null
private var resourceGroupName: Output? = null
/**
* @param value Name of the cluster in the private cloud
*/
@JvmName("sunqovwjjwukaufa")
public suspend fun clusterName(`value`: Output) {
this.clusterName = value
}
/**
* @param value Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy
*/
@JvmName("ndryoiuvdcfkxujd")
public suspend fun placementPolicyName(`value`: Output) {
this.placementPolicyName = value
}
/**
* @param value Name of the private cloud
*/
@JvmName("wjmktxdnlcojgqhb")
public suspend fun privateCloudName(`value`: Output) {
this.privateCloudName = value
}
/**
* @param value placement policy properties
*/
@JvmName("pqxeafbhuikdbmkr")
public suspend fun properties(`value`: Output>) {
this.properties = value
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("hwyuxgysldwqjhbu")
public suspend fun resourceGroupName(`value`: Output) {
this.resourceGroupName = value
}
/**
* @param value Name of the cluster in the private cloud
*/
@JvmName("gxddsjsjxxysamvr")
public suspend fun clusterName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.clusterName = mapped
}
/**
* @param value Name of the VMware vSphere Distributed Resource Scheduler (DRS) placement policy
*/
@JvmName("ddfllpxhjpqeoeas")
public suspend fun placementPolicyName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.placementPolicyName = mapped
}
/**
* @param value Name of the private cloud
*/
@JvmName("hxqkssuaklalnhmw")
public suspend fun privateCloudName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.privateCloudName = mapped
}
/**
* @param value placement policy properties
*/
@JvmName("votkbyvovojiqyfx")
public suspend fun properties(`value`: Either?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.properties = mapped
}
/**
* @param value placement policy properties
*/
@JvmName("mcgbbygosujgayrq")
public fun properties(`value`: VmHostPlacementPolicyPropertiesArgs) {
val toBeMapped = Either.ofLeft<
VmHostPlacementPolicyPropertiesArgs,
VmVmPlacementPolicyPropertiesArgs,
>(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.properties = mapped
}
/**
* @param value placement policy properties
*/
@JvmName("wbcvfwmiwtnuwwld")
public fun properties(`value`: VmVmPlacementPolicyPropertiesArgs) {
val toBeMapped = Either.ofRight<
VmHostPlacementPolicyPropertiesArgs,
VmVmPlacementPolicyPropertiesArgs,
>(value)
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.properties = mapped
}
/**
* @param value The name of the resource group. The name is case insensitive.
*/
@JvmName("puhxhufvflkqtqgx")
public suspend fun resourceGroupName(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.resourceGroupName = mapped
}
internal fun build(): PlacementPolicyArgs = PlacementPolicyArgs(
clusterName = clusterName,
placementPolicyName = placementPolicyName,
privateCloudName = privateCloudName,
properties = properties,
resourceGroupName = resourceGroupName,
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy