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

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

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

package com.pulumi.gcp.networkservices.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.networkservices.kotlin.outputs.LbRouteExtensionExtensionChain
import com.pulumi.gcp.networkservices.kotlin.outputs.LbRouteExtensionExtensionChain.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 [LbRouteExtension].
 */
@PulumiTagMarker
public class LbRouteExtensionResourceBuilder internal constructor() {
    public var name: String? = null

    public var args: LbRouteExtensionArgs = LbRouteExtensionArgs()

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

/**
 * LbRouteExtension is a resource that lets you control where traffic is routed to for a given request.
 * To get more information about LbRouteExtension, see:
 * * [API documentation](https://cloud.google.com/service-extensions/docs/reference/rest/v1beta1/projects.locations.lbRouteExtensions)
 * * How-to Guides
 *     * [Configure a route extension](https://cloud.google.com/service-extensions/docs/configure-callout#configure_a_route_extension)
 * ## Example Usage
 * ## Import
 * LbRouteExtension can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/{{location}}/lbRouteExtensions/{{name}}`
 * * `{{project}}/{{location}}/{{name}}`
 * * `{{location}}/{{name}}`
 * When using the `pulumi import` command, LbRouteExtension can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkservices/lbRouteExtension:LbRouteExtension default projects/{{project}}/locations/{{location}}/lbRouteExtensions/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/lbRouteExtension:LbRouteExtension default {{project}}/{{location}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/lbRouteExtension:LbRouteExtension default {{location}}/{{name}}
 * ```
 */
public class LbRouteExtension internal constructor(
    override val javaResource: com.pulumi.gcp.networkservices.LbRouteExtension,
) : KotlinCustomResource(javaResource, LbRouteExtensionMapper) {
    /**
     * 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 LbRouteExtension resource per forwarding rule.
     */
    public val forwardingRules: Output>
        get() = javaResource.forwardingRules().applyValue({ args0 -> args0.map({ args0 -> args0 }) })

    /**
     * Set of labels associated with the LbRouteExtension 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 are: `INTERNAL_MANAGED`, `EXTERNAL_MANAGED`.
     */
    public val loadBalancingScheme: Output
        get() = javaResource.loadBalancingScheme().applyValue({ args0 -> args0 })

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

    /**
     * Name of the LbRouteExtension resource in the following format: projects/{project}/locations/{location}/lbRouteExtensions/{lbRouteExtension}
     */
    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 LbRouteExtensionMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networkservices.LbRouteExtension::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy