import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * GrpcRoute is the resource defining how gRPC traffic routed by a Mesh or Gateway resource is routed. * * To get more information about GrpcRoute, see: * * * [API documentation](https://cloud.google.com/traffic-director/docs/reference/network-services/rest/v1beta1/projects.locations.grpcRoutes) * * ## Example Usage * * ### Network Services Grpc Route Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networkservices.GrpcRoute("default", { * name: "my-grpc-route", * labels: { * foo: "bar", * }, * description: "my description", * hostnames: ["example"], * rules: [{ * matches: [{ * headers: [{ * key: "key", * value: "value", * }], * }], * action: { * retryPolicy: { * retryConditions: ["cancelled"], * numRetries: 1, * }, * }, * }], * }); * ``` * ### Network Services Grpc Route Matches And Actions * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networkservices.GrpcRoute("default", { * name: "my-grpc-route", * labels: { * foo: "bar", * }, * description: "my description", * hostnames: ["example"], * rules: [{ * matches: [ * { * headers: [{ * key: "key", * value: "value", * }], * }, * { * headers: [{ * key: "key", * value: "value", * }], * method: { * grpcService: "foo", * grpcMethod: "bar", * caseSensitive: true, * }, * }, * ], * action: { * faultInjectionPolicy: { * delay: { * fixedDelay: "1s", * percentage: 1, * }, * abort: { * httpStatus: 500, * percentage: 1, * }, * }, * retryPolicy: { * retryConditions: ["cancelled"], * numRetries: 1, * }, * }, * }], * }); * ``` * ### Network Services Grpc Route Actions * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networkservices.GrpcRoute("default", { * name: "my-grpc-route", * labels: { * foo: "bar", * }, * description: "my description", * hostnames: ["example"], * rules: [{ * action: { * faultInjectionPolicy: { * delay: { * fixedDelay: "1s", * percentage: 1, * }, * abort: { * httpStatus: 500, * percentage: 1, * }, * }, * retryPolicy: { * retryConditions: ["cancelled"], * numRetries: 1, * }, * }, * }], * }); * ``` * ### Network Services Grpc Route Location * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const _default = new gcp.networkservices.GrpcRoute("default", { * name: "my-grpc-route", * location: "global", * hostnames: ["example"], * rules: [{ * matches: [{ * headers: [{ * key: "key", * value: "value", * }], * }], * action: { * retryPolicy: { * retryConditions: ["cancelled"], * numRetries: 1, * }, * }, * }], * }); * ``` * * ## Import * * GrpcRoute can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/grpcRoutes/{{name}}` * * `{{project}}/{{location}}/{{name}}` * * `{{location}}/{{name}}` * * When using the `pulumi import` command, GrpcRoute can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default projects/{{project}}/locations/{{location}}/grpcRoutes/{{name}} * $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default {{project}}/{{location}}/{{name}} * $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default {{location}}/{{name}} * ``` */ export declare class GrpcRoute extends pulumi.CustomResource { /** * Get an existing GrpcRoute 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?: GrpcRouteState, opts?: pulumi.CustomResourceOptions): GrpcRoute; /** * Returns true if the given object is an instance of GrpcRoute. 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 GrpcRoute; /** * Time the GrpcRoute 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; }>; /** * List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. */ readonly gateways: pulumi.Output; /** * Required. Service hostnames with an optional port for which this route describes traffic. */ readonly hostnames: pulumi.Output; /** * Set of label tags associated with the GrpcRoute 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>; /** * Location (region) of the GRPCRoute resource to be created. Only the value 'global' is currently allowed; defaults to 'global' if omitted. */ readonly location: pulumi.Output; /** * List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. */ readonly meshes: pulumi.Output; /** * Name of the GrpcRoute 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. * Structure is documented below. */ readonly rules: pulumi.Output; /** * Server-defined URL of this resource. */ readonly selfLink: pulumi.Output; /** * Time the GrpcRoute was updated in UTC. */ readonly updateTime: pulumi.Output; /** * Create a GrpcRoute 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: GrpcRouteArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering GrpcRoute resources. */ export interface GrpcRouteState { /** * Time the GrpcRoute 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; }>; /** * List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. */ gateways?: pulumi.Input[]>; /** * Required. Service hostnames with an optional port for which this route describes traffic. */ hostnames?: pulumi.Input[]>; /** * Set of label tags associated with the GrpcRoute 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; }>; /** * Location (region) of the GRPCRoute resource to be created. Only the value 'global' is currently allowed; defaults to 'global' if omitted. */ location?: pulumi.Input; /** * List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. */ meshes?: pulumi.Input[]>; /** * Name of the GrpcRoute 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. * Structure is documented below. */ rules?: pulumi.Input[]>; /** * Server-defined URL of this resource. */ selfLink?: pulumi.Input; /** * Time the GrpcRoute was updated in UTC. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a GrpcRoute resource. */ export interface GrpcRouteArgs { /** * A free-text description of the resource. Max length 1024 characters. */ description?: pulumi.Input; /** * List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway. */ gateways?: pulumi.Input[]>; /** * Required. Service hostnames with an optional port for which this route describes traffic. */ hostnames: pulumi.Input[]>; /** * Set of label tags associated with the GrpcRoute 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; }>; /** * Location (region) of the GRPCRoute resource to be created. Only the value 'global' is currently allowed; defaults to 'global' if omitted. */ location?: pulumi.Input; /** * List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh. */ meshes?: pulumi.Input[]>; /** * Name of the GrpcRoute 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. * Structure is documented below. */ rules: pulumi.Input[]>; }