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

com.pulumi.googlenative.networkservices.v1.kotlin.GrpcRouteArgs.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.

The newest version!
@file:Suppress("NAME_SHADOWING", "DEPRECATION")

package com.pulumi.googlenative.networkservices.v1.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.googlenative.networkservices.v1.GrpcRouteArgs.builder
import com.pulumi.googlenative.networkservices.v1.kotlin.inputs.GrpcRouteRouteRuleArgs
import com.pulumi.googlenative.networkservices.v1.kotlin.inputs.GrpcRouteRouteRuleArgsBuilder
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

/**
 * Creates a new GrpcRoute in a given project and location.
 * @property description Optional. A free-text description of the resource. Max length 1024 characters.
 * @property gateways Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/global/gateways/`
 * @property grpcRouteId Required. Short name of the GrpcRoute resource to be created.
 * @property hostnames Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
 * @property labels Optional. Set of label tags associated with the GrpcRoute resource.
 * @property location
 * @property meshes Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/global/meshes/`
 * @property name Name of the GrpcRoute resource. It matches pattern `projects/*/locations/global/grpcRoutes/`
 * @property project
 * @property rules A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
 * */*/*/
 */
public data class GrpcRouteArgs(
    public val description: Output? = null,
    public val gateways: Output>? = null,
    public val grpcRouteId: Output? = null,
    public val hostnames: Output>? = null,
    public val labels: Output>? = null,
    public val location: Output? = null,
    public val meshes: Output>? = null,
    public val name: Output? = null,
    public val project: Output? = null,
    public val rules: Output>? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.googlenative.networkservices.v1.GrpcRouteArgs =
        com.pulumi.googlenative.networkservices.v1.GrpcRouteArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .gateways(gateways?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .grpcRouteId(grpcRouteId?.applyValue({ args0 -> args0 }))
            .hostnames(hostnames?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .location(location?.applyValue({ args0 -> args0 }))
            .meshes(meshes?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .name(name?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .rules(
                rules?.applyValue({ args0 ->
                    args0.map({ args0 ->
                        args0.let({ args0 ->
                            args0.toJava()
                        })
                    })
                }),
            ).build()
}

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

    private var gateways: Output>? = null

    private var grpcRouteId: Output? = null

    private var hostnames: Output>? = null

    private var labels: Output>? = null

    private var location: Output? = null

    private var meshes: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var rules: Output>? = null

    /**
     * @param value Optional. A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("rppddvcywgdseqcm")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/global/gateways/`
     * */
     */
    @JvmName("yqathnxmbhmpytwc")
    public suspend fun gateways(`value`: Output>) {
        this.gateways = value
    }

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

    /**
     * @param values Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/global/gateways/`
     * */
     */
    @JvmName("oqhhkgtxeewwjwsc")
    public suspend fun gateways(values: List>) {
        this.gateways = Output.all(values)
    }

    /**
     * @param value Required. Short name of the GrpcRoute resource to be created.
     */
    @JvmName("hdommspgcujxslbm")
    public suspend fun grpcRouteId(`value`: Output) {
        this.grpcRouteId = value
    }

    /**
     * @param value Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
     */
    @JvmName("cfoigrhmqhcggxpx")
    public suspend fun hostnames(`value`: Output>) {
        this.hostnames = value
    }

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

    /**
     * @param values Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
     */
    @JvmName("ofclpbnvcvwsueng")
    public suspend fun hostnames(values: List>) {
        this.hostnames = Output.all(values)
    }

    /**
     * @param value Optional. Set of label tags associated with the GrpcRoute resource.
     */
    @JvmName("cqcqgefuvvawseqx")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

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

    /**
     * @param value Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/global/meshes/`
     * */
     */
    @JvmName("xpchtxbbjywvkrqr")
    public suspend fun meshes(`value`: Output>) {
        this.meshes = value
    }

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

    /**
     * @param values Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/global/meshes/`
     * */
     */
    @JvmName("bynepqdhakvnjehe")
    public suspend fun meshes(values: List>) {
        this.meshes = Output.all(values)
    }

    /**
     * @param value Name of the GrpcRoute resource. It matches pattern `projects/*/locations/global/grpcRoutes/`
     * */
     */
    @JvmName("dqwfwmfjrjtdqqsc")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("yujjquvkdbbatpwa")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("uplpwjjpfigvaydw")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

    /**
     * @param value Optional. A free-text description of the resource. Max length 1024 characters.
     */
    @JvmName("qybbepjibidfivnw")
    public suspend fun description(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.description = mapped
    }

    /**
     * @param value Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/global/gateways/`
     * */
     */
    @JvmName("xhlrdbjlyhtguayj")
    public suspend fun gateways(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gateways = mapped
    }

    /**
     * @param values Optional. Gateways defines a list of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: `projects/*/locations/global/gateways/`
     * */
     */
    @JvmName("xxpmednhfqekefey")
    public suspend fun gateways(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.gateways = mapped
    }

    /**
     * @param value Required. Short name of the GrpcRoute resource to be created.
     */
    @JvmName("tahowbtlismawwyb")
    public suspend fun grpcRouteId(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.grpcRouteId = mapped
    }

    /**
     * @param value Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
     */
    @JvmName("vciblakxxhsaojqc")
    public suspend fun hostnames(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.hostnames = mapped
    }

    /**
     * @param values Service hostnames with an optional port for which this route describes traffic. Format: [:] Hostname is the fully qualified domain name of a network host. This matches the RFC 1123 definition of a hostname with 2 notable exceptions: - IPs are not allowed. - A hostname may be prefixed with a wildcard label (`*.`). The wildcard label must appear by itself as the first label. Hostname can be "precise" which is a domain name without the terminating dot of a network host (e.g. `foo.example.com`) or "wildcard", which is a domain name prefixed with a single wildcard label (e.g. `*.example.com`). Note that as per RFC1035 and RFC1123, a label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character. No other punctuation is allowed. The routes associated with a Mesh or Gateway must have unique hostnames. If you attempt to attach multiple routes with conflicting hostnames, the configuration will be rejected. For example, while it is acceptable for routes for the hostnames `*.foo.bar.com` and `*.bar.com` to be associated with the same route, it is not possible to associate two routes both with `*.bar.com` or both with `bar.com`. If a port is specified, then gRPC clients must use the channel URI with the port to match this rule (i.e. "xds:///service:123"), otherwise they must supply the URI without a port (i.e. "xds:///service").
     */
    @JvmName("mugxeqpxsjudjfwk")
    public suspend fun hostnames(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.hostnames = mapped
    }

    /**
     * @param value Optional. Set of label tags associated with the GrpcRoute resource.
     */
    @JvmName("ijaglyvrdfdpujor")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Optional. Set of label tags associated with the GrpcRoute resource.
     */
    @JvmName("crqcjjwrexrvbhes")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

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

    /**
     * @param value Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/global/meshes/`
     * */
     */
    @JvmName("qsjlojmvrpliogii")
    public suspend fun meshes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.meshes = mapped
    }

    /**
     * @param values Optional. Meshes defines a list of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: `projects/*/locations/global/meshes/`
     * */
     */
    @JvmName("xitdxpiilyjyjoyi")
    public suspend fun meshes(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.meshes = mapped
    }

    /**
     * @param value Name of the GrpcRoute resource. It matches pattern `projects/*/locations/global/grpcRoutes/`
     * */
     */
    @JvmName("hsepxlpwgewyqywb")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    /**
     * @param value A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("wplkwxrlcomrgkna")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("fpijheprqwsiylvq")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            GrpcRouteRouteRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("eivdhuuxmvsoewtu")
    public suspend fun rules(vararg argument: suspend GrpcRouteRouteRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            GrpcRouteRouteRuleArgsBuilder().applySuspend {
                it()
            }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("argergxohpqgpmnh")
    public suspend fun rules(argument: suspend GrpcRouteRouteRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(GrpcRouteRouteRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values A list of detailed rules defining how to route traffic. Within a single GrpcRoute, the GrpcRoute.RouteAction associated with the first matching GrpcRoute.RouteRule will be executed. At least one rule must be supplied.
     */
    @JvmName("leylrruqohftjrbw")
    public suspend fun rules(vararg values: GrpcRouteRouteRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    internal fun build(): GrpcRouteArgs = GrpcRouteArgs(
        description = description,
        gateways = gateways,
        grpcRouteId = grpcRouteId,
        hostnames = hostnames,
        labels = labels,
        location = location,
        meshes = meshes,
        name = name,
        project = project,
        rules = rules,
    )
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy