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

com.pulumi.gcp.networkservices.kotlin.TcpRouteArgs.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.10.0.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.TcpRouteArgs.builder
import com.pulumi.gcp.networkservices.kotlin.inputs.TcpRouteRuleArgs
import com.pulumi.gcp.networkservices.kotlin.inputs.TcpRouteRuleArgsBuilder
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

/**
 * ## Example Usage
 * ### Network Services Tcp Route Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "backend-service-health-check",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const _default = new gcp.compute.BackendService("default", {
 *     name: "my-backend-service",
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     rules: [{
 *         matches: [{
 *             address: "10.0.0.1/32",
 *             port: "8081",
 *         }],
 *         action: {
 *             destinations: [{
 *                 serviceName: _default.id,
 *                 weight: 1,
 *             }],
 *             originalDestination: false,
 *         },
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_http_health_check = gcp.compute.HttpHealthCheck("default",
 *     name="backend-service-health-check",
 *     request_path="/",
 *     check_interval_sec=1,
 *     timeout_sec=1)
 * default = gcp.compute.BackendService("default",
 *     name="my-backend-service",
 *     health_checks=default_http_health_check.id)
 * default_tcp_route = gcp.networkservices.TcpRoute("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     rules=[gcp.networkservices.TcpRouteRuleArgs(
 *         matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
 *             address="10.0.0.1/32",
 *             port="8081",
 *         )],
 *         action=gcp.networkservices.TcpRouteRuleActionArgs(
 *             destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
 *                 service_name=default.id,
 *                 weight=1,
 *             )],
 *             original_destination=False,
 *         ),
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
 *     {
 *         Name = "backend-service-health-check",
 *         RequestPath = "/",
 *         CheckIntervalSec = 1,
 *         TimeoutSec = 1,
 *     });
 *     var @default = new Gcp.Compute.BackendService("default", new()
 *     {
 *         Name = "my-backend-service",
 *         HealthChecks = defaultHttpHealthCheck.Id,
 *     });
 *     var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Rules = new[]
 *         {
 *             new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
 *             {
 *                 Matches = new[]
 *                 {
 *                     new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
 *                     {
 *                         Address = "10.0.0.1/32",
 *                         Port = "8081",
 *                     },
 *                 },
 *                 Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
 *                 {
 *                     Destinations = new[]
 *                     {
 *                         new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
 *                         {
 *                             ServiceName = @default.Id,
 *                             Weight = 1,
 *                         },
 *                     },
 *                     OriginalDestination = false,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
 * 			Name:             pulumi.String("backend-service-health-check"),
 * 			RequestPath:      pulumi.String("/"),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TimeoutSec:       pulumi.Int(1),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
 * 			Name:         pulumi.String("my-backend-service"),
 * 			HealthChecks: defaultHttpHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkservices.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Rules: networkservices.TcpRouteRuleArray{
 * 				&networkservices.TcpRouteRuleArgs{
 * 					Matches: networkservices.TcpRouteRuleMatchArray{
 * 						&networkservices.TcpRouteRuleMatchArgs{
 * 							Address: pulumi.String("10.0.0.1/32"),
 * 							Port:    pulumi.String("8081"),
 * 						},
 * 					},
 * 					Action: &networkservices.TcpRouteRuleActionArgs{
 * 						Destinations: networkservices.TcpRouteRuleActionDestinationArray{
 * 							&networkservices.TcpRouteRuleActionDestinationArgs{
 * 								ServiceName: _default.ID(),
 * 								Weight:      pulumi.Int(1),
 * 							},
 * 						},
 * 						OriginalDestination: pulumi.Bool(false),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.HttpHealthCheck;
 * import com.pulumi.gcp.compute.HttpHealthCheckArgs;
 * import com.pulumi.gcp.compute.BackendService;
 * import com.pulumi.gcp.compute.BackendServiceArgs;
 * import com.pulumi.gcp.networkservices.TcpRoute;
 * import com.pulumi.gcp.networkservices.TcpRouteArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
 *             .name("backend-service-health-check")
 *             .requestPath("/")
 *             .checkIntervalSec(1)
 *             .timeoutSec(1)
 *             .build());
 *         var default_ = new BackendService("default", BackendServiceArgs.builder()
 *             .name("my-backend-service")
 *             .healthChecks(defaultHttpHealthCheck.id())
 *             .build());
 *         var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .rules(TcpRouteRuleArgs.builder()
 *                 .matches(TcpRouteRuleMatchArgs.builder()
 *                     .address("10.0.0.1/32")
 *                     .port("8081")
 *                     .build())
 *                 .action(TcpRouteRuleActionArgs.builder()
 *                     .destinations(TcpRouteRuleActionDestinationArgs.builder()
 *                         .serviceName(default_.id())
 *                         .weight(1)
 *                         .build())
 *                     .originalDestination(false)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:BackendService
 *     properties:
 *       name: my-backend-service
 *       healthChecks: ${defaultHttpHealthCheck.id}
 *   defaultHttpHealthCheck:
 *     type: gcp:compute:HttpHealthCheck
 *     name: default
 *     properties:
 *       name: backend-service-health-check
 *       requestPath: /
 *       checkIntervalSec: 1
 *       timeoutSec: 1
 *   defaultTcpRoute:
 *     type: gcp:networkservices:TcpRoute
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *       rules:
 *         - matches:
 *             - address: 10.0.0.1/32
 *               port: '8081'
 *           action:
 *             destinations:
 *               - serviceName: ${default.id}
 *                 weight: 1
 *             originalDestination: false
 * ```
 * 
 * ### Network Services Tcp Route Actions
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "backend-service-health-check",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const _default = new gcp.compute.BackendService("default", {
 *     name: "my-backend-service",
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     rules: [{
 *         action: {
 *             destinations: [{
 *                 serviceName: _default.id,
 *                 weight: 1,
 *             }],
 *             originalDestination: false,
 *         },
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_http_health_check = gcp.compute.HttpHealthCheck("default",
 *     name="backend-service-health-check",
 *     request_path="/",
 *     check_interval_sec=1,
 *     timeout_sec=1)
 * default = gcp.compute.BackendService("default",
 *     name="my-backend-service",
 *     health_checks=default_http_health_check.id)
 * default_tcp_route = gcp.networkservices.TcpRoute("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     rules=[gcp.networkservices.TcpRouteRuleArgs(
 *         action=gcp.networkservices.TcpRouteRuleActionArgs(
 *             destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
 *                 service_name=default.id,
 *                 weight=1,
 *             )],
 *             original_destination=False,
 *         ),
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
 *     {
 *         Name = "backend-service-health-check",
 *         RequestPath = "/",
 *         CheckIntervalSec = 1,
 *         TimeoutSec = 1,
 *     });
 *     var @default = new Gcp.Compute.BackendService("default", new()
 *     {
 *         Name = "my-backend-service",
 *         HealthChecks = defaultHttpHealthCheck.Id,
 *     });
 *     var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Rules = new[]
 *         {
 *             new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
 *             {
 *                 Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
 *                 {
 *                     Destinations = new[]
 *                     {
 *                         new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
 *                         {
 *                             ServiceName = @default.Id,
 *                             Weight = 1,
 *                         },
 *                     },
 *                     OriginalDestination = false,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
 * 			Name:             pulumi.String("backend-service-health-check"),
 * 			RequestPath:      pulumi.String("/"),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TimeoutSec:       pulumi.Int(1),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
 * 			Name:         pulumi.String("my-backend-service"),
 * 			HealthChecks: defaultHttpHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkservices.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Rules: networkservices.TcpRouteRuleArray{
 * 				&networkservices.TcpRouteRuleArgs{
 * 					Action: &networkservices.TcpRouteRuleActionArgs{
 * 						Destinations: networkservices.TcpRouteRuleActionDestinationArray{
 * 							&networkservices.TcpRouteRuleActionDestinationArgs{
 * 								ServiceName: _default.ID(),
 * 								Weight:      pulumi.Int(1),
 * 							},
 * 						},
 * 						OriginalDestination: pulumi.Bool(false),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.HttpHealthCheck;
 * import com.pulumi.gcp.compute.HttpHealthCheckArgs;
 * import com.pulumi.gcp.compute.BackendService;
 * import com.pulumi.gcp.compute.BackendServiceArgs;
 * import com.pulumi.gcp.networkservices.TcpRoute;
 * import com.pulumi.gcp.networkservices.TcpRouteArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
 *             .name("backend-service-health-check")
 *             .requestPath("/")
 *             .checkIntervalSec(1)
 *             .timeoutSec(1)
 *             .build());
 *         var default_ = new BackendService("default", BackendServiceArgs.builder()
 *             .name("my-backend-service")
 *             .healthChecks(defaultHttpHealthCheck.id())
 *             .build());
 *         var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .rules(TcpRouteRuleArgs.builder()
 *                 .action(TcpRouteRuleActionArgs.builder()
 *                     .destinations(TcpRouteRuleActionDestinationArgs.builder()
 *                         .serviceName(default_.id())
 *                         .weight(1)
 *                         .build())
 *                     .originalDestination(false)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:BackendService
 *     properties:
 *       name: my-backend-service
 *       healthChecks: ${defaultHttpHealthCheck.id}
 *   defaultHttpHealthCheck:
 *     type: gcp:compute:HttpHealthCheck
 *     name: default
 *     properties:
 *       name: backend-service-health-check
 *       requestPath: /
 *       checkIntervalSec: 1
 *       timeoutSec: 1
 *   defaultTcpRoute:
 *     type: gcp:networkservices:TcpRoute
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *       rules:
 *         - action:
 *             destinations:
 *               - serviceName: ${default.id}
 *                 weight: 1
 *             originalDestination: false
 * ```
 * 
 * ### Network Services Tcp Route Mesh Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "backend-service-health-check",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const _default = new gcp.compute.BackendService("default", {
 *     name: "my-backend-service",
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultMesh = new gcp.networkservices.Mesh("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 * });
 * const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     meshes: [defaultMesh.id],
 *     rules: [{
 *         matches: [{
 *             address: "10.0.0.1/32",
 *             port: "8081",
 *         }],
 *         action: {
 *             destinations: [{
 *                 serviceName: _default.id,
 *                 weight: 1,
 *             }],
 *             originalDestination: false,
 *         },
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_http_health_check = gcp.compute.HttpHealthCheck("default",
 *     name="backend-service-health-check",
 *     request_path="/",
 *     check_interval_sec=1,
 *     timeout_sec=1)
 * default = gcp.compute.BackendService("default",
 *     name="my-backend-service",
 *     health_checks=default_http_health_check.id)
 * default_mesh = gcp.networkservices.Mesh("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description")
 * default_tcp_route = gcp.networkservices.TcpRoute("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     meshes=[default_mesh.id],
 *     rules=[gcp.networkservices.TcpRouteRuleArgs(
 *         matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
 *             address="10.0.0.1/32",
 *             port="8081",
 *         )],
 *         action=gcp.networkservices.TcpRouteRuleActionArgs(
 *             destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
 *                 service_name=default.id,
 *                 weight=1,
 *             )],
 *             original_destination=False,
 *         ),
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
 *     {
 *         Name = "backend-service-health-check",
 *         RequestPath = "/",
 *         CheckIntervalSec = 1,
 *         TimeoutSec = 1,
 *     });
 *     var @default = new Gcp.Compute.BackendService("default", new()
 *     {
 *         Name = "my-backend-service",
 *         HealthChecks = defaultHttpHealthCheck.Id,
 *     });
 *     var defaultMesh = new Gcp.NetworkServices.Mesh("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *     });
 *     var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Meshes = new[]
 *         {
 *             defaultMesh.Id,
 *         },
 *         Rules = new[]
 *         {
 *             new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
 *             {
 *                 Matches = new[]
 *                 {
 *                     new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
 *                     {
 *                         Address = "10.0.0.1/32",
 *                         Port = "8081",
 *                     },
 *                 },
 *                 Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
 *                 {
 *                     Destinations = new[]
 *                     {
 *                         new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
 *                         {
 *                             ServiceName = @default.Id,
 *                             Weight = 1,
 *                         },
 *                     },
 *                     OriginalDestination = false,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
 * 			Name:             pulumi.String("backend-service-health-check"),
 * 			RequestPath:      pulumi.String("/"),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TimeoutSec:       pulumi.Int(1),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
 * 			Name:         pulumi.String("my-backend-service"),
 * 			HealthChecks: defaultHttpHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultMesh, err := networkservices.NewMesh(ctx, "default", &networkservices.MeshArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkservices.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Meshes: pulumi.StringArray{
 * 				defaultMesh.ID(),
 * 			},
 * 			Rules: networkservices.TcpRouteRuleArray{
 * 				&networkservices.TcpRouteRuleArgs{
 * 					Matches: networkservices.TcpRouteRuleMatchArray{
 * 						&networkservices.TcpRouteRuleMatchArgs{
 * 							Address: pulumi.String("10.0.0.1/32"),
 * 							Port:    pulumi.String("8081"),
 * 						},
 * 					},
 * 					Action: &networkservices.TcpRouteRuleActionArgs{
 * 						Destinations: networkservices.TcpRouteRuleActionDestinationArray{
 * 							&networkservices.TcpRouteRuleActionDestinationArgs{
 * 								ServiceName: _default.ID(),
 * 								Weight:      pulumi.Int(1),
 * 							},
 * 						},
 * 						OriginalDestination: pulumi.Bool(false),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.HttpHealthCheck;
 * import com.pulumi.gcp.compute.HttpHealthCheckArgs;
 * import com.pulumi.gcp.compute.BackendService;
 * import com.pulumi.gcp.compute.BackendServiceArgs;
 * import com.pulumi.gcp.networkservices.Mesh;
 * import com.pulumi.gcp.networkservices.MeshArgs;
 * import com.pulumi.gcp.networkservices.TcpRoute;
 * import com.pulumi.gcp.networkservices.TcpRouteArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
 *             .name("backend-service-health-check")
 *             .requestPath("/")
 *             .checkIntervalSec(1)
 *             .timeoutSec(1)
 *             .build());
 *         var default_ = new BackendService("default", BackendServiceArgs.builder()
 *             .name("my-backend-service")
 *             .healthChecks(defaultHttpHealthCheck.id())
 *             .build());
 *         var defaultMesh = new Mesh("defaultMesh", MeshArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .build());
 *         var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .meshes(defaultMesh.id())
 *             .rules(TcpRouteRuleArgs.builder()
 *                 .matches(TcpRouteRuleMatchArgs.builder()
 *                     .address("10.0.0.1/32")
 *                     .port("8081")
 *                     .build())
 *                 .action(TcpRouteRuleActionArgs.builder()
 *                     .destinations(TcpRouteRuleActionDestinationArgs.builder()
 *                         .serviceName(default_.id())
 *                         .weight(1)
 *                         .build())
 *                     .originalDestination(false)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:BackendService
 *     properties:
 *       name: my-backend-service
 *       healthChecks: ${defaultHttpHealthCheck.id}
 *   defaultHttpHealthCheck:
 *     type: gcp:compute:HttpHealthCheck
 *     name: default
 *     properties:
 *       name: backend-service-health-check
 *       requestPath: /
 *       checkIntervalSec: 1
 *       timeoutSec: 1
 *   defaultMesh:
 *     type: gcp:networkservices:Mesh
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *   defaultTcpRoute:
 *     type: gcp:networkservices:TcpRoute
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *       meshes:
 *         - ${defaultMesh.id}
 *       rules:
 *         - matches:
 *             - address: 10.0.0.1/32
 *               port: '8081'
 *           action:
 *             destinations:
 *               - serviceName: ${default.id}
 *                 weight: 1
 *             originalDestination: false
 * ```
 * 
 * ### Network Services Tcp Route Gateway Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
 *     name: "backend-service-health-check",
 *     requestPath: "/",
 *     checkIntervalSec: 1,
 *     timeoutSec: 1,
 * });
 * const _default = new gcp.compute.BackendService("default", {
 *     name: "my-backend-service",
 *     healthChecks: defaultHttpHealthCheck.id,
 * });
 * const defaultGateway = new gcp.networkservices.Gateway("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     scope: "my-scope",
 *     type: "OPEN_MESH",
 *     ports: [443],
 * });
 * const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
 *     name: "my-tcp-route",
 *     labels: {
 *         foo: "bar",
 *     },
 *     description: "my description",
 *     gateways: [defaultGateway.id],
 *     rules: [{
 *         matches: [{
 *             address: "10.0.0.1/32",
 *             port: "8081",
 *         }],
 *         action: {
 *             destinations: [{
 *                 serviceName: _default.id,
 *                 weight: 1,
 *             }],
 *             originalDestination: false,
 *         },
 *     }],
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * default_http_health_check = gcp.compute.HttpHealthCheck("default",
 *     name="backend-service-health-check",
 *     request_path="/",
 *     check_interval_sec=1,
 *     timeout_sec=1)
 * default = gcp.compute.BackendService("default",
 *     name="my-backend-service",
 *     health_checks=default_http_health_check.id)
 * default_gateway = gcp.networkservices.Gateway("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     scope="my-scope",
 *     type="OPEN_MESH",
 *     ports=[443])
 * default_tcp_route = gcp.networkservices.TcpRoute("default",
 *     name="my-tcp-route",
 *     labels={
 *         "foo": "bar",
 *     },
 *     description="my description",
 *     gateways=[default_gateway.id],
 *     rules=[gcp.networkservices.TcpRouteRuleArgs(
 *         matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
 *             address="10.0.0.1/32",
 *             port="8081",
 *         )],
 *         action=gcp.networkservices.TcpRouteRuleActionArgs(
 *             destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
 *                 service_name=default.id,
 *                 weight=1,
 *             )],
 *             original_destination=False,
 *         ),
 *     )])
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
 *     {
 *         Name = "backend-service-health-check",
 *         RequestPath = "/",
 *         CheckIntervalSec = 1,
 *         TimeoutSec = 1,
 *     });
 *     var @default = new Gcp.Compute.BackendService("default", new()
 *     {
 *         Name = "my-backend-service",
 *         HealthChecks = defaultHttpHealthCheck.Id,
 *     });
 *     var defaultGateway = new Gcp.NetworkServices.Gateway("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Scope = "my-scope",
 *         Type = "OPEN_MESH",
 *         Ports = new[]
 *         {
 *             443,
 *         },
 *     });
 *     var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
 *     {
 *         Name = "my-tcp-route",
 *         Labels =
 *         {
 *             { "foo", "bar" },
 *         },
 *         Description = "my description",
 *         Gateways = new[]
 *         {
 *             defaultGateway.Id,
 *         },
 *         Rules = new[]
 *         {
 *             new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
 *             {
 *                 Matches = new[]
 *                 {
 *                     new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
 *                     {
 *                         Address = "10.0.0.1/32",
 *                         Port = "8081",
 *                     },
 *                 },
 *                 Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
 *                 {
 *                     Destinations = new[]
 *                     {
 *                         new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
 *                         {
 *                             ServiceName = @default.Id,
 *                             Weight = 1,
 *                         },
 *                     },
 *                     OriginalDestination = false,
 *                 },
 *             },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
 * 			Name:             pulumi.String("backend-service-health-check"),
 * 			RequestPath:      pulumi.String("/"),
 * 			CheckIntervalSec: pulumi.Int(1),
 * 			TimeoutSec:       pulumi.Int(1),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
 * 			Name:         pulumi.String("my-backend-service"),
 * 			HealthChecks: defaultHttpHealthCheck.ID(),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		defaultGateway, err := networkservices.NewGateway(ctx, "default", &networkservices.GatewayArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Scope:       pulumi.String("my-scope"),
 * 			Type:        pulumi.String("OPEN_MESH"),
 * 			Ports: pulumi.IntArray{
 * 				pulumi.Int(443),
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkservices.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
 * 			Name: pulumi.String("my-tcp-route"),
 * 			Labels: pulumi.StringMap{
 * 				"foo": pulumi.String("bar"),
 * 			},
 * 			Description: pulumi.String("my description"),
 * 			Gateways: pulumi.StringArray{
 * 				defaultGateway.ID(),
 * 			},
 * 			Rules: networkservices.TcpRouteRuleArray{
 * 				&networkservices.TcpRouteRuleArgs{
 * 					Matches: networkservices.TcpRouteRuleMatchArray{
 * 						&networkservices.TcpRouteRuleMatchArgs{
 * 							Address: pulumi.String("10.0.0.1/32"),
 * 							Port:    pulumi.String("8081"),
 * 						},
 * 					},
 * 					Action: &networkservices.TcpRouteRuleActionArgs{
 * 						Destinations: networkservices.TcpRouteRuleActionDestinationArray{
 * 							&networkservices.TcpRouteRuleActionDestinationArgs{
 * 								ServiceName: _default.ID(),
 * 								Weight:      pulumi.Int(1),
 * 							},
 * 						},
 * 						OriginalDestination: pulumi.Bool(false),
 * 					},
 * 				},
 * 			},
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		return nil
 * 	})
 * }
 * ```
 * ```java
 * package generated_program;
 * import com.pulumi.Context;
 * import com.pulumi.Pulumi;
 * import com.pulumi.core.Output;
 * import com.pulumi.gcp.compute.HttpHealthCheck;
 * import com.pulumi.gcp.compute.HttpHealthCheckArgs;
 * import com.pulumi.gcp.compute.BackendService;
 * import com.pulumi.gcp.compute.BackendServiceArgs;
 * import com.pulumi.gcp.networkservices.Gateway;
 * import com.pulumi.gcp.networkservices.GatewayArgs;
 * import com.pulumi.gcp.networkservices.TcpRoute;
 * import com.pulumi.gcp.networkservices.TcpRouteArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
 * import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
 * import java.util.List;
 * import java.util.ArrayList;
 * import java.util.Map;
 * import java.io.File;
 * import java.nio.file.Files;
 * import java.nio.file.Paths;
 * public class App {
 *     public static void main(String[] args) {
 *         Pulumi.run(App::stack);
 *     }
 *     public static void stack(Context ctx) {
 *         var defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
 *             .name("backend-service-health-check")
 *             .requestPath("/")
 *             .checkIntervalSec(1)
 *             .timeoutSec(1)
 *             .build());
 *         var default_ = new BackendService("default", BackendServiceArgs.builder()
 *             .name("my-backend-service")
 *             .healthChecks(defaultHttpHealthCheck.id())
 *             .build());
 *         var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .scope("my-scope")
 *             .type("OPEN_MESH")
 *             .ports(443)
 *             .build());
 *         var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
 *             .name("my-tcp-route")
 *             .labels(Map.of("foo", "bar"))
 *             .description("my description")
 *             .gateways(defaultGateway.id())
 *             .rules(TcpRouteRuleArgs.builder()
 *                 .matches(TcpRouteRuleMatchArgs.builder()
 *                     .address("10.0.0.1/32")
 *                     .port("8081")
 *                     .build())
 *                 .action(TcpRouteRuleActionArgs.builder()
 *                     .destinations(TcpRouteRuleActionDestinationArgs.builder()
 *                         .serviceName(default_.id())
 *                         .weight(1)
 *                         .build())
 *                     .originalDestination(false)
 *                     .build())
 *                 .build())
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:compute:BackendService
 *     properties:
 *       name: my-backend-service
 *       healthChecks: ${defaultHttpHealthCheck.id}
 *   defaultHttpHealthCheck:
 *     type: gcp:compute:HttpHealthCheck
 *     name: default
 *     properties:
 *       name: backend-service-health-check
 *       requestPath: /
 *       checkIntervalSec: 1
 *       timeoutSec: 1
 *   defaultGateway:
 *     type: gcp:networkservices:Gateway
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *       scope: my-scope
 *       type: OPEN_MESH
 *       ports:
 *         - 443
 *   defaultTcpRoute:
 *     type: gcp:networkservices:TcpRoute
 *     name: default
 *     properties:
 *       name: my-tcp-route
 *       labels:
 *         foo: bar
 *       description: my description
 *       gateways:
 *         - ${defaultGateway.id}
 *       rules:
 *         - matches:
 *             - address: 10.0.0.1/32
 *               port: '8081'
 *           action:
 *             destinations:
 *               - serviceName: ${default.id}
 *                 weight: 1
 *             originalDestination: false
 * ```
 * 
 * ## Import
 * TcpRoute can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/tcpRoutes/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, TcpRoute can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkservices/tcpRoute:TcpRoute default projects/{{project}}/locations/global/tcpRoutes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{name}}
 * ```
 * @property description A free-text description of the resource. Max length 1024 characters.
 * @property gateways Gateways defines a list of gateways this TcpRoute 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 labels Set of label tags associated with the TcpRoute 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 meshes Meshes defines a list of meshes this TcpRoute 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/ The attached
 * Mesh should be of a type SIDECAR
 * @property name Name of the TcpRoute resource.
 * @property project
 * @property rules Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
 * If there are multiple rules then the action taken will be the first rule to match.
 * Structure is documented below.
 * */*/
 */
