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

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

package com.pulumi.gcp.networkconnectivity.kotlin

import com.pulumi.core.Output
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteFilter
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteInterconnectAttachment
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteVirtualMachine
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteWarning
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteFilter.Companion.toKotlin as policyBasedRouteFilterToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteInterconnectAttachment.Companion.toKotlin as policyBasedRouteInterconnectAttachmentToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteVirtualMachine.Companion.toKotlin as policyBasedRouteVirtualMachineToKotlin
import com.pulumi.gcp.networkconnectivity.kotlin.outputs.PolicyBasedRouteWarning.Companion.toKotlin as policyBasedRouteWarningToKotlin

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

    public var args: PolicyBasedRouteArgs = PolicyBasedRouteArgs()

    public var opts: CustomResourceOptions = CustomResourceOptions()

    /**
     * @param name The _unique_ name of the resulting resource.
     */
    public fun name(`value`: String) {
        this.name = value
    }

    /**
     * @param block The arguments to use to populate this resource's properties.
     */
    public suspend fun args(block: suspend PolicyBasedRouteArgsBuilder.() -> Unit) {
        val builder = PolicyBasedRouteArgsBuilder()
        block(builder)
        this.args = builder.build()
    }

    /**
     * @param block A bag of options that control this resource's behavior.
     */
    public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
        this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
    }

    internal fun build(): PolicyBasedRoute {
        val builtJavaResource =
            com.pulumi.gcp.networkconnectivity.PolicyBasedRoute(
                this.name,
                this.args.toJava(),
                this.opts.toJava(),
            )
        return PolicyBasedRoute(builtJavaResource)
    }
}

/**
 * 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}}
 * ```
 */
public class PolicyBasedRoute internal constructor(
    override val javaResource: com.pulumi.gcp.networkconnectivity.PolicyBasedRoute,
) : KotlinCustomResource(javaResource, PolicyBasedRouteMapper) {
    /**
     * Time when the policy-based route was created.
     */
    public val createTime: Output
        get() = javaResource.createTime().applyValue({ args0 -> args0 })

    /**
     * An optional description of this resource.
     */
    public val description: Output?
        get() = javaResource.description().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

    /**
     * The filter to match L4 traffic.
     * Structure is documented below.
     */
    public val filter: Output
        get() = javaResource.filter().applyValue({ args0 ->
            args0.let({ args0 ->
                policyBasedRouteFilterToKotlin(args0)
            })
        })

    /**
     * The interconnect attachments that this policy-based route applies to.
     */
    public val interconnectAttachment: Output?
        get() = javaResource.interconnectAttachment().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> policyBasedRouteInterconnectAttachmentToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * Type of this resource.
     */
    public val kind: Output
        get() = javaResource.kind().applyValue({ args0 -> args0 })

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

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

    /**
     * Fully-qualified URL of the network that this route applies to, for example: projects/my-project/global/networks/my-network.
     */
    public val network: Output
        get() = javaResource.network().applyValue({ args0 -> args0 })

    /**
     * The IP address of a global-access-enabled L4 ILB that is the next hop for matching packets.
     */
    public val nextHopIlbIp: Output?
        get() = javaResource.nextHopIlbIp().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

    /**
     * Other routes that will be referenced to determine the next hop of the packet. Possible values: ["DEFAULT_ROUTING"]
     */
    public val nextHopOtherRoutes: Output?
        get() = javaResource.nextHopOtherRoutes().applyValue({ args0 ->
            args0.map({ args0 ->
                args0
            }).orElse(null)
        })

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

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

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

    /**
     * Time when the policy-based route was created.
     */
    public val updateTime: Output
        get() = javaResource.updateTime().applyValue({ args0 -> args0 })

    /**
     * VM instances to which this policy-based route applies to.
     */
    public val virtualMachine: Output?
        get() = javaResource.virtualMachine().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 -> policyBasedRouteVirtualMachineToKotlin(args0) })
            }).orElse(null)
        })

    /**
     * If potential misconfigurations are detected for this route, this field will be populated with warning messages.
     * Structure is documented below.
     */
    public val warnings: Output>
        get() = javaResource.warnings().applyValue({ args0 ->
            args0.map({ args0 ->
                args0.let({ args0 ->
                    policyBasedRouteWarningToKotlin(args0)
                })
            })
        })
}

public object PolicyBasedRouteMapper : ResourceMapper {
    override fun supportsMappingOfType(javaResource: Resource): Boolean =
        com.pulumi.gcp.networkconnectivity.PolicyBasedRoute::class == javaResource::class

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy