import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * TcpRoute is the resource defining how TCP traffic should be routed by a Mesh/Gateway resource. * * To get more information about TcpRoute, see: * * * [API documentation](https://cloud.google.com/traffic-director/docs/reference/network-services/rest/v1beta1/projects.locations.tcpRoutes) * * How-to Guides * * [Setup TCP Services](https://cloud.google.com/traffic-director/docs/set-up-tcp-route) * * ## 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, * }, * }], * }); * ``` * ### 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, * idleTimeout: "60s", * }, * }], * }); * ``` * ### 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, * }, * }], * }); * ``` * ### 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, * }, * }], * }); * ``` * * ## 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}} * $ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{project}}/{{name}} * $ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{name}} * ``` */ export declare class TcpRoute extends pulumi.CustomResource { /** * Get an existing TcpRoute resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: TcpRouteState, opts?: pulumi.CustomResourceOptions): TcpRoute; /** * Returns true if the given object is an instance of TcpRoute. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is TcpRoute; /** * Time the TcpRoute was created in UTC. */ readonly createTime: pulumi.Output; /** * A free-text description of the resource. Max length 1024 characters. */ readonly description: pulumi.Output; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * 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/ */ readonly gateways: pulumi.Output; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * 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 */ readonly meshes: pulumi.Output; /** * Name of the TcpRoute resource. */ readonly name: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * 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. */ readonly rules: pulumi.Output; /** * Server-defined URL of this resource. */ readonly selfLink: pulumi.Output; /** * Time the TcpRoute was updated in UTC. */ readonly updateTime: pulumi.Output; /** * Create a TcpRoute resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: TcpRouteArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering TcpRoute resources. */ export interface TcpRouteState { /** * Time the TcpRoute was created in UTC. */ createTime?: pulumi.Input; /** * A free-text description of the resource. Max length 1024 characters. */ description?: pulumi.Input; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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/ */ gateways?: pulumi.Input[]>; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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 */ meshes?: pulumi.Input[]>; /** * Name of the TcpRoute resource. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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. */ rules?: pulumi.Input[]>; /** * Server-defined URL of this resource. */ selfLink?: pulumi.Input; /** * Time the TcpRoute was updated in UTC. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a TcpRoute resource. */ export interface TcpRouteArgs { /** * A free-text description of the resource. Max length 1024 characters. */ description?: pulumi.Input; /** * 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/ */ gateways?: pulumi.Input[]>; /** * 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 `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * 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 */ meshes?: pulumi.Input[]>; /** * Name of the TcpRoute resource. */ name?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * 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. */ rules: pulumi.Input[]>; }