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

com.pulumi.gcp.networkservices.kotlin.LbTrafficExtension.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.13.1.0
Show newest version
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.gcp.networkservices.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.networkservices.kotlin.outputs.LbTrafficExtensionExtensionChain
import com.pulumi.gcp.networkservices.kotlin.outputs.LbTrafficExtensionExtensionChain.Companion.toKotlin
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.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map

/**
 * Builder for [LbTrafficExtension].
 */
@PulumiTagMarker
public class LbTrafficExtensionResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: LbTrafficExtensionArgs = LbTrafficExtensionArgs()

    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 LbTrafficExtensionArgsBuilder.() -> Unit) {
        val builder = LbTrafficExtensionArgsBuilder()
        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(): LbTrafficExtension {
        val builtJavaResource =
            com.pulumi.gcp.networkservices.LbTrafficExtension(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return LbTrafficExtension(builtJavaResource)
    }
}

/**
 * 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}}
 * ```
 */
public class LbTrafficExtension internal constructor(
    override val javaResource: com.pulumi.gcp.networkservices.LbTrafficExtension,
) : KotlinCustomResource(javaResource, LbTrafficExtensionMapper) {
    /**
     * A human-readable description of the resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
     */
    public val effectiveLabels: Output>
        get() = javaResource.effectiveLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })

    /**
     * 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.
     */
    public val extensionChains: Output>
        get() = javaResource.extensionChains().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> toKotlin(args0) })
            })
        })

    /**
     * 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.
     */
    public val forwardingRules: Output>
        get() = javaResource.forwardingRules().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * 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.
     */
    public val labels: Output>?
        get() = javaResource.labels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.map({ args0 ->
                    args0.key.to(args0.value)
                }).toMap()
            }).orElse(null)
        })

    /**
     * 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"]
     */
    public val loadBalancingScheme: Output?
        get() = javaResource.loadBalancingScheme().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * The location of the traffic extension
     */
    public val location: Output
        get() = javaResource.location().applyValue({ args0 -> args0 })

    /**
     * Name of the LbTrafficExtension resource in the following format: projects/{project}/locations/{location}/lbTrafficExtensions/{lbTrafficExtension}.
     */
    public val name: Output
        get() = javaResource.name().applyValue({ args0 -> args0 })

    public val project: Output
        get() = javaResource.project().applyValue({ args0 -> args0 })

    /**
     * The combination of labels configured directly on the resource
     * and default labels configured on the provider.
     */
    public val pulumiLabels: Output>
        get() = javaResource.pulumiLabels().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.key.to(args0.value)
            }).toMap()
        })
}

public object LbTrafficExtensionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networkservices.LbTrafficExtension::class == javaResource::class

    override fun map(javaResource: Resource): LbTrafficExtension = LbTrafficExtension(
        javaResource as
            com.pulumi.gcp.networkservices.LbTrafficExtension,
    )
}

/**
 * @see [LbTrafficExtension].
 * @param name The _unique_ name of the resulting resource.
 * @param block Builder for [LbTrafficExtension].
 */
public suspend fun lbTrafficExtension(
    name: String,
    block: suspend LbTrafficExtensionResourceBuilder.() -> Unit,
): LbTrafficExtension {
    val builder = LbTrafficExtensionResourceBuilder()
    builder.name(name)
    block(builder)
    return builder.build()
}

/**
 * @see [LbTrafficExtension].
 * @param name The _unique_ name of the resulting resource.
 */
public fun lbTrafficExtension(name: String): LbTrafficExtension {
    val builder = LbTrafficExtensionResourceBuilder()
    builder.name(name)
    return builder.build()
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy