1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. networkservices
  5. GrpcRoute
Google Cloud Classic v7.21.0 published on Friday, May 3, 2024 by Pulumi

gcp.networkservices.GrpcRoute

Explore with Pulumi AI

gcp logo
Google Cloud Classic v7.21.0 published on Friday, May 3, 2024 by Pulumi

    Example Usage

    Network Services Grpc Route Basic

    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,
                },
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networkservices.GrpcRoute("default",
        name="my-grpc-route",
        labels={
            "foo": "bar",
        },
        description="my description",
        hostnames=["example"],
        rules=[gcp.networkservices.GrpcRouteRuleArgs(
            matches=[gcp.networkservices.GrpcRouteRuleMatchArgs(
                headers=[gcp.networkservices.GrpcRouteRuleMatchHeaderArgs(
                    key="key",
                    value="value",
                )],
            )],
            action=gcp.networkservices.GrpcRouteRuleActionArgs(
                retry_policy=gcp.networkservices.GrpcRouteRuleActionRetryPolicyArgs(
                    retry_conditions=["cancelled"],
                    num_retries=1,
                ),
            ),
        )])
    
    package main
    
    import (
    	"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 {
    		_, err := networkservices.NewGrpcRoute(ctx, "default", &networkservices.GrpcRouteArgs{
    			Name: pulumi.String("my-grpc-route"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Hostnames: pulumi.StringArray{
    				pulumi.String("example"),
    			},
    			Rules: networkservices.GrpcRouteRuleArray{
    				&networkservices.GrpcRouteRuleArgs{
    					Matches: networkservices.GrpcRouteRuleMatchArray{
    						&networkservices.GrpcRouteRuleMatchArgs{
    							Headers: networkservices.GrpcRouteRuleMatchHeaderArray{
    								&networkservices.GrpcRouteRuleMatchHeaderArgs{
    									Key:   pulumi.String("key"),
    									Value: pulumi.String("value"),
    								},
    							},
    						},
    					},
    					Action: &networkservices.GrpcRouteRuleActionArgs{
    						RetryPolicy: &networkservices.GrpcRouteRuleActionRetryPolicyArgs{
    							RetryConditions: pulumi.StringArray{
    								pulumi.String("cancelled"),
    							},
    							NumRetries: pulumi.Int(1),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.NetworkServices.GrpcRoute("default", new()
        {
            Name = "my-grpc-route",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Hostnames = new[]
            {
                "example",
            },
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.GrpcRouteRuleArgs
                {
                    Matches = new[]
                    {
                        new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchArgs
                        {
                            Headers = new[]
                            {
                                new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchHeaderArgs
                                {
                                    Key = "key",
                                    Value = "value",
                                },
                            },
                        },
                    },
                    Action = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionArgs
                    {
                        RetryPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionRetryPolicyArgs
                        {
                            RetryConditions = new[]
                            {
                                "cancelled",
                            },
                            NumRetries = 1,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networkservices.GrpcRoute;
    import com.pulumi.gcp.networkservices.GrpcRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionRetryPolicyArgs;
    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 default_ = new GrpcRoute("default", GrpcRouteArgs.builder()        
                .name("my-grpc-route")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .hostnames("example")
                .rules(GrpcRouteRuleArgs.builder()
                    .matches(GrpcRouteRuleMatchArgs.builder()
                        .headers(GrpcRouteRuleMatchHeaderArgs.builder()
                            .key("key")
                            .value("value")
                            .build())
                        .build())
                    .action(GrpcRouteRuleActionArgs.builder()
                        .retryPolicy(GrpcRouteRuleActionRetryPolicyArgs.builder()
                            .retryConditions("cancelled")
                            .numRetries(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:networkservices:GrpcRoute
        properties:
          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

    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,
                },
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networkservices.GrpcRoute("default",
        name="my-grpc-route",
        labels={
            "foo": "bar",
        },
        description="my description",
        hostnames=["example"],
        rules=[gcp.networkservices.GrpcRouteRuleArgs(
            matches=[
                gcp.networkservices.GrpcRouteRuleMatchArgs(
                    headers=[gcp.networkservices.GrpcRouteRuleMatchHeaderArgs(
                        key="key",
                        value="value",
                    )],
                ),
                gcp.networkservices.GrpcRouteRuleMatchArgs(
                    headers=[gcp.networkservices.GrpcRouteRuleMatchHeaderArgs(
                        key="key",
                        value="value",
                    )],
                    method=gcp.networkservices.GrpcRouteRuleMatchMethodArgs(
                        grpc_service="foo",
                        grpc_method="bar",
                        case_sensitive=True,
                    ),
                ),
            ],
            action=gcp.networkservices.GrpcRouteRuleActionArgs(
                fault_injection_policy=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs(
                    delay=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs(
                        fixed_delay="1s",
                        percentage=1,
                    ),
                    abort=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs(
                        http_status=500,
                        percentage=1,
                    ),
                ),
                retry_policy=gcp.networkservices.GrpcRouteRuleActionRetryPolicyArgs(
                    retry_conditions=["cancelled"],
                    num_retries=1,
                ),
            ),
        )])
    
    package main
    
    import (
    	"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 {
    		_, err := networkservices.NewGrpcRoute(ctx, "default", &networkservices.GrpcRouteArgs{
    			Name: pulumi.String("my-grpc-route"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Hostnames: pulumi.StringArray{
    				pulumi.String("example"),
    			},
    			Rules: networkservices.GrpcRouteRuleArray{
    				&networkservices.GrpcRouteRuleArgs{
    					Matches: networkservices.GrpcRouteRuleMatchArray{
    						&networkservices.GrpcRouteRuleMatchArgs{
    							Headers: networkservices.GrpcRouteRuleMatchHeaderArray{
    								&networkservices.GrpcRouteRuleMatchHeaderArgs{
    									Key:   pulumi.String("key"),
    									Value: pulumi.String("value"),
    								},
    							},
    						},
    						&networkservices.GrpcRouteRuleMatchArgs{
    							Headers: networkservices.GrpcRouteRuleMatchHeaderArray{
    								&networkservices.GrpcRouteRuleMatchHeaderArgs{
    									Key:   pulumi.String("key"),
    									Value: pulumi.String("value"),
    								},
    							},
    							Method: &networkservices.GrpcRouteRuleMatchMethodArgs{
    								GrpcService:   pulumi.String("foo"),
    								GrpcMethod:    pulumi.String("bar"),
    								CaseSensitive: pulumi.Bool(true),
    							},
    						},
    					},
    					Action: &networkservices.GrpcRouteRuleActionArgs{
    						FaultInjectionPolicy: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs{
    							Delay: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs{
    								FixedDelay: pulumi.String("1s"),
    								Percentage: pulumi.Int(1),
    							},
    							Abort: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs{
    								HttpStatus: pulumi.Int(500),
    								Percentage: pulumi.Int(1),
    							},
    						},
    						RetryPolicy: &networkservices.GrpcRouteRuleActionRetryPolicyArgs{
    							RetryConditions: pulumi.StringArray{
    								pulumi.String("cancelled"),
    							},
    							NumRetries: pulumi.Int(1),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.NetworkServices.GrpcRoute("default", new()
        {
            Name = "my-grpc-route",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Hostnames = new[]
            {
                "example",
            },
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.GrpcRouteRuleArgs
                {
                    Matches = new[]
                    {
                        new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchArgs
                        {
                            Headers = new[]
                            {
                                new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchHeaderArgs
                                {
                                    Key = "key",
                                    Value = "value",
                                },
                            },
                        },
                        new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchArgs
                        {
                            Headers = new[]
                            {
                                new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchHeaderArgs
                                {
                                    Key = "key",
                                    Value = "value",
                                },
                            },
                            Method = new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchMethodArgs
                            {
                                GrpcService = "foo",
                                GrpcMethod = "bar",
                                CaseSensitive = true,
                            },
                        },
                    },
                    Action = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionArgs
                    {
                        FaultInjectionPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyArgs
                        {
                            Delay = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs
                            {
                                FixedDelay = "1s",
                                Percentage = 1,
                            },
                            Abort = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs
                            {
                                HttpStatus = 500,
                                Percentage = 1,
                            },
                        },
                        RetryPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionRetryPolicyArgs
                        {
                            RetryConditions = new[]
                            {
                                "cancelled",
                            },
                            NumRetries = 1,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networkservices.GrpcRoute;
    import com.pulumi.gcp.networkservices.GrpcRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionRetryPolicyArgs;
    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 default_ = new GrpcRoute("default", GrpcRouteArgs.builder()        
                .name("my-grpc-route")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .hostnames("example")
                .rules(GrpcRouteRuleArgs.builder()
                    .matches(                
                        GrpcRouteRuleMatchArgs.builder()
                            .headers(GrpcRouteRuleMatchHeaderArgs.builder()
                                .key("key")
                                .value("value")
                                .build())
                            .build(),
                        GrpcRouteRuleMatchArgs.builder()
                            .headers(GrpcRouteRuleMatchHeaderArgs.builder()
                                .key("key")
                                .value("value")
                                .build())
                            .method(GrpcRouteRuleMatchMethodArgs.builder()
                                .grpcService("foo")
                                .grpcMethod("bar")
                                .caseSensitive(true)
                                .build())
                            .build())
                    .action(GrpcRouteRuleActionArgs.builder()
                        .faultInjectionPolicy(GrpcRouteRuleActionFaultInjectionPolicyArgs.builder()
                            .delay(GrpcRouteRuleActionFaultInjectionPolicyDelayArgs.builder()
                                .fixedDelay("1s")
                                .percentage(1)
                                .build())
                            .abort(GrpcRouteRuleActionFaultInjectionPolicyAbortArgs.builder()
                                .httpStatus(500)
                                .percentage(1)
                                .build())
                            .build())
                        .retryPolicy(GrpcRouteRuleActionRetryPolicyArgs.builder()
                            .retryConditions("cancelled")
                            .numRetries(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:networkservices:GrpcRoute
        properties:
          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

    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,
                },
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default = gcp.networkservices.GrpcRoute("default",
        name="my-grpc-route",
        labels={
            "foo": "bar",
        },
        description="my description",
        hostnames=["example"],
        rules=[gcp.networkservices.GrpcRouteRuleArgs(
            action=gcp.networkservices.GrpcRouteRuleActionArgs(
                fault_injection_policy=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs(
                    delay=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs(
                        fixed_delay="1s",
                        percentage=1,
                    ),
                    abort=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs(
                        http_status=500,
                        percentage=1,
                    ),
                ),
                retry_policy=gcp.networkservices.GrpcRouteRuleActionRetryPolicyArgs(
                    retry_conditions=["cancelled"],
                    num_retries=1,
                ),
            ),
        )])
    
    package main
    
    import (
    	"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 {
    		_, err := networkservices.NewGrpcRoute(ctx, "default", &networkservices.GrpcRouteArgs{
    			Name: pulumi.String("my-grpc-route"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Hostnames: pulumi.StringArray{
    				pulumi.String("example"),
    			},
    			Rules: networkservices.GrpcRouteRuleArray{
    				&networkservices.GrpcRouteRuleArgs{
    					Action: &networkservices.GrpcRouteRuleActionArgs{
    						FaultInjectionPolicy: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs{
    							Delay: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs{
    								FixedDelay: pulumi.String("1s"),
    								Percentage: pulumi.Int(1),
    							},
    							Abort: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs{
    								HttpStatus: pulumi.Int(500),
    								Percentage: pulumi.Int(1),
    							},
    						},
    						RetryPolicy: &networkservices.GrpcRouteRuleActionRetryPolicyArgs{
    							RetryConditions: pulumi.StringArray{
    								pulumi.String("cancelled"),
    							},
    							NumRetries: pulumi.Int(1),
    						},
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var @default = new Gcp.NetworkServices.GrpcRoute("default", new()
        {
            Name = "my-grpc-route",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Hostnames = new[]
            {
                "example",
            },
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.GrpcRouteRuleArgs
                {
                    Action = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionArgs
                    {
                        FaultInjectionPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyArgs
                        {
                            Delay = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs
                            {
                                FixedDelay = "1s",
                                Percentage = 1,
                            },
                            Abort = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs
                            {
                                HttpStatus = 500,
                                Percentage = 1,
                            },
                        },
                        RetryPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionRetryPolicyArgs
                        {
                            RetryConditions = new[]
                            {
                                "cancelled",
                            },
                            NumRetries = 1,
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.networkservices.GrpcRoute;
    import com.pulumi.gcp.networkservices.GrpcRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs;
    import com.pulumi.gcp.networkservices.inputs.GrpcRouteRuleActionRetryPolicyArgs;
    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 default_ = new GrpcRoute("default", GrpcRouteArgs.builder()        
                .name("my-grpc-route")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .hostnames("example")
                .rules(GrpcRouteRuleArgs.builder()
                    .action(GrpcRouteRuleActionArgs.builder()
                        .faultInjectionPolicy(GrpcRouteRuleActionFaultInjectionPolicyArgs.builder()
                            .delay(GrpcRouteRuleActionFaultInjectionPolicyDelayArgs.builder()
                                .fixedDelay("1s")
                                .percentage(1)
                                .build())
                            .abort(GrpcRouteRuleActionFaultInjectionPolicyAbortArgs.builder()
                                .httpStatus(500)
                                .percentage(1)
                                .build())
                            .build())
                        .retryPolicy(GrpcRouteRuleActionRetryPolicyArgs.builder()
                            .retryConditions("cancelled")
                            .numRetries(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:networkservices:GrpcRoute
        properties:
          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
    

    Create GrpcRoute Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new GrpcRoute(name: string, args: GrpcRouteArgs, opts?: CustomResourceOptions);
    @overload
    def GrpcRoute(resource_name: str,
                  args: GrpcRouteArgs,
                  opts: Optional[ResourceOptions] = None)
    
    @overload
    def GrpcRoute(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  hostnames: Optional[Sequence[str]] = None,
                  rules: Optional[Sequence[GrpcRouteRuleArgs]] = None,
                  description: Optional[str] = None,
                  gateways: Optional[Sequence[str]] = None,
                  labels: Optional[Mapping[str, str]] = None,
                  meshes: Optional[Sequence[str]] = None,
                  name: Optional[str] = None,
                  project: Optional[str] = None)
    func NewGrpcRoute(ctx *Context, name string, args GrpcRouteArgs, opts ...ResourceOption) (*GrpcRoute, error)
    public GrpcRoute(string name, GrpcRouteArgs args, CustomResourceOptions? opts = null)
    public GrpcRoute(String name, GrpcRouteArgs args)
    public GrpcRoute(String name, GrpcRouteArgs args, CustomResourceOptions options)
    
    type: gcp:networkservices:GrpcRoute
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args GrpcRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args GrpcRouteArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args GrpcRouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GrpcRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GrpcRouteArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var grpcRouteResource = new Gcp.NetworkServices.GrpcRoute("grpcRouteResource", new()
    {
        Hostnames = new[]
        {
            "string",
        },
        Rules = new[]
        {
            new Gcp.NetworkServices.Inputs.GrpcRouteRuleArgs
            {
                Action = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionArgs
                {
                    Destinations = new[]
                    {
                        new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionDestinationArgs
                        {
                            ServiceName = "string",
                            Weight = 0,
                        },
                    },
                    FaultInjectionPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyArgs
                    {
                        Abort = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs
                        {
                            HttpStatus = 0,
                            Percentage = 0,
                        },
                        Delay = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs
                        {
                            FixedDelay = "string",
                            Percentage = 0,
                        },
                    },
                    RetryPolicy = new Gcp.NetworkServices.Inputs.GrpcRouteRuleActionRetryPolicyArgs
                    {
                        NumRetries = 0,
                        RetryConditions = new[]
                        {
                            "string",
                        },
                    },
                    Timeout = "string",
                },
                Matches = new[]
                {
                    new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchArgs
                    {
                        Headers = new[]
                        {
                            new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchHeaderArgs
                            {
                                Key = "string",
                                Value = "string",
                                Type = "string",
                            },
                        },
                        Method = new Gcp.NetworkServices.Inputs.GrpcRouteRuleMatchMethodArgs
                        {
                            GrpcMethod = "string",
                            GrpcService = "string",
                            CaseSensitive = false,
                        },
                    },
                },
            },
        },
        Description = "string",
        Gateways = new[]
        {
            "string",
        },
        Labels = 
        {
            { "string", "string" },
        },
        Meshes = new[]
        {
            "string",
        },
        Name = "string",
        Project = "string",
    });
    
    example, err := networkservices.NewGrpcRoute(ctx, "grpcRouteResource", &networkservices.GrpcRouteArgs{
    	Hostnames: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Rules: networkservices.GrpcRouteRuleArray{
    		&networkservices.GrpcRouteRuleArgs{
    			Action: &networkservices.GrpcRouteRuleActionArgs{
    				Destinations: networkservices.GrpcRouteRuleActionDestinationArray{
    					&networkservices.GrpcRouteRuleActionDestinationArgs{
    						ServiceName: pulumi.String("string"),
    						Weight:      pulumi.Int(0),
    					},
    				},
    				FaultInjectionPolicy: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs{
    					Abort: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs{
    						HttpStatus: pulumi.Int(0),
    						Percentage: pulumi.Int(0),
    					},
    					Delay: &networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs{
    						FixedDelay: pulumi.String("string"),
    						Percentage: pulumi.Int(0),
    					},
    				},
    				RetryPolicy: &networkservices.GrpcRouteRuleActionRetryPolicyArgs{
    					NumRetries: pulumi.Int(0),
    					RetryConditions: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    				Timeout: pulumi.String("string"),
    			},
    			Matches: networkservices.GrpcRouteRuleMatchArray{
    				&networkservices.GrpcRouteRuleMatchArgs{
    					Headers: networkservices.GrpcRouteRuleMatchHeaderArray{
    						&networkservices.GrpcRouteRuleMatchHeaderArgs{
    							Key:   pulumi.String("string"),
    							Value: pulumi.String("string"),
    							Type:  pulumi.String("string"),
    						},
    					},
    					Method: &networkservices.GrpcRouteRuleMatchMethodArgs{
    						GrpcMethod:    pulumi.String("string"),
    						GrpcService:   pulumi.String("string"),
    						CaseSensitive: pulumi.Bool(false),
    					},
    				},
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Gateways: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Meshes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    })
    
    var grpcRouteResource = new GrpcRoute("grpcRouteResource", GrpcRouteArgs.builder()        
        .hostnames("string")
        .rules(GrpcRouteRuleArgs.builder()
            .action(GrpcRouteRuleActionArgs.builder()
                .destinations(GrpcRouteRuleActionDestinationArgs.builder()
                    .serviceName("string")
                    .weight(0)
                    .build())
                .faultInjectionPolicy(GrpcRouteRuleActionFaultInjectionPolicyArgs.builder()
                    .abort(GrpcRouteRuleActionFaultInjectionPolicyAbortArgs.builder()
                        .httpStatus(0)
                        .percentage(0)
                        .build())
                    .delay(GrpcRouteRuleActionFaultInjectionPolicyDelayArgs.builder()
                        .fixedDelay("string")
                        .percentage(0)
                        .build())
                    .build())
                .retryPolicy(GrpcRouteRuleActionRetryPolicyArgs.builder()
                    .numRetries(0)
                    .retryConditions("string")
                    .build())
                .timeout("string")
                .build())
            .matches(GrpcRouteRuleMatchArgs.builder()
                .headers(GrpcRouteRuleMatchHeaderArgs.builder()
                    .key("string")
                    .value("string")
                    .type("string")
                    .build())
                .method(GrpcRouteRuleMatchMethodArgs.builder()
                    .grpcMethod("string")
                    .grpcService("string")
                    .caseSensitive(false)
                    .build())
                .build())
            .build())
        .description("string")
        .gateways("string")
        .labels(Map.of("string", "string"))
        .meshes("string")
        .name("string")
        .project("string")
        .build());
    
    grpc_route_resource = gcp.networkservices.GrpcRoute("grpcRouteResource",
        hostnames=["string"],
        rules=[gcp.networkservices.GrpcRouteRuleArgs(
            action=gcp.networkservices.GrpcRouteRuleActionArgs(
                destinations=[gcp.networkservices.GrpcRouteRuleActionDestinationArgs(
                    service_name="string",
                    weight=0,
                )],
                fault_injection_policy=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyArgs(
                    abort=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyAbortArgs(
                        http_status=0,
                        percentage=0,
                    ),
                    delay=gcp.networkservices.GrpcRouteRuleActionFaultInjectionPolicyDelayArgs(
                        fixed_delay="string",
                        percentage=0,
                    ),
                ),
                retry_policy=gcp.networkservices.GrpcRouteRuleActionRetryPolicyArgs(
                    num_retries=0,
                    retry_conditions=["string"],
                ),
                timeout="string",
            ),
            matches=[gcp.networkservices.GrpcRouteRuleMatchArgs(
                headers=[gcp.networkservices.GrpcRouteRuleMatchHeaderArgs(
                    key="string",
                    value="string",
                    type="string",
                )],
                method=gcp.networkservices.GrpcRouteRuleMatchMethodArgs(
                    grpc_method="string",
                    grpc_service="string",
                    case_sensitive=False,
                ),
            )],
        )],
        description="string",
        gateways=["string"],
        labels={
            "string": "string",
        },
        meshes=["string"],
        name="string",
        project="string")
    
    const grpcRouteResource = new gcp.networkservices.GrpcRoute("grpcRouteResource", {
        hostnames: ["string"],
        rules: [{
            action: {
                destinations: [{
                    serviceName: "string",
                    weight: 0,
                }],
                faultInjectionPolicy: {
                    abort: {
                        httpStatus: 0,
                        percentage: 0,
                    },
                    delay: {
                        fixedDelay: "string",
                        percentage: 0,
                    },
                },
                retryPolicy: {
                    numRetries: 0,
                    retryConditions: ["string"],
                },
                timeout: "string",
            },
            matches: [{
                headers: [{
                    key: "string",
                    value: "string",
                    type: "string",
                }],
                method: {
                    grpcMethod: "string",
                    grpcService: "string",
                    caseSensitive: false,
                },
            }],
        }],
        description: "string",
        gateways: ["string"],
        labels: {
            string: "string",
        },
        meshes: ["string"],
        name: "string",
        project: "string",
    });
    
    type: gcp:networkservices:GrpcRoute
    properties:
        description: string
        gateways:
            - string
        hostnames:
            - string
        labels:
            string: string
        meshes:
            - string
        name: string
        project: string
        rules:
            - action:
                destinations:
                    - serviceName: string
                      weight: 0
                faultInjectionPolicy:
                    abort:
                        httpStatus: 0
                        percentage: 0
                    delay:
                        fixedDelay: string
                        percentage: 0
                retryPolicy:
                    numRetries: 0
                    retryConditions:
                        - string
                timeout: string
              matches:
                - headers:
                    - key: string
                      type: string
                      value: string
                  method:
                    caseSensitive: false
                    grpcMethod: string
                    grpcService: string
    

    GrpcRoute Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The GrpcRoute resource accepts the following input properties:

    Hostnames List<string>
    Required. Service hostnames with an optional port for which this route describes traffic.
    Rules List<GrpcRouteRule>
    Rules that define how traffic is routed and handled. Structure is documented below.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Gateways List<string>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    Labels Dictionary<string, string>
    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 'effective_labels' for all of the labels present on the resource.
    Meshes List<string>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    Name string
    Name of the GrpcRoute resource.
    Project string
    Hostnames []string
    Required. Service hostnames with an optional port for which this route describes traffic.
    Rules []GrpcRouteRuleArgs
    Rules that define how traffic is routed and handled. Structure is documented below.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Gateways []string
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    Labels map[string]string
    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 'effective_labels' for all of the labels present on the resource.
    Meshes []string
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    Name string
    Name of the GrpcRoute resource.
    Project string
    hostnames List<String>
    Required. Service hostnames with an optional port for which this route describes traffic.
    rules List<GrpcRouteRule>
    Rules that define how traffic is routed and handled. Structure is documented below.
    description String
    A free-text description of the resource. Max length 1024 characters.
    gateways List<String>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    labels Map<String,String>
    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 'effective_labels' for all of the labels present on the resource.
    meshes List<String>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name String
    Name of the GrpcRoute resource.
    project String
    hostnames string[]
    Required. Service hostnames with an optional port for which this route describes traffic.
    rules GrpcRouteRule[]
    Rules that define how traffic is routed and handled. Structure is documented below.
    description string
    A free-text description of the resource. Max length 1024 characters.
    gateways string[]
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    labels {[key: string]: string}
    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 'effective_labels' for all of the labels present on the resource.
    meshes string[]
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name string
    Name of the GrpcRoute resource.
    project string
    hostnames Sequence[str]
    Required. Service hostnames with an optional port for which this route describes traffic.
    rules Sequence[GrpcRouteRuleArgs]
    Rules that define how traffic is routed and handled. Structure is documented below.
    description str
    A free-text description of the resource. Max length 1024 characters.
    gateways Sequence[str]
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    labels Mapping[str, str]
    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 'effective_labels' for all of the labels present on the resource.
    meshes Sequence[str]
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name str
    Name of the GrpcRoute resource.
    project str
    hostnames List<String>
    Required. Service hostnames with an optional port for which this route describes traffic.
    rules List<Property Map>
    Rules that define how traffic is routed and handled. Structure is documented below.
    description String
    A free-text description of the resource. Max length 1024 characters.
    gateways List<String>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    labels Map<String>
    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 'effective_labels' for all of the labels present on the resource.
    meshes List<String>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name String
    Name of the GrpcRoute resource.
    project String

    Outputs

    All input properties are implicitly available as output properties. Additionally, the GrpcRoute resource produces the following output properties:

    CreateTime string
    Time the GrpcRoute was created in UTC.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the GrpcRoute was updated in UTC.
    CreateTime string
    Time the GrpcRoute was created in UTC.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Id string
    The provider-assigned unique ID for this managed resource.
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the GrpcRoute was updated in UTC.
    createTime String
    Time the GrpcRoute was created in UTC.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the GrpcRoute was updated in UTC.
    createTime string
    Time the GrpcRoute was created in UTC.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id string
    The provider-assigned unique ID for this managed resource.
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink string
    Server-defined URL of this resource.
    updateTime string
    Time the GrpcRoute was updated in UTC.
    create_time str
    Time the GrpcRoute was created in UTC.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id str
    The provider-assigned unique ID for this managed resource.
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    self_link str
    Server-defined URL of this resource.
    update_time str
    Time the GrpcRoute was updated in UTC.
    createTime String
    Time the GrpcRoute was created in UTC.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    id String
    The provider-assigned unique ID for this managed resource.
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the GrpcRoute was updated in UTC.

    Look up Existing GrpcRoute Resource

    Get an existing GrpcRoute resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: GrpcRouteState, opts?: CustomResourceOptions): GrpcRoute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            effective_labels: Optional[Mapping[str, str]] = None,
            gateways: Optional[Sequence[str]] = None,
            hostnames: Optional[Sequence[str]] = None,
            labels: Optional[Mapping[str, str]] = None,
            meshes: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            pulumi_labels: Optional[Mapping[str, str]] = None,
            rules: Optional[Sequence[GrpcRouteRuleArgs]] = None,
            self_link: Optional[str] = None,
            update_time: Optional[str] = None) -> GrpcRoute
    func GetGrpcRoute(ctx *Context, name string, id IDInput, state *GrpcRouteState, opts ...ResourceOption) (*GrpcRoute, error)
    public static GrpcRoute Get(string name, Input<string> id, GrpcRouteState? state, CustomResourceOptions? opts = null)
    public static GrpcRoute get(String name, Output<String> id, GrpcRouteState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    CreateTime string
    Time the GrpcRoute was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    EffectiveLabels Dictionary<string, string>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Gateways List<string>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    Hostnames List<string>
    Required. Service hostnames with an optional port for which this route describes traffic.
    Labels Dictionary<string, string>
    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 'effective_labels' for all of the labels present on the resource.
    Meshes List<string>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    Name string
    Name of the GrpcRoute resource.
    Project string
    PulumiLabels Dictionary<string, string>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Rules List<GrpcRouteRule>
    Rules that define how traffic is routed and handled. Structure is documented below.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the GrpcRoute was updated in UTC.
    CreateTime string
    Time the GrpcRoute was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    EffectiveLabels map[string]string
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    Gateways []string
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    Hostnames []string
    Required. Service hostnames with an optional port for which this route describes traffic.
    Labels map[string]string
    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 'effective_labels' for all of the labels present on the resource.
    Meshes []string
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    Name string
    Name of the GrpcRoute resource.
    Project string
    PulumiLabels map[string]string
    The combination of labels configured directly on the resource and default labels configured on the provider.
    Rules []GrpcRouteRuleArgs
    Rules that define how traffic is routed and handled. Structure is documented below.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the GrpcRoute was updated in UTC.
    createTime String
    Time the GrpcRoute was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels Map<String,String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    gateways List<String>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    hostnames List<String>
    Required. Service hostnames with an optional port for which this route describes traffic.
    labels Map<String,String>
    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 'effective_labels' for all of the labels present on the resource.
    meshes List<String>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name String
    Name of the GrpcRoute resource.
    project String
    pulumiLabels Map<String,String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules List<GrpcRouteRule>
    Rules that define how traffic is routed and handled. Structure is documented below.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the GrpcRoute was updated in UTC.
    createTime string
    Time the GrpcRoute was created in UTC.
    description string
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels {[key: string]: string}
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    gateways string[]
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    hostnames string[]
    Required. Service hostnames with an optional port for which this route describes traffic.
    labels {[key: string]: string}
    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 'effective_labels' for all of the labels present on the resource.
    meshes string[]
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name string
    Name of the GrpcRoute resource.
    project string
    pulumiLabels {[key: string]: string}
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules GrpcRouteRule[]
    Rules that define how traffic is routed and handled. Structure is documented below.
    selfLink string
    Server-defined URL of this resource.
    updateTime string
    Time the GrpcRoute was updated in UTC.
    create_time str
    Time the GrpcRoute was created in UTC.
    description str
    A free-text description of the resource. Max length 1024 characters.
    effective_labels Mapping[str, str]
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    gateways Sequence[str]
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    hostnames Sequence[str]
    Required. Service hostnames with an optional port for which this route describes traffic.
    labels Mapping[str, str]
    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 'effective_labels' for all of the labels present on the resource.
    meshes Sequence[str]
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name str
    Name of the GrpcRoute resource.
    project str
    pulumi_labels Mapping[str, str]
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules Sequence[GrpcRouteRuleArgs]
    Rules that define how traffic is routed and handled. Structure is documented below.
    self_link str
    Server-defined URL of this resource.
    update_time str
    Time the GrpcRoute was updated in UTC.
    createTime String
    Time the GrpcRoute was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    effectiveLabels Map<String>
    All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
    gateways List<String>
    List of gateways this GrpcRoute is attached to, as one of the routing rules to route the requests served by the gateway.
    hostnames List<String>
    Required. Service hostnames with an optional port for which this route describes traffic.
    labels Map<String>
    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 'effective_labels' for all of the labels present on the resource.
    meshes List<String>
    List of meshes this GrpcRoute is attached to, as one of the routing rules to route the requests served by the mesh.
    name String
    Name of the GrpcRoute resource.
    project String
    pulumiLabels Map<String>
    The combination of labels configured directly on the resource and default labels configured on the provider.
    rules List<Property Map>
    Rules that define how traffic is routed and handled. Structure is documented below.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the GrpcRoute was updated in UTC.

    Supporting Types

    GrpcRouteRule, GrpcRouteRuleArgs

    Action GrpcRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    Matches List<GrpcRouteRuleMatch>
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.
    Action GrpcRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    Matches []GrpcRouteRuleMatch
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.
    action GrpcRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches List<GrpcRouteRuleMatch>
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.
    action GrpcRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches GrpcRouteRuleMatch[]
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.
    action GrpcRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches Sequence[GrpcRouteRuleMatch]
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.
    action Property Map
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches List<Property Map>
    Matches define conditions used for matching the rule against incoming gRPC requests. Structure is documented below.

    GrpcRouteRuleAction, GrpcRouteRuleActionArgs

    Destinations List<GrpcRouteRuleActionDestination>
    The destination to which traffic should be forwarded. Structure is documented below.
    FaultInjectionPolicy GrpcRouteRuleActionFaultInjectionPolicy
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    RetryPolicy GrpcRouteRuleActionRetryPolicy
    Specifies the retry policy associated with this route. Structure is documented below.
    Timeout string
    Specifies the timeout for selected route.
    Destinations []GrpcRouteRuleActionDestination
    The destination to which traffic should be forwarded. Structure is documented below.
    FaultInjectionPolicy GrpcRouteRuleActionFaultInjectionPolicy
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    RetryPolicy GrpcRouteRuleActionRetryPolicy
    Specifies the retry policy associated with this route. Structure is documented below.
    Timeout string
    Specifies the timeout for selected route.
    destinations List<GrpcRouteRuleActionDestination>
    The destination to which traffic should be forwarded. Structure is documented below.
    faultInjectionPolicy GrpcRouteRuleActionFaultInjectionPolicy
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    retryPolicy GrpcRouteRuleActionRetryPolicy
    Specifies the retry policy associated with this route. Structure is documented below.
    timeout String
    Specifies the timeout for selected route.
    destinations GrpcRouteRuleActionDestination[]
    The destination to which traffic should be forwarded. Structure is documented below.
    faultInjectionPolicy GrpcRouteRuleActionFaultInjectionPolicy
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    retryPolicy GrpcRouteRuleActionRetryPolicy
    Specifies the retry policy associated with this route. Structure is documented below.
    timeout string
    Specifies the timeout for selected route.
    destinations Sequence[GrpcRouteRuleActionDestination]
    The destination to which traffic should be forwarded. Structure is documented below.
    fault_injection_policy GrpcRouteRuleActionFaultInjectionPolicy
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    retry_policy GrpcRouteRuleActionRetryPolicy
    Specifies the retry policy associated with this route. Structure is documented below.
    timeout str
    Specifies the timeout for selected route.
    destinations List<Property Map>
    The destination to which traffic should be forwarded. Structure is documented below.
    faultInjectionPolicy Property Map
    The specification for fault injection introduced into traffic to test the resiliency of clients to backend service failure. Structure is documented below.
    retryPolicy Property Map
    Specifies the retry policy associated with this route. Structure is documented below.
    timeout String
    Specifies the timeout for selected route.

    GrpcRouteRuleActionDestination, GrpcRouteRuleActionDestinationArgs

    ServiceName string
    The URL of a BackendService to route traffic to.
    Weight int
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.
    ServiceName string
    The URL of a BackendService to route traffic to.
    Weight int
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.
    serviceName String
    The URL of a BackendService to route traffic to.
    weight Integer
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.
    serviceName string
    The URL of a BackendService to route traffic to.
    weight number
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.
    service_name str
    The URL of a BackendService to route traffic to.
    weight int
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.
    serviceName String
    The URL of a BackendService to route traffic to.
    weight Number
    Specifies the proportion of requests forwarded to the backend referenced by the serviceName field.

    GrpcRouteRuleActionFaultInjectionPolicy, GrpcRouteRuleActionFaultInjectionPolicyArgs

    Abort GrpcRouteRuleActionFaultInjectionPolicyAbort
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    Delay GrpcRouteRuleActionFaultInjectionPolicyDelay
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.
    Abort GrpcRouteRuleActionFaultInjectionPolicyAbort
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    Delay GrpcRouteRuleActionFaultInjectionPolicyDelay
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.
    abort GrpcRouteRuleActionFaultInjectionPolicyAbort
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    delay GrpcRouteRuleActionFaultInjectionPolicyDelay
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.
    abort GrpcRouteRuleActionFaultInjectionPolicyAbort
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    delay GrpcRouteRuleActionFaultInjectionPolicyDelay
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.
    abort GrpcRouteRuleActionFaultInjectionPolicyAbort
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    delay GrpcRouteRuleActionFaultInjectionPolicyDelay
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.
    abort Property Map
    Specification of how client requests are aborted as part of fault injection before being sent to a destination. Structure is documented below.
    delay Property Map
    Specification of how client requests are delayed as part of fault injection before being sent to a destination. Structure is documented below.

    GrpcRouteRuleActionFaultInjectionPolicyAbort, GrpcRouteRuleActionFaultInjectionPolicyAbortArgs

    HttpStatus int
    The HTTP status code used to abort the request.
    Percentage int
    The percentage of traffic which will be aborted.
    HttpStatus int
    The HTTP status code used to abort the request.
    Percentage int
    The percentage of traffic which will be aborted.
    httpStatus Integer
    The HTTP status code used to abort the request.
    percentage Integer
    The percentage of traffic which will be aborted.
    httpStatus number
    The HTTP status code used to abort the request.
    percentage number
    The percentage of traffic which will be aborted.
    http_status int
    The HTTP status code used to abort the request.
    percentage int
    The percentage of traffic which will be aborted.
    httpStatus Number
    The HTTP status code used to abort the request.
    percentage Number
    The percentage of traffic which will be aborted.

    GrpcRouteRuleActionFaultInjectionPolicyDelay, GrpcRouteRuleActionFaultInjectionPolicyDelayArgs

    FixedDelay string
    Specify a fixed delay before forwarding the request.
    Percentage int
    The percentage of traffic on which delay will be injected.
    FixedDelay string
    Specify a fixed delay before forwarding the request.
    Percentage int
    The percentage of traffic on which delay will be injected.
    fixedDelay String
    Specify a fixed delay before forwarding the request.
    percentage Integer
    The percentage of traffic on which delay will be injected.
    fixedDelay string
    Specify a fixed delay before forwarding the request.
    percentage number
    The percentage of traffic on which delay will be injected.
    fixed_delay str
    Specify a fixed delay before forwarding the request.
    percentage int
    The percentage of traffic on which delay will be injected.
    fixedDelay String
    Specify a fixed delay before forwarding the request.
    percentage Number
    The percentage of traffic on which delay will be injected.

    GrpcRouteRuleActionRetryPolicy, GrpcRouteRuleActionRetryPolicyArgs

    NumRetries int
    Specifies the allowed number of retries.


    RetryConditions List<string>
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.
    NumRetries int
    Specifies the allowed number of retries.


    RetryConditions []string
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.
    numRetries Integer
    Specifies the allowed number of retries.


    retryConditions List<String>
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.
    numRetries number
    Specifies the allowed number of retries.


    retryConditions string[]
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.
    num_retries int
    Specifies the allowed number of retries.


    retry_conditions Sequence[str]
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.
    numRetries Number
    Specifies the allowed number of retries.


    retryConditions List<String>
    Specifies one or more conditions when this retry policy applies. Each value may be one of: connect-failure, refused-stream, cancelled, deadline-exceeded, resource-exhausted, unavailable.

    GrpcRouteRuleMatch, GrpcRouteRuleMatchArgs

    Headers List<GrpcRouteRuleMatchHeader>
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    Method GrpcRouteRuleMatchMethod
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.
    Headers []GrpcRouteRuleMatchHeader
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    Method GrpcRouteRuleMatchMethod
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.
    headers List<GrpcRouteRuleMatchHeader>
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    method GrpcRouteRuleMatchMethod
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.
    headers GrpcRouteRuleMatchHeader[]
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    method GrpcRouteRuleMatchMethod
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.
    headers Sequence[GrpcRouteRuleMatchHeader]
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    method GrpcRouteRuleMatchMethod
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.
    headers List<Property Map>
    Specifies a list of HTTP request headers to match against. Structure is documented below.
    method Property Map
    A gRPC method to match against. If this field is empty or omitted, will match all methods. Structure is documented below.

    GrpcRouteRuleMatchHeader, GrpcRouteRuleMatchHeaderArgs

    Key string
    Required. The key of the header.
    Value string
    Required. The value of the header.
    Type string
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.
    Key string
    Required. The key of the header.
    Value string
    Required. The value of the header.
    Type string
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.
    key String
    Required. The key of the header.
    value String
    Required. The value of the header.
    type String
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.
    key string
    Required. The key of the header.
    value string
    Required. The value of the header.
    type string
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.
    key str
    Required. The key of the header.
    value str
    Required. The value of the header.
    type str
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.
    key String
    Required. The key of the header.
    value String
    Required. The value of the header.
    type String
    The type of match. Default value is EXACT. Possible values are: TYPE_UNSPECIFIED, EXACT, REGULAR_EXPRESSION.

    GrpcRouteRuleMatchMethod, GrpcRouteRuleMatchMethodArgs

    GrpcMethod string
    Required. Name of the method to match against.
    GrpcService string
    Required. Name of the service to match against.
    CaseSensitive bool
    Specifies that matches are case sensitive. The default value is true.
    GrpcMethod string
    Required. Name of the method to match against.
    GrpcService string
    Required. Name of the service to match against.
    CaseSensitive bool
    Specifies that matches are case sensitive. The default value is true.
    grpcMethod String
    Required. Name of the method to match against.
    grpcService String
    Required. Name of the service to match against.
    caseSensitive Boolean
    Specifies that matches are case sensitive. The default value is true.
    grpcMethod string
    Required. Name of the method to match against.
    grpcService string
    Required. Name of the service to match against.
    caseSensitive boolean
    Specifies that matches are case sensitive. The default value is true.
    grpc_method str
    Required. Name of the method to match against.
    grpc_service str
    Required. Name of the service to match against.
    case_sensitive bool
    Specifies that matches are case sensitive. The default value is true.
    grpcMethod String
    Required. Name of the method to match against.
    grpcService String
    Required. Name of the service to match against.
    caseSensitive Boolean
    Specifies that matches are case sensitive. The default value is true.

    Import

    GrpcRoute can be imported using any of these accepted formats:

    • projects/{{project}}/locations/global/grpcRoutes/{{name}}

    • {{project}}/{{name}}

    • {{name}}

    When using the pulumi import command, GrpcRoute can be imported using one of the formats above. For example:

    $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default projects/{{project}}/locations/global/grpcRoutes/{{name}}
    
    $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default {{project}}/{{name}}
    
    $ pulumi import gcp:networkservices/grpcRoute:GrpcRoute default {{name}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud Classic v7.21.0 published on Friday, May 3, 2024 by Pulumi