public data class TcpRouteArgs(
    public val description: Output? = null,
    public val gateways: Output>? = null,
    public val labels: 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.gcp.networkservices.TcpRouteArgs =
        com.pulumi.gcp.networkservices.TcpRouteArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .gateways(gateways?.applyValue({ args0 -> args0.map({ args0 -> args0 }) }))
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .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 [TcpRouteArgs].
 */
@PulumiTagMarker
public class TcpRouteArgsBuilder internal constructor() {
    private var description: Output? = null

    private var gateways: Output>? = null

    private var labels: Output>? = null

    private var meshes: Output>? = null

    private var name: Output? = null

    private var project: Output? = null

    private var rules: Output>? = null

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

    /**
     * @param value Gateways defines a list of gateways this TcpRoute 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("hqxxawaotbhmkroe")
    public suspend fun gateways(`value`: Output>) {
        this.gateways = value
    }

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

    /**
     * @param values Gateways defines a list of gateways this TcpRoute 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("qrwsxuxpcdjbkpcd")
    public suspend fun gateways(values: List>) {
        this.gateways = Output.all(values)
    }

    /**
     * @param value Set of label tags associated with the TcpRoute 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("rtjffebfnvnoiiqw")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value Meshes defines a list of meshes this TcpRoute 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/ The attached
     * Mesh should be of a type SIDECAR
     * */
     */
    @JvmName("iefhwxvmyuoueixt")
    public suspend fun meshes(`value`: Output>) {
        this.meshes = value
    }

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

    /**
     * @param values Meshes defines a list of meshes this TcpRoute 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/ The attached
     * Mesh should be of a type SIDECAR
     * */
     */
    @JvmName("atlnlcuhdkrdkmcy")
    public suspend fun meshes(values: List>) {
        this.meshes = Output.all(values)
    }

    /**
     * @param value Name of the TcpRoute resource.
     */
    @JvmName("aqloyqhjtqkxlmdl")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

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

    /**
     * @param value Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("jdnlwycllbsmttyt")
    public suspend fun rules(`value`: Output>) {
        this.rules = value
    }

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

    /**
     * @param values Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("quqekgcxhdwoithp")
    public suspend fun rules(values: List>) {
        this.rules = Output.all(values)
    }

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

    /**
     * @param value Gateways defines a list of gateways this TcpRoute 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("lgbtcuephiipqbyr")
    public suspend fun gateways(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.gateways = mapped
    }

    /**
     * @param values Gateways defines a list of gateways this TcpRoute 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("kfoxbwktbggnlaku")
    public suspend fun gateways(vararg values: String) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.gateways = mapped
    }

    /**
     * @param value Set of label tags associated with the TcpRoute 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("ujqdtbvtiwnnkcey")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values Set of label tags associated with the TcpRoute 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("rpbqnmnkeibuxvae")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value Meshes defines a list of meshes this TcpRoute 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/ The attached
     * Mesh should be of a type SIDECAR
     * */
     */
    @JvmName("hilyhcjohhhefsdg")
    public suspend fun meshes(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.meshes = mapped
    }

    /**
     * @param values Meshes defines a list of meshes this TcpRoute 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/ The attached
     * Mesh should be of a type SIDECAR
     * */
     */
    @JvmName("qpdpivexmxifmcqg")
    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 TcpRoute resource.
     */
    @JvmName("mniqlhipafuweukf")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

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

    /**
     * @param value Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("fkvrgmcnguvbjgbm")
    public suspend fun rules(`value`: List?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    /**
     * @param argument Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("jyfyubpdttvdlurk")
    public suspend fun rules(argument: List Unit>) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("ckujhituvrmbhboq")
    public suspend fun rules(vararg argument: suspend TcpRouteRuleArgsBuilder.() -> Unit) {
        val toBeMapped = argument.toList().map {
            TcpRouteRuleArgsBuilder().applySuspend { it() }.build()
        }
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param argument Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("enldurrpidfahqhv")
    public suspend fun rules(argument: suspend TcpRouteRuleArgsBuilder.() -> Unit) {
        val toBeMapped = listOf(TcpRouteRuleArgsBuilder().applySuspend { argument() }.build())
        val mapped = of(toBeMapped)
        this.rules = mapped
    }

    /**
     * @param values Rules that define how traffic is routed and handled. At least one RouteRule must be supplied.
     * If there are multiple rules then the action taken will be the first rule to match.
     * Structure is documented below.
     */
    @JvmName("sjeedocskyyhoend")
    public suspend fun rules(vararg values: TcpRouteRuleArgs) {
        val toBeMapped = values.toList()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.rules = mapped
    }

    internal fun build(): TcpRouteArgs = TcpRouteArgs(
        description = description,
        gateways = gateways,
        labels = labels,
        meshes = meshes,
        name = name,
        project = project,
        rules = rules,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy