![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.awsnative.ecs.kotlin.inputs.ServicePlacementConstraintArgs.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-aws-native-kotlin Show documentation
Show all versions of pulumi-aws-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.awsnative.ecs.kotlin.inputs
import com.pulumi.awsnative.ecs.inputs.ServicePlacementConstraintArgs.builder
import com.pulumi.awsnative.ecs.kotlin.enums.ServicePlacementConstraintType
import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiNullFieldException
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.String
import kotlin.Suppress
import kotlin.jvm.JvmName
/**
* The ``PlacementConstraint`` property specifies an object representing a constraint on task placement in the task definition. For more information, see [Task Placement Constraints](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) in the *Amazon Elastic Container Service Developer Guide*.
* @property expression A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is ``distinctInstance``. For more information, see [Cluster query language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide*.
* @property type The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular group is running on a different container instance. Use ``memberOf`` to restrict the selection to a group of valid candidates.
*/
public data class ServicePlacementConstraintArgs(
public val expression: Output? = null,
public val type: Output,
) : ConvertibleToJava {
override fun toJava(): com.pulumi.awsnative.ecs.inputs.ServicePlacementConstraintArgs =
com.pulumi.awsnative.ecs.inputs.ServicePlacementConstraintArgs.builder()
.expression(expression?.applyValue({ args0 -> args0 }))
.type(type.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) })).build()
}
/**
* Builder for [ServicePlacementConstraintArgs].
*/
@PulumiTagMarker
public class ServicePlacementConstraintArgsBuilder internal constructor() {
private var expression: Output? = null
private var type: Output? = null
/**
* @param value A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is ``distinctInstance``. For more information, see [Cluster query language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide*.
*/
@JvmName("pybcjkxrwugyhesc")
public suspend fun expression(`value`: Output) {
this.expression = value
}
/**
* @param value The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular group is running on a different container instance. Use ``memberOf`` to restrict the selection to a group of valid candidates.
*/
@JvmName("hmsqnusacksrlbee")
public suspend fun type(`value`: Output) {
this.type = value
}
/**
* @param value A cluster query language expression to apply to the constraint. The expression can have a maximum length of 2000 characters. You can't specify an expression if the constraint type is ``distinctInstance``. For more information, see [Cluster query language](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html) in the *Amazon Elastic Container Service Developer Guide*.
*/
@JvmName("tqmbylvrrijgsqft")
public suspend fun expression(`value`: String?) {
val toBeMapped = value
val mapped = toBeMapped?.let({ args0 -> of(args0) })
this.expression = mapped
}
/**
* @param value The type of constraint. Use ``distinctInstance`` to ensure that each task in a particular group is running on a different container instance. Use ``memberOf`` to restrict the selection to a group of valid candidates.
*/
@JvmName("kdeudjffmcoxxbud")
public suspend fun type(`value`: ServicePlacementConstraintType) {
val toBeMapped = value
val mapped = toBeMapped.let({ args0 -> of(args0) })
this.type = mapped
}
internal fun build(): ServicePlacementConstraintArgs = ServicePlacementConstraintArgs(
expression = expression,
type = type ?: throw PulumiNullFieldException("type"),
)
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy