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

com.pulumi.gcp.networkconnectivity.kotlin.PolicyBasedRouteArgs.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.networkconnectivity.kotlin

import com.pulumi.core.Output
import com.pulumi.core.Output.of
import com.pulumi.gcp.networkconnectivity.PolicyBasedRouteArgs.builder
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteFilterArgs
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteFilterArgsBuilder
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteInterconnectAttachmentArgs
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteInterconnectAttachmentArgsBuilder
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteVirtualMachineArgs
import com.pulumi.gcp.networkconnectivity.kotlin.inputs.PolicyBasedRouteVirtualMachineArgsBuilder
import com.pulumi.kotlin.ConvertibleToJava
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.applySuspend
import kotlin.Int
import kotlin.Pair
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.jvm.JvmName

/**
 * Policy-based Routes are more powerful routes that route L4 network traffic based on not just destination IP, but also source IP, protocol and more. A Policy-based Route always take precedence when it conflicts with other types of routes.
 * To get more information about PolicyBasedRoute, see:
 * * [API documentation](https://cloud.google.com/network-connectivity/docs/reference/networkconnectivity/rest/v1/projects.locations.global.policyBasedRoutes)
 * * How-to Guides
 *     * [Use policy-based routes](https://cloud.google.com/vpc/docs/use-policy-based-routes#api)
 * ## Example Usage
 * ### Network Connectivity Policy Based Route Basic
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const myNetwork = new gcp.compute.Network("my_network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * const _default = new gcp.networkconnectivity.PolicyBasedRoute("default", {
 *     name: "my-pbr",
 *     network: myNetwork.id,
 *     filter: {
 *         protocolVersion: "IPV4",
 *     },
 *     nextHopOtherRoutes: "DEFAULT_ROUTING",
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * my_network = gcp.compute.Network("my_network",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * default = gcp.networkconnectivity.PolicyBasedRoute("default",
 *     name="my-pbr",
 *     network=my_network.id,
 *     filter=gcp.networkconnectivity.PolicyBasedRouteFilterArgs(
 *         protocol_version="IPV4",
 *     ),
 *     next_hop_other_routes="DEFAULT_ROUTING")
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var myNetwork = new Gcp.Compute.Network("my_network", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     var @default = new Gcp.NetworkConnectivity.PolicyBasedRoute("default", new()
 *     {
 *         Name = "my-pbr",
 *         Network = myNetwork.Id,
 *         Filter = new Gcp.NetworkConnectivity.Inputs.PolicyBasedRouteFilterArgs
 *         {
 *             ProtocolVersion = "IPV4",
 *         },
 *         NextHopOtherRoutes = "DEFAULT_ROUTING",
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		myNetwork, err := compute.NewNetwork(ctx, "my_network", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewPolicyBasedRoute(ctx, "default", &networkconnectivity.PolicyBasedRouteArgs{
 * 			Name:    pulumi.String("my-pbr"),
 * 			Network: myNetwork.ID(),
 * 			Filter: &networkconnectivity.PolicyBasedRouteFilterArgs{
 * 				ProtocolVersion: pulumi.String("IPV4"),
 * 			},
 * 			NextHopOtherRoutes: pulumi.String("DEFAULT_ROUTING"),
 * 		})
 * 		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.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.networkconnectivity.PolicyBasedRoute;
 * import com.pulumi.gcp.networkconnectivity.PolicyBasedRouteArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.PolicyBasedRouteFilterArgs;
 * 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 myNetwork = new Network("myNetwork", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         var default_ = new PolicyBasedRoute("default", PolicyBasedRouteArgs.builder()
 *             .name("my-pbr")
 *             .network(myNetwork.id())
 *             .filter(PolicyBasedRouteFilterArgs.builder()
 *                 .protocolVersion("IPV4")
 *                 .build())
 *             .nextHopOtherRoutes("DEFAULT_ROUTING")
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networkconnectivity:PolicyBasedRoute
 *     properties:
 *       name: my-pbr
 *       network: ${myNetwork.id}
 *       filter:
 *         protocolVersion: IPV4
 *       nextHopOtherRoutes: DEFAULT_ROUTING
 *   myNetwork:
 *     type: gcp:compute:Network
 *     name: my_network
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 * ```
 * 
 * ### Network Connectivity Policy Based Route Full
 * 
 * ```typescript
 * import * as pulumi from "@pulumi/pulumi";
 * import * as gcp from "@pulumi/gcp";
 * const myNetwork = new gcp.compute.Network("my_network", {
 *     name: "my-network",
 *     autoCreateSubnetworks: false,
 * });
 * // This example substitutes an arbitrary internal IP for an internal network
 * // load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 * // to set one up.
 * const ilb = new gcp.compute.GlobalAddress("ilb", {name: "my-ilb"});
 * const _default = new gcp.networkconnectivity.PolicyBasedRoute("default", {
 *     name: "my-pbr",
 *     description: "My routing policy",
 *     network: myNetwork.id,
 *     priority: 2302,
 *     filter: {
 *         protocolVersion: "IPV4",
 *         ipProtocol: "UDP",
 *         srcRange: "10.0.0.0/24",
 *         destRange: "0.0.0.0/0",
 *     },
 *     nextHopIlbIp: ilb.address,
 *     virtualMachine: {
 *         tags: ["restricted"],
 *     },
 *     labels: {
 *         env: "default",
 *     },
 * });
 * ```
 * ```python
 * import pulumi
 * import pulumi_gcp as gcp
 * my_network = gcp.compute.Network("my_network",
 *     name="my-network",
 *     auto_create_subnetworks=False)
 * # This example substitutes an arbitrary internal IP for an internal network
 * # load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 * # to set one up.
 * ilb = gcp.compute.GlobalAddress("ilb", name="my-ilb")
 * default = gcp.networkconnectivity.PolicyBasedRoute("default",
 *     name="my-pbr",
 *     description="My routing policy",
 *     network=my_network.id,
 *     priority=2302,
 *     filter=gcp.networkconnectivity.PolicyBasedRouteFilterArgs(
 *         protocol_version="IPV4",
 *         ip_protocol="UDP",
 *         src_range="10.0.0.0/24",
 *         dest_range="0.0.0.0/0",
 *     ),
 *     next_hop_ilb_ip=ilb.address,
 *     virtual_machine=gcp.networkconnectivity.PolicyBasedRouteVirtualMachineArgs(
 *         tags=["restricted"],
 *     ),
 *     labels={
 *         "env": "default",
 *     })
 * ```
 * ```csharp
 * using System.Collections.Generic;
 * using System.Linq;
 * using Pulumi;
 * using Gcp = Pulumi.Gcp;
 * return await Deployment.RunAsync(() =>
 * {
 *     var myNetwork = new Gcp.Compute.Network("my_network", new()
 *     {
 *         Name = "my-network",
 *         AutoCreateSubnetworks = false,
 *     });
 *     // This example substitutes an arbitrary internal IP for an internal network
 *     // load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 *     // to set one up.
 *     var ilb = new Gcp.Compute.GlobalAddress("ilb", new()
 *     {
 *         Name = "my-ilb",
 *     });
 *     var @default = new Gcp.NetworkConnectivity.PolicyBasedRoute("default", new()
 *     {
 *         Name = "my-pbr",
 *         Description = "My routing policy",
 *         Network = myNetwork.Id,
 *         Priority = 2302,
 *         Filter = new Gcp.NetworkConnectivity.Inputs.PolicyBasedRouteFilterArgs
 *         {
 *             ProtocolVersion = "IPV4",
 *             IpProtocol = "UDP",
 *             SrcRange = "10.0.0.0/24",
 *             DestRange = "0.0.0.0/0",
 *         },
 *         NextHopIlbIp = ilb.Address,
 *         VirtualMachine = new Gcp.NetworkConnectivity.Inputs.PolicyBasedRouteVirtualMachineArgs
 *         {
 *             Tags = new[]
 *             {
 *                 "restricted",
 *             },
 *         },
 *         Labels =
 *         {
 *             { "env", "default" },
 *         },
 *     });
 * });
 * ```
 * ```go
 * package main
 * import (
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
 * 	"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkconnectivity"
 * 	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
 * )
 * func main() {
 * 	pulumi.Run(func(ctx *pulumi.Context) error {
 * 		myNetwork, err := compute.NewNetwork(ctx, "my_network", &compute.NetworkArgs{
 * 			Name:                  pulumi.String("my-network"),
 * 			AutoCreateSubnetworks: pulumi.Bool(false),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		// This example substitutes an arbitrary internal IP for an internal network
 * 		// load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 * 		// to set one up.
 * 		ilb, err := compute.NewGlobalAddress(ctx, "ilb", &compute.GlobalAddressArgs{
 * 			Name: pulumi.String("my-ilb"),
 * 		})
 * 		if err != nil {
 * 			return err
 * 		}
 * 		_, err = networkconnectivity.NewPolicyBasedRoute(ctx, "default", &networkconnectivity.PolicyBasedRouteArgs{
 * 			Name:        pulumi.String("my-pbr"),
 * 			Description: pulumi.String("My routing policy"),
 * 			Network:     myNetwork.ID(),
 * 			Priority:    pulumi.Int(2302),
 * 			Filter: &networkconnectivity.PolicyBasedRouteFilterArgs{
 * 				ProtocolVersion: pulumi.String("IPV4"),
 * 				IpProtocol:      pulumi.String("UDP"),
 * 				SrcRange:        pulumi.String("10.0.0.0/24"),
 * 				DestRange:       pulumi.String("0.0.0.0/0"),
 * 			},
 * 			NextHopIlbIp: ilb.Address,
 * 			VirtualMachine: &networkconnectivity.PolicyBasedRouteVirtualMachineArgs{
 * 				Tags: pulumi.StringArray{
 * 					pulumi.String("restricted"),
 * 				},
 * 			},
 * 			Labels: pulumi.StringMap{
 * 				"env": pulumi.String("default"),
 * 			},
 * 		})
 * 		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.Network;
 * import com.pulumi.gcp.compute.NetworkArgs;
 * import com.pulumi.gcp.compute.GlobalAddress;
 * import com.pulumi.gcp.compute.GlobalAddressArgs;
 * import com.pulumi.gcp.networkconnectivity.PolicyBasedRoute;
 * import com.pulumi.gcp.networkconnectivity.PolicyBasedRouteArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.PolicyBasedRouteFilterArgs;
 * import com.pulumi.gcp.networkconnectivity.inputs.PolicyBasedRouteVirtualMachineArgs;
 * 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 myNetwork = new Network("myNetwork", NetworkArgs.builder()
 *             .name("my-network")
 *             .autoCreateSubnetworks(false)
 *             .build());
 *         // This example substitutes an arbitrary internal IP for an internal network
 *         // load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 *         // to set one up.
 *         var ilb = new GlobalAddress("ilb", GlobalAddressArgs.builder()
 *             .name("my-ilb")
 *             .build());
 *         var default_ = new PolicyBasedRoute("default", PolicyBasedRouteArgs.builder()
 *             .name("my-pbr")
 *             .description("My routing policy")
 *             .network(myNetwork.id())
 *             .priority(2302)
 *             .filter(PolicyBasedRouteFilterArgs.builder()
 *                 .protocolVersion("IPV4")
 *                 .ipProtocol("UDP")
 *                 .srcRange("10.0.0.0/24")
 *                 .destRange("0.0.0.0/0")
 *                 .build())
 *             .nextHopIlbIp(ilb.address())
 *             .virtualMachine(PolicyBasedRouteVirtualMachineArgs.builder()
 *                 .tags("restricted")
 *                 .build())
 *             .labels(Map.of("env", "default"))
 *             .build());
 *     }
 * }
 * ```
 * ```yaml
 * resources:
 *   default:
 *     type: gcp:networkconnectivity:PolicyBasedRoute
 *     properties:
 *       name: my-pbr
 *       description: My routing policy
 *       network: ${myNetwork.id}
 *       priority: 2302
 *       filter:
 *         protocolVersion: IPV4
 *         ipProtocol: UDP
 *         srcRange: 10.0.0.0/24
 *         destRange: 0.0.0.0/0
 *       nextHopIlbIp: ${ilb.address}
 *       virtualMachine:
 *         tags:
 *           - restricted
 *       labels:
 *         env: default
 *   myNetwork:
 *     type: gcp:compute:Network
 *     name: my_network
 *     properties:
 *       name: my-network
 *       autoCreateSubnetworks: false
 *   # This example substitutes an arbitrary internal IP for an internal network
 *   # load balancer for brevity. Consult https://cloud.google.com/load-balancing/docs/internal
 *   # to set one up.
 *   ilb:
 *     type: gcp:compute:GlobalAddress
 *     properties:
 *       name: my-ilb
 * ```
 * 
 * ## Import
 * PolicyBasedRoute can be imported using any of these accepted formats:
 * * `projects/{{project}}/locations/global/policyBasedRoutes/{{name}}`
 * * `{{project}}/{{name}}`
 * * `{{name}}`
 * When using the `pulumi import` command, PolicyBasedRoute can be imported using one of the formats above. For example:
 * ```sh
 * $ pulumi import gcp:networkconnectivity/policyBasedRoute:PolicyBasedRoute default projects/{{project}}/locations/global/policyBasedRoutes/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/policyBasedRoute:PolicyBasedRoute default {{project}}/{{name}}
 * ```
 * ```sh
 * $ pulumi import gcp:networkconnectivity/policyBasedRoute:PolicyBasedRoute default {{name}}
 * ```
 * @property description An optional description of this resource.
 * @property filter The filter to match L4 traffic.
 * Structure is documented below.
 * @property interconnectAttachment The interconnect attachments that this policy-based route applies to.
 * @property labels User-defined labels. **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 name The name of the policy based route.
 * @property network Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
 * @property nextHopIlbIp The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets.
 * @property nextHopOtherRoutes Other routes that will be referenced to determine the next hop of the packet. Possible values: ["DEFAULT_ROUTING"]
 * @property priority The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching
 * policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered
 * priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive.
 * @property project
 * @property virtualMachine VM instances to which this policy-based route applies to.
 */
