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

com.pulumi.googlenative.compute.alpha.kotlin.TargetPoolArgs.kt Maven / Gradle / Ivy

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

package com.pulumi.googlenative.compute.alpha.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.compute.alpha.TargetPoolArgs.builder
import com.pulumi.googlenative.compute.alpha.kotlin.enums.TargetPoolSessionAffinity
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import kotlin.Double
import kotlin.String
import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmName

/**
 * Creates a target pool in the specified project and region using the data included in the request.
 * @property backupPool The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
 * @property description An optional description of this resource. Provide this property when you create the resource.
 * @property failoverRatio This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
 * @property healthChecks The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified.
 * @property instances A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
 * @property name Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
 * @property project
 * @property region
 * @property requestId An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
 * @property sessionAffinity Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.
 */
public data class TargetPoolArgs(
    public val backupPool: Output? = null,
    public val description: Output? = null,
    public val failoverRatio: Output? = null,
    public val healthChecks: Output>? = null,
    public val instances: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val region: Output? = null,
    public val requestId: Output? = null,
    public val sessionAffinity: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.compute.alpha.TargetPoolArgs =
        com.pulumi.googlenative.compute.alpha.TargetPoolArgs.builder()
            .backupPool(backupPool?.applyValue({ args0 -> args0 }))
            .description(description?.applyValue({ args0 -> args0 }))
            .failoverRatio(failoverRatio?.applyValue({ args0 -> args0 }))
            .healthChecks(healthChecks?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .instances(instances?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .region(region?.applyValue({ args0 -> args0 }))
            .requestId(requestId?.applyValue({ args0 -> args0 }))
            .sessionAffinity(
                sessionAffinity?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

/**
 * Builder for [TargetPoolArgs].
 */
@PulumiTagMarker
public class TargetPoolArgsBuilder internal constructor() {
    private var backupPool: Output? = null

    private var description: Output? = null

    private var failoverRatio: Output? = null

    private var healthChecks: Output>? = null

    private var instances: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var region: Output? = null

    private var requestId: Output? = null

    private var sessionAffinity: Output? = null

    /**
     * @param value The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
     */
    @JvmName("eobtkfbfykroqlsf")
    public suspend fun backupPool(`value`: Output) {
        this.backupPool = value
    }

    /**
     * @param value An optional description of this resource. Provide this property when you create the resource.
     */
    @JvmName("phftqpcvulvsxibc")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
     */
    @JvmName("womjwsylhhlvubee")
    public suspend fun failoverRatio(`value`: Output) {
        this.failoverRatio = value
    }

    /**
     * @param value The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified.
     */
    @JvmName("oeeutubhkfsudama")
    public suspend fun healthChecks(`value`: Output>) {
        this.healthChecks = value
    }

    @JvmName("ksasrxdidwqxcjhr")
    public suspend fun healthChecks(vararg values: Output) {
        this.healthChecks = Output.all(values.asList())
    }

    /**
     * @param values The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified.
     */
    @JvmName("cwqtjaniaesujlqg")
    public suspend fun healthChecks(values: List>) {
        this.healthChecks = Output.all(values)
    }

    /**
     * @param value A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
     */
    @JvmName("hhjnpkntswsxphwn")
    public suspend fun instances(`value`: Output>) {
        this.instances = value
    }

    @JvmName("hrcivkguytetanwc")
    public suspend fun instances(vararg values: Output) {
        this.instances = Output.all(values.asList())
    }

    /**
     * @param values A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
     */
    @JvmName("vorqjrhggylwgtlj")
    public suspend fun instances(values: List>) {
        this.instances = Output.all(values)
    }

    /**
     * @param value Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     */
    @JvmName("tehjxrxgttnmtjbm")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value
     */
    @JvmName("mbfqtagdrrhoqbfh")
    public suspend fun project(`value`: Output) {
        this.project = value
    }

    /**
     * @param value
     */
    @JvmName("tscurbwusujckbma")
    public suspend fun region(`value`: Output) {
        this.region = value
    }

    /**
     * @param value An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    @JvmName("cssadbcwcypeacbh")
    public suspend fun requestId(`value`: Output) {
        this.requestId = value
    }

    /**
     * @param value Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.
     */
    @JvmName("yxxhwbkqwbhyejpk")
    public suspend fun sessionAffinity(`value`: Output) {
        this.sessionAffinity = value
    }

    /**
     * @param value The server-defined URL for the resource. This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool, and its failoverRatio field is properly set to a value between [0, 1]. backupPool and failoverRatio together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below failoverRatio, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio and backupPool are not set, or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
     */
    @JvmName("hpfhjijnaticgjie")
    public suspend fun backupPool(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.backupPool = mapped
    }

    /**
     * @param value An optional description of this resource. Provide this property when you create the resource.
     */
    @JvmName("eujkhmxhttxviwyl")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value This field is applicable only when the containing target pool is serving a forwarding rule as the primary pool (i.e., not as a backup pool to some other target pool). The value of the field must be in [0, 1]. If set, backupPool must also be set. They together define the fallback behavior of the primary target pool: if the ratio of the healthy instances in the primary pool is at or below this number, traffic arriving at the load-balanced IP will be directed to the backup pool. In case where failoverRatio is not set or all the instances in the backup pool are unhealthy, the traffic will be directed back to the primary pool in the "force" mode, where traffic will be spread to the healthy instances with the best effort, or to all instances when no instance is healthy.
     */
    @JvmName("sithglpyapxqrrhx")
    public suspend fun failoverRatio(`value`: Double?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.failoverRatio = mapped
    }

    /**
     * @param value The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified.
     */
    @JvmName("sedcyfjkhyvhlhod")
    public suspend fun healthChecks(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.healthChecks = mapped
    }

    /**
     * @param values The URL of the HttpHealthCheck resource. A member instance in this pool is considered healthy if and only if the health checks pass. Only legacy HttpHealthChecks are supported. Only one health check may be specified.
     */
    @JvmName("pshgghxmmlmskptw")
    public suspend fun healthChecks(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.healthChecks = mapped
    }

    /**
     * @param value A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
     */
    @JvmName("jqovtgpnuspcufym")
    public suspend fun instances(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.instances = mapped
    }

    /**
     * @param values A list of resource URLs to the virtual machine instances serving this pool. They must live in zones contained in the same region as this pool.
     */
    @JvmName("smbnqnjphspcftks")
    public suspend fun instances(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.instances = mapped
    }

    /**
     * @param value Name of the resource. Provided by the client when the resource is created. The name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     */
    @JvmName("rauxdsovonsgrqug")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value
     */
    @JvmName("gppebbmthevxtqev")
    public suspend fun project(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.project = mapped
    }

    /**
     * @param value
     */
    @JvmName("senuskyabskddmlu")
    public suspend fun region(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.region = mapped
    }

    /**
     * @param value An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments. The request ID must be a valid UUID with the exception that zero UUID is not supported ( 00000000-0000-0000-0000-000000000000).
     */
    @JvmName("salimkungfojdgia")
    public suspend fun requestId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.requestId = mapped
    }

    /**
     * @param value Session affinity option, must be one of the following values: NONE: Connections from the same client IP may go to any instance in the pool. CLIENT_IP: Connections from the same client IP will go to the same instance in the pool while that instance remains healthy. CLIENT_IP_PROTO: Connections from the same client IP with the same IP protocol will go to the same instance in the pool while that instance remains healthy.
     */
    @JvmName("oondmhjhwruqfwlv")
    public suspend fun sessionAffinity(`value`: TargetPoolSessionAffinity?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.sessionAffinity = mapped
    }

    internal fun build(): TargetPoolArgs = TargetPoolArgs(
        backupPool = backupPool,
        description = description,
        failoverRatio = failoverRatio,
        healthChecks = healthChecks,
        instances = instances,
        name = name,
        project = project,
        region = region,
        requestId = requestId,
        sessionAffinity = sessionAffinity,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy