1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. networkservices
  5. TlsRoute
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

gcp.networkservices.TlsRoute

Explore with Pulumi AI

gcp logo
Google Cloud Classic v8.9.3 published on Monday, Nov 18, 2024 by Pulumi

    Example Usage

    Network Services Tls Route Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
        name: "backend-service-health-check",
        requestPath: "/",
        checkIntervalSec: 1,
        timeoutSec: 1,
    });
    const _default = new gcp.compute.BackendService("default", {
        name: "my-backend-service",
        healthChecks: defaultHttpHealthCheck.id,
    });
    const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
        name: "my-tls-route",
        description: "my description",
        rules: [{
            matches: [{
                sniHosts: ["example.com"],
                alpns: ["http/1.1"],
            }],
            action: {
                destinations: [{
                    serviceName: _default.id,
                    weight: 1,
                }],
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default_http_health_check = gcp.compute.HttpHealthCheck("default",
        name="backend-service-health-check",
        request_path="/",
        check_interval_sec=1,
        timeout_sec=1)
    default = gcp.compute.BackendService("default",
        name="my-backend-service",
        health_checks=default_http_health_check.id)
    default_tls_route = gcp.networkservices.TlsRoute("default",
        name="my-tls-route",
        description="my description",
        rules=[{
            "matches": [{
                "sni_hosts": ["example.com"],
                "alpns": ["http/1.1"],
            }],
            "action": {
                "destinations": [{
                    "service_name": default.id,
                    "weight": 1,
                }],
            },
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkservices"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
    			Name:             pulumi.String("backend-service-health-check"),
    			RequestPath:      pulumi.String("/"),
    			CheckIntervalSec: pulumi.Int(1),
    			TimeoutSec:       pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
    			Name:         pulumi.String("my-backend-service"),
    			HealthChecks: defaultHttpHealthCheck.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
    			Name:        pulumi.String("my-tls-route"),
    			Description: pulumi.String("my description"),
    			Rules: networkservices.TlsRouteRuleArray{
    				&networkservices.TlsRouteRuleArgs{
    					Matches: networkservices.TlsRouteRuleMatchArray{
    						&networkservices.TlsRouteRuleMatchArgs{
    							SniHosts: pulumi.StringArray{
    								pulumi.String("example.com"),
    							},
    							Alpns: pulumi.StringArray{
    								pulumi.String("http/1.1"),
    							},
    						},
    					},
    					Action: &networkservices.TlsRouteRuleActionArgs{
    						Destinations: networkservices.TlsRouteRuleActionDestinationArray{
    							&networkservices.TlsRouteRuleActionDestinationArgs{
    								ServiceName: _default.ID(),
    								Weight:      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 defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
        {
            Name = "backend-service-health-check",
            RequestPath = "/",
            CheckIntervalSec = 1,
            TimeoutSec = 1,
        });
    
        var @default = new Gcp.Compute.BackendService("default", new()
        {
            Name = "my-backend-service",
            HealthChecks = defaultHttpHealthCheck.Id,
        });
    
        var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
        {
            Name = "my-tls-route",
            Description = "my description",
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
                {
                    Matches = new[]
                    {
                        new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
                        {
                            SniHosts = new[]
                            {
                                "example.com",
                            },
                            Alpns = new[]
                            {
                                "http/1.1",
                            },
                        },
                    },
                    Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
                    {
                        Destinations = new[]
                        {
                            new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
                            {
                                ServiceName = @default.Id,
                                Weight = 1,
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.HttpHealthCheck;
    import com.pulumi.gcp.compute.HttpHealthCheckArgs;
    import com.pulumi.gcp.compute.BackendService;
    import com.pulumi.gcp.compute.BackendServiceArgs;
    import com.pulumi.gcp.networkservices.TlsRoute;
    import com.pulumi.gcp.networkservices.TlsRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleActionArgs;
    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 defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
                .name("backend-service-health-check")
                .requestPath("/")
                .checkIntervalSec(1)
                .timeoutSec(1)
                .build());
    
            var default_ = new BackendService("default", BackendServiceArgs.builder()
                .name("my-backend-service")
                .healthChecks(defaultHttpHealthCheck.id())
                .build());
    
            var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
                .name("my-tls-route")
                .description("my description")
                .rules(TlsRouteRuleArgs.builder()
                    .matches(TlsRouteRuleMatchArgs.builder()
                        .sniHosts("example.com")
                        .alpns("http/1.1")
                        .build())
                    .action(TlsRouteRuleActionArgs.builder()
                        .destinations(TlsRouteRuleActionDestinationArgs.builder()
                            .serviceName(default_.id())
                            .weight(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:BackendService
        properties:
          name: my-backend-service
          healthChecks: ${defaultHttpHealthCheck.id}
      defaultHttpHealthCheck:
        type: gcp:compute:HttpHealthCheck
        name: default
        properties:
          name: backend-service-health-check
          requestPath: /
          checkIntervalSec: 1
          timeoutSec: 1
      defaultTlsRoute:
        type: gcp:networkservices:TlsRoute
        name: default
        properties:
          name: my-tls-route
          description: my description
          rules:
            - matches:
                - sniHosts:
                    - example.com
                  alpns:
                    - http/1.1
              action:
                destinations:
                  - serviceName: ${default.id}
                    weight: 1
    

    Network Services Tls Route Mesh Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
        name: "backend-service-health-check",
        requestPath: "/",
        checkIntervalSec: 1,
        timeoutSec: 1,
    });
    const _default = new gcp.compute.BackendService("default", {
        name: "my-backend-service",
        healthChecks: defaultHttpHealthCheck.id,
    });
    const defaultMesh = new gcp.networkservices.Mesh("default", {
        name: "my-tls-route",
        labels: {
            foo: "bar",
        },
        description: "my description",
    });
    const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
        name: "my-tls-route",
        description: "my description",
        meshes: [defaultMesh.id],
        rules: [{
            matches: [{
                sniHosts: ["example.com"],
                alpns: ["http/1.1"],
            }],
            action: {
                destinations: [{
                    serviceName: _default.id,
                    weight: 1,
                }],
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default_http_health_check = gcp.compute.HttpHealthCheck("default",
        name="backend-service-health-check",
        request_path="/",
        check_interval_sec=1,
        timeout_sec=1)
    default = gcp.compute.BackendService("default",
        name="my-backend-service",
        health_checks=default_http_health_check.id)
    default_mesh = gcp.networkservices.Mesh("default",
        name="my-tls-route",
        labels={
            "foo": "bar",
        },
        description="my description")
    default_tls_route = gcp.networkservices.TlsRoute("default",
        name="my-tls-route",
        description="my description",
        meshes=[default_mesh.id],
        rules=[{
            "matches": [{
                "sni_hosts": ["example.com"],
                "alpns": ["http/1.1"],
            }],
            "action": {
                "destinations": [{
                    "service_name": default.id,
                    "weight": 1,
                }],
            },
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkservices"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
    			Name:             pulumi.String("backend-service-health-check"),
    			RequestPath:      pulumi.String("/"),
    			CheckIntervalSec: pulumi.Int(1),
    			TimeoutSec:       pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
    			Name:         pulumi.String("my-backend-service"),
    			HealthChecks: defaultHttpHealthCheck.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultMesh, err := networkservices.NewMesh(ctx, "default", &networkservices.MeshArgs{
    			Name: pulumi.String("my-tls-route"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
    			Name:        pulumi.String("my-tls-route"),
    			Description: pulumi.String("my description"),
    			Meshes: pulumi.StringArray{
    				defaultMesh.ID(),
    			},
    			Rules: networkservices.TlsRouteRuleArray{
    				&networkservices.TlsRouteRuleArgs{
    					Matches: networkservices.TlsRouteRuleMatchArray{
    						&networkservices.TlsRouteRuleMatchArgs{
    							SniHosts: pulumi.StringArray{
    								pulumi.String("example.com"),
    							},
    							Alpns: pulumi.StringArray{
    								pulumi.String("http/1.1"),
    							},
    						},
    					},
    					Action: &networkservices.TlsRouteRuleActionArgs{
    						Destinations: networkservices.TlsRouteRuleActionDestinationArray{
    							&networkservices.TlsRouteRuleActionDestinationArgs{
    								ServiceName: _default.ID(),
    								Weight:      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 defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
        {
            Name = "backend-service-health-check",
            RequestPath = "/",
            CheckIntervalSec = 1,
            TimeoutSec = 1,
        });
    
        var @default = new Gcp.Compute.BackendService("default", new()
        {
            Name = "my-backend-service",
            HealthChecks = defaultHttpHealthCheck.Id,
        });
    
        var defaultMesh = new Gcp.NetworkServices.Mesh("default", new()
        {
            Name = "my-tls-route",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
        });
    
        var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
        {
            Name = "my-tls-route",
            Description = "my description",
            Meshes = new[]
            {
                defaultMesh.Id,
            },
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
                {
                    Matches = new[]
                    {
                        new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
                        {
                            SniHosts = new[]
                            {
                                "example.com",
                            },
                            Alpns = new[]
                            {
                                "http/1.1",
                            },
                        },
                    },
                    Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
                    {
                        Destinations = new[]
                        {
                            new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
                            {
                                ServiceName = @default.Id,
                                Weight = 1,
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.HttpHealthCheck;
    import com.pulumi.gcp.compute.HttpHealthCheckArgs;
    import com.pulumi.gcp.compute.BackendService;
    import com.pulumi.gcp.compute.BackendServiceArgs;
    import com.pulumi.gcp.networkservices.Mesh;
    import com.pulumi.gcp.networkservices.MeshArgs;
    import com.pulumi.gcp.networkservices.TlsRoute;
    import com.pulumi.gcp.networkservices.TlsRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleActionArgs;
    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 defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
                .name("backend-service-health-check")
                .requestPath("/")
                .checkIntervalSec(1)
                .timeoutSec(1)
                .build());
    
            var default_ = new BackendService("default", BackendServiceArgs.builder()
                .name("my-backend-service")
                .healthChecks(defaultHttpHealthCheck.id())
                .build());
    
            var defaultMesh = new Mesh("defaultMesh", MeshArgs.builder()
                .name("my-tls-route")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .build());
    
            var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
                .name("my-tls-route")
                .description("my description")
                .meshes(defaultMesh.id())
                .rules(TlsRouteRuleArgs.builder()
                    .matches(TlsRouteRuleMatchArgs.builder()
                        .sniHosts("example.com")
                        .alpns("http/1.1")
                        .build())
                    .action(TlsRouteRuleActionArgs.builder()
                        .destinations(TlsRouteRuleActionDestinationArgs.builder()
                            .serviceName(default_.id())
                            .weight(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:BackendService
        properties:
          name: my-backend-service
          healthChecks: ${defaultHttpHealthCheck.id}
      defaultHttpHealthCheck:
        type: gcp:compute:HttpHealthCheck
        name: default
        properties:
          name: backend-service-health-check
          requestPath: /
          checkIntervalSec: 1
          timeoutSec: 1
      defaultMesh:
        type: gcp:networkservices:Mesh
        name: default
        properties:
          name: my-tls-route
          labels:
            foo: bar
          description: my description
      defaultTlsRoute:
        type: gcp:networkservices:TlsRoute
        name: default
        properties:
          name: my-tls-route
          description: my description
          meshes:
            - ${defaultMesh.id}
          rules:
            - matches:
                - sniHosts:
                    - example.com
                  alpns:
                    - http/1.1
              action:
                destinations:
                  - serviceName: ${default.id}
                    weight: 1
    

    Network Services Tls Route Gateway Basic

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
        name: "backend-service-health-check",
        requestPath: "/",
        checkIntervalSec: 1,
        timeoutSec: 1,
    });
    const _default = new gcp.compute.BackendService("default", {
        name: "my-backend-service",
        healthChecks: defaultHttpHealthCheck.id,
    });
    const defaultGateway = new gcp.networkservices.Gateway("default", {
        name: "my-tls-route",
        labels: {
            foo: "bar",
        },
        description: "my description",
        scope: "my-scope",
        type: "OPEN_MESH",
        ports: [443],
    });
    const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
        name: "my-tls-route",
        description: "my description",
        gateways: [defaultGateway.id],
        rules: [{
            matches: [{
                sniHosts: ["example.com"],
                alpns: ["http/1.1"],
            }],
            action: {
                destinations: [{
                    serviceName: _default.id,
                    weight: 1,
                }],
            },
        }],
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    default_http_health_check = gcp.compute.HttpHealthCheck("default",
        name="backend-service-health-check",
        request_path="/",
        check_interval_sec=1,
        timeout_sec=1)
    default = gcp.compute.BackendService("default",
        name="my-backend-service",
        health_checks=default_http_health_check.id)
    default_gateway = gcp.networkservices.Gateway("default",
        name="my-tls-route",
        labels={
            "foo": "bar",
        },
        description="my description",
        scope="my-scope",
        type="OPEN_MESH",
        ports=[443])
    default_tls_route = gcp.networkservices.TlsRoute("default",
        name="my-tls-route",
        description="my description",
        gateways=[default_gateway.id],
        rules=[{
            "matches": [{
                "sni_hosts": ["example.com"],
                "alpns": ["http/1.1"],
            }],
            "action": {
                "destinations": [{
                    "service_name": default.id,
                    "weight": 1,
                }],
            },
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/compute"
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/networkservices"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		defaultHttpHealthCheck, err := compute.NewHttpHealthCheck(ctx, "default", &compute.HttpHealthCheckArgs{
    			Name:             pulumi.String("backend-service-health-check"),
    			RequestPath:      pulumi.String("/"),
    			CheckIntervalSec: pulumi.Int(1),
    			TimeoutSec:       pulumi.Int(1),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
    			Name:         pulumi.String("my-backend-service"),
    			HealthChecks: defaultHttpHealthCheck.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		defaultGateway, err := networkservices.NewGateway(ctx, "default", &networkservices.GatewayArgs{
    			Name: pulumi.String("my-tls-route"),
    			Labels: pulumi.StringMap{
    				"foo": pulumi.String("bar"),
    			},
    			Description: pulumi.String("my description"),
    			Scope:       pulumi.String("my-scope"),
    			Type:        pulumi.String("OPEN_MESH"),
    			Ports: pulumi.IntArray{
    				pulumi.Int(443),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
    			Name:        pulumi.String("my-tls-route"),
    			Description: pulumi.String("my description"),
    			Gateways: pulumi.StringArray{
    				defaultGateway.ID(),
    			},
    			Rules: networkservices.TlsRouteRuleArray{
    				&networkservices.TlsRouteRuleArgs{
    					Matches: networkservices.TlsRouteRuleMatchArray{
    						&networkservices.TlsRouteRuleMatchArgs{
    							SniHosts: pulumi.StringArray{
    								pulumi.String("example.com"),
    							},
    							Alpns: pulumi.StringArray{
    								pulumi.String("http/1.1"),
    							},
    						},
    					},
    					Action: &networkservices.TlsRouteRuleActionArgs{
    						Destinations: networkservices.TlsRouteRuleActionDestinationArray{
    							&networkservices.TlsRouteRuleActionDestinationArgs{
    								ServiceName: _default.ID(),
    								Weight:      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 defaultHttpHealthCheck = new Gcp.Compute.HttpHealthCheck("default", new()
        {
            Name = "backend-service-health-check",
            RequestPath = "/",
            CheckIntervalSec = 1,
            TimeoutSec = 1,
        });
    
        var @default = new Gcp.Compute.BackendService("default", new()
        {
            Name = "my-backend-service",
            HealthChecks = defaultHttpHealthCheck.Id,
        });
    
        var defaultGateway = new Gcp.NetworkServices.Gateway("default", new()
        {
            Name = "my-tls-route",
            Labels = 
            {
                { "foo", "bar" },
            },
            Description = "my description",
            Scope = "my-scope",
            Type = "OPEN_MESH",
            Ports = new[]
            {
                443,
            },
        });
    
        var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
        {
            Name = "my-tls-route",
            Description = "my description",
            Gateways = new[]
            {
                defaultGateway.Id,
            },
            Rules = new[]
            {
                new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
                {
                    Matches = new[]
                    {
                        new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
                        {
                            SniHosts = new[]
                            {
                                "example.com",
                            },
                            Alpns = new[]
                            {
                                "http/1.1",
                            },
                        },
                    },
                    Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
                    {
                        Destinations = new[]
                        {
                            new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
                            {
                                ServiceName = @default.Id,
                                Weight = 1,
                            },
                        },
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.compute.HttpHealthCheck;
    import com.pulumi.gcp.compute.HttpHealthCheckArgs;
    import com.pulumi.gcp.compute.BackendService;
    import com.pulumi.gcp.compute.BackendServiceArgs;
    import com.pulumi.gcp.networkservices.Gateway;
    import com.pulumi.gcp.networkservices.GatewayArgs;
    import com.pulumi.gcp.networkservices.TlsRoute;
    import com.pulumi.gcp.networkservices.TlsRouteArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleArgs;
    import com.pulumi.gcp.networkservices.inputs.TlsRouteRuleActionArgs;
    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 defaultHttpHealthCheck = new HttpHealthCheck("defaultHttpHealthCheck", HttpHealthCheckArgs.builder()
                .name("backend-service-health-check")
                .requestPath("/")
                .checkIntervalSec(1)
                .timeoutSec(1)
                .build());
    
            var default_ = new BackendService("default", BackendServiceArgs.builder()
                .name("my-backend-service")
                .healthChecks(defaultHttpHealthCheck.id())
                .build());
    
            var defaultGateway = new Gateway("defaultGateway", GatewayArgs.builder()
                .name("my-tls-route")
                .labels(Map.of("foo", "bar"))
                .description("my description")
                .scope("my-scope")
                .type("OPEN_MESH")
                .ports(443)
                .build());
    
            var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
                .name("my-tls-route")
                .description("my description")
                .gateways(defaultGateway.id())
                .rules(TlsRouteRuleArgs.builder()
                    .matches(TlsRouteRuleMatchArgs.builder()
                        .sniHosts("example.com")
                        .alpns("http/1.1")
                        .build())
                    .action(TlsRouteRuleActionArgs.builder()
                        .destinations(TlsRouteRuleActionDestinationArgs.builder()
                            .serviceName(default_.id())
                            .weight(1)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      default:
        type: gcp:compute:BackendService
        properties:
          name: my-backend-service
          healthChecks: ${defaultHttpHealthCheck.id}
      defaultHttpHealthCheck:
        type: gcp:compute:HttpHealthCheck
        name: default
        properties:
          name: backend-service-health-check
          requestPath: /
          checkIntervalSec: 1
          timeoutSec: 1
      defaultGateway:
        type: gcp:networkservices:Gateway
        name: default
        properties:
          name: my-tls-route
          labels:
            foo: bar
          description: my description
          scope: my-scope
          type: OPEN_MESH
          ports:
            - 443
      defaultTlsRoute:
        type: gcp:networkservices:TlsRoute
        name: default
        properties:
          name: my-tls-route
          description: my description
          gateways:
            - ${defaultGateway.id}
          rules:
            - matches:
                - sniHosts:
                    - example.com
                  alpns:
                    - http/1.1
              action:
                destinations:
                  - serviceName: ${default.id}
                    weight: 1
    

    Create TlsRoute Resource

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

    Constructor syntax

    new TlsRoute(name: string, args: TlsRouteArgs, opts?: CustomResourceOptions);
    @overload
    def TlsRoute(resource_name: str,
                 args: TlsRouteArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def TlsRoute(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 rules: Optional[Sequence[TlsRouteRuleArgs]] = None,
                 description: Optional[str] = None,
                 gateways: Optional[Sequence[str]] = None,
                 meshes: Optional[Sequence[str]] = None,
                 name: Optional[str] = None,
                 project: Optional[str] = None)
    func NewTlsRoute(ctx *Context, name string, args TlsRouteArgs, opts ...ResourceOption) (*TlsRoute, error)
    public TlsRoute(string name, TlsRouteArgs args, CustomResourceOptions? opts = null)
    public TlsRoute(String name, TlsRouteArgs args)
    public TlsRoute(String name, TlsRouteArgs args, CustomResourceOptions options)
    
    type: gcp:networkservices:TlsRoute
    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 TlsRouteArgs
    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 TlsRouteArgs
    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 TlsRouteArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TlsRouteArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TlsRouteArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

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

    var tlsRouteResource = new Gcp.NetworkServices.TlsRoute("tlsRouteResource", new()
    {
        Rules = new[]
        {
            new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
            {
                Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
                {
                    Destinations = new[]
                    {
                        new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
                        {
                            ServiceName = "string",
                            Weight = 0,
                        },
                    },
                },
                Matches = new[]
                {
                    new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
                    {
                        Alpns = new[]
                        {
                            "string",
                        },
                        SniHosts = new[]
                        {
                            "string",
                        },
                    },
                },
            },
        },
        Description = "string",
        Gateways = new[]
        {
            "string",
        },
        Meshes = new[]
        {
            "string",
        },
        Name = "string",
        Project = "string",
    });
    
    example, err := networkservices.NewTlsRoute(ctx, "tlsRouteResource", &networkservices.TlsRouteArgs{
    	Rules: networkservices.TlsRouteRuleArray{
    		&networkservices.TlsRouteRuleArgs{
    			Action: &networkservices.TlsRouteRuleActionArgs{
    				Destinations: networkservices.TlsRouteRuleActionDestinationArray{
    					&networkservices.TlsRouteRuleActionDestinationArgs{
    						ServiceName: pulumi.String("string"),
    						Weight:      pulumi.Int(0),
    					},
    				},
    			},
    			Matches: networkservices.TlsRouteRuleMatchArray{
    				&networkservices.TlsRouteRuleMatchArgs{
    					Alpns: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    					SniHosts: pulumi.StringArray{
    						pulumi.String("string"),
    					},
    				},
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Gateways: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Meshes: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Name:    pulumi.String("string"),
    	Project: pulumi.String("string"),
    })
    
    var tlsRouteResource = new TlsRoute("tlsRouteResource", TlsRouteArgs.builder()
        .rules(TlsRouteRuleArgs.builder()
            .action(TlsRouteRuleActionArgs.builder()
                .destinations(TlsRouteRuleActionDestinationArgs.builder()
                    .serviceName("string")
                    .weight(0)
                    .build())
                .build())
            .matches(TlsRouteRuleMatchArgs.builder()
                .alpns("string")
                .sniHosts("string")
                .build())
            .build())
        .description("string")
        .gateways("string")
        .meshes("string")
        .name("string")
        .project("string")
        .build());
    
    tls_route_resource = gcp.networkservices.TlsRoute("tlsRouteResource",
        rules=[{
            "action": {
                "destinations": [{
                    "service_name": "string",
                    "weight": 0,
                }],
            },
            "matches": [{
                "alpns": ["string"],
                "sni_hosts": ["string"],
            }],
        }],
        description="string",
        gateways=["string"],
        meshes=["string"],
        name="string",
        project="string")
    
    const tlsRouteResource = new gcp.networkservices.TlsRoute("tlsRouteResource", {
        rules: [{
            action: {
                destinations: [{
                    serviceName: "string",
                    weight: 0,
                }],
            },
            matches: [{
                alpns: ["string"],
                sniHosts: ["string"],
            }],
        }],
        description: "string",
        gateways: ["string"],
        meshes: ["string"],
        name: "string",
        project: "string",
    });
    
    type: gcp:networkservices:TlsRoute
    properties:
        description: string
        gateways:
            - string
        meshes:
            - string
        name: string
        project: string
        rules:
            - action:
                destinations:
                    - serviceName: string
                      weight: 0
              matches:
                - alpns:
                    - string
                  sniHosts:
                    - string
    

    TlsRoute Resource Properties

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

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The TlsRoute resource accepts the following input properties:

    Rules List<TlsRouteRule>
    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>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    Meshes List<string>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    Name string
    Name of the TlsRoute resource.
    Project string
    Rules []TlsRouteRuleArgs
    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
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    Meshes []string
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    Name string
    Name of the TlsRoute resource.
    Project string
    rules List<TlsRouteRule>
    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>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes List<String>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name String
    Name of the TlsRoute resource.
    project String
    rules TlsRouteRule[]
    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[]
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes string[]
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name string
    Name of the TlsRoute resource.
    project string
    rules Sequence[TlsRouteRuleArgs]
    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]
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes Sequence[str]
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name str
    Name of the TlsRoute resource.
    project str
    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>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes List<String>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name String
    Name of the TlsRoute resource.
    project String

    Outputs

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

    CreateTime string
    Time the TlsRoute was created in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the TlsRoute was updated in UTC.
    CreateTime string
    Time the TlsRoute was created in UTC.
    Id string
    The provider-assigned unique ID for this managed resource.
    SelfLink string
    Server-defined URL of this resource.
    UpdateTime string
    Time the TlsRoute was updated in UTC.
    createTime String
    Time the TlsRoute was created in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the TlsRoute was updated in UTC.
    createTime string
    Time the TlsRoute was created in UTC.
    id string
    The provider-assigned unique ID for this managed resource.
    selfLink string
    Server-defined URL of this resource.
    updateTime string
    Time the TlsRoute was updated in UTC.
    create_time str
    Time the TlsRoute was created in UTC.
    id str
    The provider-assigned unique ID for this managed resource.
    self_link str
    Server-defined URL of this resource.
    update_time str
    Time the TlsRoute was updated in UTC.
    createTime String
    Time the TlsRoute was created in UTC.
    id String
    The provider-assigned unique ID for this managed resource.
    selfLink String
    Server-defined URL of this resource.
    updateTime String
    Time the TlsRoute was updated in UTC.

    Look up Existing TlsRoute Resource

    Get an existing TlsRoute 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?: TlsRouteState, opts?: CustomResourceOptions): TlsRoute
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            create_time: Optional[str] = None,
            description: Optional[str] = None,
            gateways: Optional[Sequence[str]] = None,
            meshes: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            project: Optional[str] = None,
            rules: Optional[Sequence[TlsRouteRuleArgs]] = None,
            self_link: Optional[str] = None,
            update_time: Optional[str] = None) -> TlsRoute
    func GetTlsRoute(ctx *Context, name string, id IDInput, state *TlsRouteState, opts ...ResourceOption) (*TlsRoute, error)
    public static TlsRoute Get(string name, Input<string> id, TlsRouteState? state, CustomResourceOptions? opts = null)
    public static TlsRoute get(String name, Output<String> id, TlsRouteState 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 TlsRoute was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Gateways List<string>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    Meshes List<string>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    Name string
    Name of the TlsRoute resource.
    Project string
    Rules List<TlsRouteRule>
    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 TlsRoute was updated in UTC.
    CreateTime string
    Time the TlsRoute was created in UTC.
    Description string
    A free-text description of the resource. Max length 1024 characters.
    Gateways []string
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    Meshes []string
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    Name string
    Name of the TlsRoute resource.
    Project string
    Rules []TlsRouteRuleArgs
    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 TlsRoute was updated in UTC.
    createTime String
    Time the TlsRoute was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    gateways List<String>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes List<String>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name String
    Name of the TlsRoute resource.
    project String
    rules List<TlsRouteRule>
    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 TlsRoute was updated in UTC.
    createTime string
    Time the TlsRoute was created in UTC.
    description string
    A free-text description of the resource. Max length 1024 characters.
    gateways string[]
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes string[]
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name string
    Name of the TlsRoute resource.
    project string
    rules TlsRouteRule[]
    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 TlsRoute was updated in UTC.
    create_time str
    Time the TlsRoute was created in UTC.
    description str
    A free-text description of the resource. Max length 1024 characters.
    gateways Sequence[str]
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes Sequence[str]
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name str
    Name of the TlsRoute resource.
    project str
    rules Sequence[TlsRouteRuleArgs]
    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 TlsRoute was updated in UTC.
    createTime String
    Time the TlsRoute was created in UTC.
    description String
    A free-text description of the resource. Max length 1024 characters.
    gateways List<String>
    Gateways defines a list of gateways this TlsRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
    meshes List<String>
    Meshes defines a list of meshes this TlsRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
    name String
    Name of the TlsRoute resource.
    project String
    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 TlsRoute was updated in UTC.

    Supporting Types

    TlsRouteRule, TlsRouteRuleArgs

    Action TlsRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    Matches List<TlsRouteRuleMatch>
    Matches define the predicate used to match requests to a given action. Structure is documented below.
    Action TlsRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    Matches []TlsRouteRuleMatch
    Matches define the predicate used to match requests to a given action. Structure is documented below.
    action TlsRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches List<TlsRouteRuleMatch>
    Matches define the predicate used to match requests to a given action. Structure is documented below.
    action TlsRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches TlsRouteRuleMatch[]
    Matches define the predicate used to match requests to a given action. Structure is documented below.
    action TlsRouteRuleAction
    Required. A detailed rule defining how to route traffic. Structure is documented below.
    matches Sequence[TlsRouteRuleMatch]
    Matches define the predicate used to match requests to a given action. 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 the predicate used to match requests to a given action. Structure is documented below.

    TlsRouteRuleAction, TlsRouteRuleActionArgs

    Destinations List<TlsRouteRuleActionDestination>
    The destination to which traffic should be forwarded. Structure is documented below.
    Destinations []TlsRouteRuleActionDestination
    The destination to which traffic should be forwarded. Structure is documented below.
    destinations List<TlsRouteRuleActionDestination>
    The destination to which traffic should be forwarded. Structure is documented below.
    destinations TlsRouteRuleActionDestination[]
    The destination to which traffic should be forwarded. Structure is documented below.
    destinations Sequence[TlsRouteRuleActionDestination]
    The destination to which traffic should be forwarded. Structure is documented below.
    destinations List<Property Map>
    The destination to which traffic should be forwarded. Structure is documented below.

    TlsRouteRuleActionDestination, TlsRouteRuleActionDestinationArgs

    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.


    TlsRouteRuleMatch, TlsRouteRuleMatchArgs

    Alpns List<string>
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    SniHosts List<string>
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.
    Alpns []string
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    SniHosts []string
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.
    alpns List<String>
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    sniHosts List<String>
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.
    alpns string[]
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    sniHosts string[]
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.
    alpns Sequence[str]
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    sni_hosts Sequence[str]
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.
    alpns List<String>
    ALPN (Application-Layer Protocol Negotiation) to match against. Examples: "http/1.1", "h2". At least one of sniHost and alpn is required. Up to 5 alpns across all matches can be set.
    sniHosts List<String>
    SNI (server name indicator) to match against. SNI will be matched against all wildcard domains, i.e. www.example.com will be first matched against www.example.com, then *.example.com, then *.com. Partial wildcards are not supported, and values like *w.example.com are invalid. At least one of sniHost and alpn is required. Up to 5 sni hosts across all matches can be set.

    Import

    TlsRoute can be imported using any of these accepted formats:

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

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

    • {{name}}

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

    $ pulumi import gcp:networkservices/tlsRoute:TlsRoute default projects/{{project}}/locations/global/tlsRoutes/{{name}}
    
    $ pulumi import gcp:networkservices/tlsRoute:TlsRoute default {{project}}/{{name}}
    
    $ pulumi import gcp:networkservices/tlsRoute:TlsRoute 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 v8.9.3 published on Monday, Nov 18, 2024 by Pulumi