public data class PolicyBasedRouteArgs(
    public val description: Output? = null,
    public val filter: Output? = null,
    public val interconnectAttachment: Output? = null,
    public val labels: Output>? = null,
    public val name: Output? = null,
    public val network: Output? = null,
    public val nextHopIlbIp: Output? = null,
    public val nextHopOtherRoutes: Output? = null,
    public val priority: Output? = null,
    public val project: Output? = null,
    public val virtualMachine: Output? = null,
) : ConvertibleToJava {
    override fun toJava(): com.pulumi.gcp.networkconnectivity.PolicyBasedRouteArgs =
        com.pulumi.gcp.networkconnectivity.PolicyBasedRouteArgs.builder()
            .description(description?.applyValue({ args0 -> args0 }))
            .filter(filter?.applyValue({ args0 -> args0.let({ args0 -> args0.toJava() }) }))
            .interconnectAttachment(
                interconnectAttachment?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            )
            .labels(labels?.applyValue({ args0 -> args0.map({ args0 -> args0.key.to(args0.value) }).toMap() }))
            .name(name?.applyValue({ args0 -> args0 }))
            .network(network?.applyValue({ args0 -> args0 }))
            .nextHopIlbIp(nextHopIlbIp?.applyValue({ args0 -> args0 }))
            .nextHopOtherRoutes(nextHopOtherRoutes?.applyValue({ args0 -> args0 }))
            .priority(priority?.applyValue({ args0 -> args0 }))
            .project(project?.applyValue({ args0 -> args0 }))
            .virtualMachine(
                virtualMachine?.applyValue({ args0 ->
                    args0.let({ args0 ->
                        args0.toJava()
                    })
                }),
            ).build()
}

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

    private var filter: Output? = null

    private var interconnectAttachment: Output? = null

    private var labels: Output>? = null

    private var name: Output? = null

    private var network: Output? = null

    private var nextHopIlbIp: Output? = null

    private var nextHopOtherRoutes: Output? = null

    private var priority: Output? = null

    private var project: Output? = null

    private var virtualMachine: Output? = null

    /**
     * @param value An optional description of this resource.
     */
    @JvmName("gubxfgwaowqbyqgl")
    public suspend fun description(`value`: Output) {
        this.description = value
    }

    /**
     * @param value The filter to match L4 traffic.
     * Structure is documented below.
     */
    @JvmName("eqbbyejgcrlnufxr")
    public suspend fun filter(`value`: Output) {
        this.filter = value
    }

    /**
     * @param value The interconnect attachments that this policy-based route applies to.
     */
    @JvmName("dqscxskfaexqtedv")
    public suspend fun interconnectAttachment(`value`: Output) {
        this.interconnectAttachment = value
    }

    /**
     * @param value User-defined labels. **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("jugtwxqlqukhyebt")
    public suspend fun labels(`value`: Output>) {
        this.labels = value
    }

    /**
     * @param value The name of the policy based route.
     */
    @JvmName("pfjlcqlmxbtqddfr")
    public suspend fun name(`value`: Output) {
        this.name = value
    }

    /**
     * @param value Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
     */
    @JvmName("msmfyxxnoumpyxpf")
    public suspend fun network(`value`: Output) {
        this.network = value
    }

    /**
     * @param value The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets.
     */
    @JvmName("ceffcpuujolwlmxf")
    public suspend fun nextHopIlbIp(`value`: Output) {
        this.nextHopIlbIp = value
    }

    /**
     * @param value Other routes that will be referenced to determine the next hop of the packet. Possible values: ["DEFAULT_ROUTING"]
     */
    @JvmName("vymvfkglnfoirhfk")
    public suspend fun nextHopOtherRoutes(`value`: Output) {
        this.nextHopOtherRoutes = value
    }

    /**
     * @param value The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching
     * policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered
     * priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive.
     */
    @JvmName("xuvndylkywxxbtqm")
    public suspend fun priority(`value`: Output) {
        this.priority = value
    }

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

    /**
     * @param value VM instances to which this policy-based route applies to.
     */
    @JvmName("mqxnfqehqyuchccj")
    public suspend fun virtualMachine(`value`: Output) {
        this.virtualMachine = value
    }

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

    /**
     * @param value The filter to match L4 traffic.
     * Structure is documented below.
     */
    @JvmName("liaqwfujdaehdgil")
    public suspend fun filter(`value`: PolicyBasedRouteFilterArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.filter = mapped
    }

    /**
     * @param argument The filter to match L4 traffic.
     * Structure is documented below.
     */
    @JvmName("sxssiwjfmsmkicmi")
    public suspend fun filter(argument: suspend PolicyBasedRouteFilterArgsBuilder.() -> Unit) {
        val toBeMapped = PolicyBasedRouteFilterArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.filter = mapped
    }

    /**
     * @param value The interconnect attachments that this policy-based route applies to.
     */
    @JvmName("maxltsrafgqyynme")
    public suspend fun interconnectAttachment(`value`: PolicyBasedRouteInterconnectAttachmentArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.interconnectAttachment = mapped
    }

    /**
     * @param argument The interconnect attachments that this policy-based route applies to.
     */
    @JvmName("svujnqqadobhbpqi")
    public suspend fun interconnectAttachment(argument: suspend PolicyBasedRouteInterconnectAttachmentArgsBuilder.() -> Unit) {
        val toBeMapped = PolicyBasedRouteInterconnectAttachmentArgsBuilder().applySuspend {
            argument()
        }.build()
        val mapped = of(toBeMapped)
        this.interconnectAttachment = mapped
    }

    /**
     * @param value User-defined labels. **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("duiwmucauaxubxng")
    public suspend fun labels(`value`: Map?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param values User-defined labels. **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("xjtqodyegagysbjd")
    public fun labels(vararg values: Pair) {
        val toBeMapped = values.toMap()
        val mapped = toBeMapped.let({ args0 -> of(args0) })
        this.labels = mapped
    }

    /**
     * @param value The name of the policy based route.
     */
    @JvmName("vjyajxamqmujcebh")
    public suspend fun name(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.name = mapped
    }

    /**
     * @param value Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
     */
    @JvmName("nqobglexsjkgytwr")
    public suspend fun network(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.network = mapped
    }

    /**
     * @param value The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets.
     */
    @JvmName("xaolishdmuwcdhey")
    public suspend fun nextHopIlbIp(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nextHopIlbIp = mapped
    }

    /**
     * @param value Other routes that will be referenced to determine the next hop of the packet. Possible values: ["DEFAULT_ROUTING"]
     */
    @JvmName("xhqvqghwnqxyxmhu")
    public suspend fun nextHopOtherRoutes(`value`: String?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.nextHopOtherRoutes = mapped
    }

    /**
     * @param value The priority of this policy-based route. Priority is used to break ties in cases where there are more than one matching
     * policy-based routes found. In cases where multiple policy-based routes are matched, the one with the lowest-numbered
     * priority value wins. The default value is 1000. The priority value must be from 1 to 65535, inclusive.
     */
    @JvmName("umdyofhlmxgcqqrc")
    public suspend fun priority(`value`: Int?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.priority = mapped
    }

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

    /**
     * @param value VM instances to which this policy-based route applies to.
     */
    @JvmName("xwnglugrnnsfpfgw")
    public suspend fun virtualMachine(`value`: PolicyBasedRouteVirtualMachineArgs?) {
        val toBeMapped = value
        val mapped = toBeMapped?.let({ args0 -> of(args0) })
        this.virtualMachine = mapped
    }

    /**
     * @param argument VM instances to which this policy-based route applies to.
     */
    @JvmName("mxkmgurachyjvkpx")
    public suspend fun virtualMachine(argument: suspend PolicyBasedRouteVirtualMachineArgsBuilder.() -> Unit) {
        val toBeMapped = PolicyBasedRouteVirtualMachineArgsBuilder().applySuspend { argument() }.build()
        val mapped = of(toBeMapped)
        this.virtualMachine = mapped
    }

    internal fun build(): PolicyBasedRouteArgs = PolicyBasedRouteArgs(
        description = description,
        filter = filter,
        interconnectAttachment = interconnectAttachment,
        labels = labels,
        name = name,
        network = network,
        nextHopIlbIp = nextHopIlbIp,
        nextHopOtherRoutes = nextHopOtherRoutes,
        priority = priority,
        project = project,
        virtualMachine = virtualMachine,
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy