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

com.pulumi.gcp.networkservices.kotlin.LbTrafficExtensionArgs.kt Maven / Gradle / Ivy

Go to download

Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.

There is a newer version: 8.20.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkservices.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkservices.LbTrafficExtensionArgs.builder
import com.pulumi.gcp.networkservices.kotlin.inputs.LbTrafficExtensionExtensionChainArgs
import com.pulumi.gcp.networkservices.kotlin.inputs.LbTrafficExtensionExtensionChainArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * LbTrafficExtension is a resource that lets the extension service modify the headers and payloads of both requests and responses without impacting the choice of backend services or any other security policies associated with the backend service.
 * To get more information about LbTrafficExtension, see:
 * * [API documentation](https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.lbTrafficExtensions)
 * * How-to Guides
 *     * [Configure a traffic extension](https://cloud.google.com/service-extensions/docs/configure-callout#configure_a_traffic_extension)
 * ## Example Usage
 * ## Import
 * LbTrafficExtension can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/lbTrafficExtensions/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, LbTrafficExtension can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default projects/{{project}}/locations/{{location}}/lbTrafficExtensions/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/lbTrafficExtension:LbTrafficExtension default {{location}}/{{name}}
 * ```
 * @property description A human-readable description of the resource.
 * @property extensionChains A set of ordered extension chains that contain the match conditions and extensions to execute.
 * Match conditions for each extension chain are evaluated in sequence for a given request.
 * The first extension chain that has a condition that matches the request is executed.
 * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
 * Structure is documented below.
 * @property forwardingRules A list of references to the forwarding rules to which this service extension is attached to.
 * At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
 * @property labels Set of labels associated with the LbTrafficExtension resource. **Note**: This field is non-authoritative, and will only
 * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels
 * present on the resource.
 * @property loadBalancingScheme All backend services and forwarding rules referenced by this extension must share the same load balancing scheme. For
 * more information, refer to [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service) and
 * [Supported application load
 * balancers](https://cloud.google.com/service-extensions/docs/callouts-overview#supported-lbs). Possible values:
 * ["INTERNAL_MANAGED", "EXTERNAL_MANAGED"]
 * @property location The location of the traffic extension
 * @property name Name of the LbTrafficExtension resource in the following format: projects/{project}/locations/{location}/lbTrafficExtensions/{lbTrafficExtension}.
 * @property project
 */
public data class LbTrafficExtensionArgs(
    public val description: Output? = null,
    public val extensionChains: Output>? = null,
    public val forwardingRules: Output>? = null,
    public val labels: Output>? = null,
    public val loadBalancingScheme: Output? = null,
    public val location: Output? = null,
    public val name: Output? = null,
    public val project: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkservices.LbTrafficExtensionArgs =
        com.pulumi.gcp.networkservices.LbTrafficExtensionArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .extensionChains(
                extensionChains?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            )
            .forwardingRules(forwardingRules?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .loadBalancingScheme(loadBalancingScheme?.applyValue({ args0 -> args0 }))
            .location(location?.applyValue({ args0 -> args0 }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 })).build()
}

/**
 * Builder for [LbTrafficExtensionArgs].
 */
@PulumiTagMarker
public class LbTrafficExtensionArgsBuilder internal constructor() {
    private var description: Output? = null

    private var extensionChains: Output>? = null

    private var forwardingRules: Output>? = null

    private var labels: Output>? = null

    private var loadBalancingScheme: Output? = null

    private var location: Output? = null

    private var name: Output? = null

    private var project: Output? = null

    /**
     * @param value A human-readable description of the resource.
     */
    @JvmName("edpfdawyypcrvsqv")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("nikmpgjqlirurcqh")
    public suspend fun extensionChains(`value`: Output>) {
        this.extensionChains = value
    }

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

    /**
     * @param values A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("krttosmpukceysvg")
    public suspend fun extensionChains(values: List>) {
        this.extensionChains = Output.all(values)
    }

    /**
     * @param value A list of references to the forwarding rules to which this service extension is attached to.
     * At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
     */
    @JvmName("ddchaludspmrdxxo")
    public suspend fun forwardingRules(`value`: Output>) {
        this.forwardingRules = value
    }

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

    /**
     * @param values A list of references to the forwarding rules to which this service extension is attached to.
     * At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
     */
    @JvmName("koqsqukmfxywbanr")
    public suspend fun forwardingRules(values: List>) {
        this.forwardingRules = Output.all(values)
    }

    /**
     * @param value Set of labels associated with the LbTrafficExtension resource. **Note**: This field is non-authoritative, and will only
     * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels
     * present on the resource.
     */
    @JvmName("mkcbxtsjegyxjbdv")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value All backend services and forwarding rules referenced by this extension must share the same load balancing scheme. For
     * more information, refer to [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service) and
     * [Supported application load
   * balancers](https://cloud.google.com/service-extensions/docs/callouts-overview#supported-lbs). Possible values:
     * ["INTERNAL_MANAGED", "EXTERNAL_MANAGED"]
     */
    @JvmName("xbggwjrgwallbpdf")
    public suspend fun loadBalancingScheme(`value`: Output) {
        this.loadBalancingScheme = value
    }

    /**
     * @param value The location of the traffic extension
     */
    @JvmName("ufadqtvvqxcgtxtb")
    public suspend fun location(`value`: Output) {
        this.location = value
    }

    /**
     * @param value Name of the LbTrafficExtension resource in the following format: projects/{project}/locations/{location}/lbTrafficExtensions/{lbTrafficExtension}.
     */
    @JvmName("fqvchadtbbbbwygh")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value A human-readable description of the resource.
     */
    @JvmName("kbwijhevipvytmva")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("aaejyjjuqigbwqra")
    public suspend fun extensionChains(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.extensionChains = mapped
    }

    /**
     * @param argument A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("qnoectnkbbuetdqf")
    public suspend fun extensionChains(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            LbTrafficExtensionExtensionChainArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.extensionChains = mapped
    }

    /**
     * @param argument A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("sjfowucxtoyxcuks")
    public suspend fun extensionChains(vararg argument: suspend LbTrafficExtensionExtensionChainArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            LbTrafficExtensionExtensionChainArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.extensionChains = mapped
    }

    /**
     * @param argument A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("mkllqxprhqjjoovn")
    public suspend fun extensionChains(argument: suspend LbTrafficExtensionExtensionChainArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(
            LbTrafficExtensionExtensionChainArgsBuilder().applySuspend {
                argument()
            }.build(),
        )
        val mapped = of(toBeMapped)
        this.extensionChains = mapped
    }

    /**
     * @param values A set of ordered extension chains that contain the match conditions and extensions to execute.
     * Match conditions for each extension chain are evaluated in sequence for a given request.
     * The first extension chain that has a condition that matches the request is executed.
     * Any subsequent extension chains do not execute. Limited to 5 extension chains per resource.
     * Structure is documented below.
     */
    @JvmName("qnvneipdcjomgvuf")
    public suspend fun extensionChains(vararg values: LbTrafficExtensionExtensionChainArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.extensionChains = mapped
    }

    /**
     * @param value A list of references to the forwarding rules to which this service extension is attached to.
     * At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
     */
    @JvmName("pvbienjmuqfjptrw")
    public suspend fun forwardingRules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.forwardingRules = mapped
    }

    /**
     * @param values A list of references to the forwarding rules to which this service extension is attached to.
     * At least one forwarding rule is required. There can be only one LBTrafficExtension resource per forwarding rule.
     */
    @JvmName("jcvhmxvubosobbob")
    public suspend fun forwardingRules(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.forwardingRules = mapped
    }

    /**
     * @param value Set of labels associated with the LbTrafficExtension resource. **Note**: This field is non-authoritative, and will only
     * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels
     * present on the resource.
     */
    @JvmName("cqlxteokdwtiyegl")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of labels associated with the LbTrafficExtension resource. **Note**: This field is non-authoritative, and will only
     * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels
     * present on the resource.
     */
    @JvmName("qnpthywkwauiwudi")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value All backend services and forwarding rules referenced by this extension must share the same load balancing scheme. For
     * more information, refer to [Choosing a load balancer](https://cloud.google.com/load-balancing/docs/backend-service) and
     * [Supported application load
   * balancers](https://cloud.google.com/service-extensions/docs/callouts-overview#supported-lbs). Possible values:
     * ["INTERNAL_MANAGED", "EXTERNAL_MANAGED"]
     */
    @JvmName("rhdyrikceaimhqfx")
    public suspend fun loadBalancingScheme(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.loadBalancingScheme = mapped
    }

    /**
     * @param value The location of the traffic extension
     */
    @JvmName("uaclclfadpofofcl")
    public suspend fun location(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.location = mapped
    }

    /**
     * @param value Name of the LbTrafficExtension resource in the following format: projects/{project}/locations/{location}/lbTrafficExtensions/{lbTrafficExtension}.
     */
    @JvmName("oumwemfcelecgdqh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    internal fun build(): LbTrafficExtensionArgs = LbTrafficExtensionArgs(
        description = description,
        extensionChains = extensionChains,
        forwardingRules = forwardingRules,
        labels = labels,
        loadBalancingScheme = loadBalancingScheme,
        location = location,
        name = name,
        project = project,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy