published on Thursday, May 7, 2026 by Pulumi
published on Thursday, May 7, 2026 by Pulumi
TlsRoute defines how traffic should be routed based on SNI and other matching L3 attributes.
To get more information about TlsRoute, see:
Example Usage
Network Services Tls Route Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
name: "backend-service-health-check",
httpsHealthCheck: {
port: 443,
},
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
loadBalancingScheme: "INTERNAL_SELF_MANAGED",
healthChecks: defaultHealthCheck.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_health_check = gcp.compute.HealthCheck("default",
name="backend-service-health-check",
https_health_check={
"port": 443,
})
default = gcp.compute.BackendService("default",
name="my-backend-service",
load_balancing_scheme="INTERNAL_SELF_MANAGED",
health_checks=default_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/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
Name: pulumi.String("backend-service-health-check"),
HttpsHealthCheck: &compute.HealthCheckHttpsHealthCheckArgs{
Port: pulumi.Int(443),
},
})
if err != nil {
return err
}
_default, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("my-backend-service"),
LoadBalancingScheme: pulumi.String("INTERNAL_SELF_MANAGED"),
HealthChecks: defaultHealthCheck.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 defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
{
Name = "backend-service-health-check",
HttpsHealthCheck = new Gcp.Compute.Inputs.HealthCheckHttpsHealthCheckArgs
{
Port = 443,
},
});
var @default = new Gcp.Compute.BackendService("default", new()
{
Name = "my-backend-service",
LoadBalancingScheme = "INTERNAL_SELF_MANAGED",
HealthChecks = defaultHealthCheck.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.HealthCheck;
import com.pulumi.gcp.compute.HealthCheckArgs;
import com.pulumi.gcp.compute.inputs.HealthCheckHttpsHealthCheckArgs;
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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
.name("backend-service-health-check")
.httpsHealthCheck(HealthCheckHttpsHealthCheckArgs.builder()
.port(443)
.build())
.build());
var default_ = new BackendService("default", BackendServiceArgs.builder()
.name("my-backend-service")
.loadBalancingScheme("INTERNAL_SELF_MANAGED")
.healthChecks(defaultHealthCheck.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
loadBalancingScheme: INTERNAL_SELF_MANAGED
healthChecks: ${defaultHealthCheck.id}
defaultHealthCheck:
type: gcp:compute:HealthCheck
name: default
properties:
name: backend-service-health-check
httpsHealthCheck:
port: 443
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 Regional Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
name: "backend-service-health-check",
region: "europe-west4",
timeoutSec: 1,
checkIntervalSec: 1,
tcpHealthCheck: {
port: 80,
},
});
const _default = new gcp.compute.RegionBackendService("default", {
name: "my-backend-service",
protocol: "TCP",
timeoutSec: 10,
region: "europe-west4",
healthChecks: defaultRegionHealthCheck.id,
loadBalancingScheme: "EXTERNAL_MANAGED",
});
const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
name: "my-tls-route",
location: "europe-west4",
rules: [{
matches: [{
sniHosts: ["example.com"],
}],
action: {
destinations: [{
serviceName: _default.selfLink,
}],
},
}],
});
import pulumi
import pulumi_gcp as gcp
default_region_health_check = gcp.compute.RegionHealthCheck("default",
name="backend-service-health-check",
region="europe-west4",
timeout_sec=1,
check_interval_sec=1,
tcp_health_check={
"port": 80,
})
default = gcp.compute.RegionBackendService("default",
name="my-backend-service",
protocol="TCP",
timeout_sec=10,
region="europe-west4",
health_checks=default_region_health_check.id,
load_balancing_scheme="EXTERNAL_MANAGED")
default_tls_route = gcp.networkservices.TlsRoute("default",
name="my-tls-route",
location="europe-west4",
rules=[{
"matches": [{
"sni_hosts": ["example.com"],
}],
"action": {
"destinations": [{
"service_name": default.self_link,
}],
},
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultRegionHealthCheck, err := compute.NewRegionHealthCheck(ctx, "default", &compute.RegionHealthCheckArgs{
Name: pulumi.String("backend-service-health-check"),
Region: pulumi.String("europe-west4"),
TimeoutSec: pulumi.Int(1),
CheckIntervalSec: pulumi.Int(1),
TcpHealthCheck: &compute.RegionHealthCheckTcpHealthCheckArgs{
Port: pulumi.Int(80),
},
})
if err != nil {
return err
}
_default, err := compute.NewRegionBackendService(ctx, "default", &compute.RegionBackendServiceArgs{
Name: pulumi.String("my-backend-service"),
Protocol: pulumi.String("TCP"),
TimeoutSec: pulumi.Int(10),
Region: pulumi.String("europe-west4"),
HealthChecks: defaultRegionHealthCheck.ID(),
LoadBalancingScheme: pulumi.String("EXTERNAL_MANAGED"),
})
if err != nil {
return err
}
_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
Name: pulumi.String("my-tls-route"),
Location: pulumi.String("europe-west4"),
Rules: networkservices.TlsRouteRuleArray{
&networkservices.TlsRouteRuleArgs{
Matches: networkservices.TlsRouteRuleMatchArray{
&networkservices.TlsRouteRuleMatchArgs{
SniHosts: pulumi.StringArray{
pulumi.String("example.com"),
},
},
},
Action: &networkservices.TlsRouteRuleActionArgs{
Destinations: networkservices.TlsRouteRuleActionDestinationArray{
&networkservices.TlsRouteRuleActionDestinationArgs{
ServiceName: _default.SelfLink,
},
},
},
},
},
})
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 defaultRegionHealthCheck = new Gcp.Compute.RegionHealthCheck("default", new()
{
Name = "backend-service-health-check",
Region = "europe-west4",
TimeoutSec = 1,
CheckIntervalSec = 1,
TcpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckTcpHealthCheckArgs
{
Port = 80,
},
});
var @default = new Gcp.Compute.RegionBackendService("default", new()
{
Name = "my-backend-service",
Protocol = "TCP",
TimeoutSec = 10,
Region = "europe-west4",
HealthChecks = defaultRegionHealthCheck.Id,
LoadBalancingScheme = "EXTERNAL_MANAGED",
});
var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
{
Name = "my-tls-route",
Location = "europe-west4",
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
{
SniHosts = new[]
{
"example.com",
},
},
},
Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
{
ServiceName = @default.SelfLink,
},
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionHealthCheck;
import com.pulumi.gcp.compute.RegionHealthCheckArgs;
import com.pulumi.gcp.compute.inputs.RegionHealthCheckTcpHealthCheckArgs;
import com.pulumi.gcp.compute.RegionBackendService;
import com.pulumi.gcp.compute.RegionBackendServiceArgs;
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 defaultRegionHealthCheck = new RegionHealthCheck("defaultRegionHealthCheck", RegionHealthCheckArgs.builder()
.name("backend-service-health-check")
.region("europe-west4")
.timeoutSec(1)
.checkIntervalSec(1)
.tcpHealthCheck(RegionHealthCheckTcpHealthCheckArgs.builder()
.port(80)
.build())
.build());
var default_ = new RegionBackendService("default", RegionBackendServiceArgs.builder()
.name("my-backend-service")
.protocol("TCP")
.timeoutSec(10)
.region("europe-west4")
.healthChecks(defaultRegionHealthCheck.id())
.loadBalancingScheme("EXTERNAL_MANAGED")
.build());
var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
.name("my-tls-route")
.location("europe-west4")
.rules(TlsRouteRuleArgs.builder()
.matches(TlsRouteRuleMatchArgs.builder()
.sniHosts("example.com")
.build())
.action(TlsRouteRuleActionArgs.builder()
.destinations(TlsRouteRuleActionDestinationArgs.builder()
.serviceName(default_.selfLink())
.build())
.build())
.build())
.build());
}
}
resources:
default:
type: gcp:compute:RegionBackendService
properties:
name: my-backend-service
protocol: TCP
timeoutSec: 10
region: europe-west4
healthChecks: ${defaultRegionHealthCheck.id}
loadBalancingScheme: EXTERNAL_MANAGED
defaultRegionHealthCheck:
type: gcp:compute:RegionHealthCheck
name: default
properties:
name: backend-service-health-check
region: europe-west4
timeoutSec: 1
checkIntervalSec: 1
tcpHealthCheck:
port: '80'
defaultTlsRoute:
type: gcp:networkservices:TlsRoute
name: default
properties:
name: my-tls-route
location: europe-west4
rules:
- matches:
- sniHosts:
- example.com
action:
destinations:
- serviceName: ${default.selfLink}
Network Services Tls Route Mesh Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
name: "backend-service-health-check",
httpsHealthCheck: {
port: 443,
},
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
loadBalancingScheme: "INTERNAL_SELF_MANAGED",
healthChecks: defaultHealthCheck.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_health_check = gcp.compute.HealthCheck("default",
name="backend-service-health-check",
https_health_check={
"port": 443,
})
default = gcp.compute.BackendService("default",
name="my-backend-service",
load_balancing_scheme="INTERNAL_SELF_MANAGED",
health_checks=default_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/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
Name: pulumi.String("backend-service-health-check"),
HttpsHealthCheck: &compute.HealthCheckHttpsHealthCheckArgs{
Port: pulumi.Int(443),
},
})
if err != nil {
return err
}
_default, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("my-backend-service"),
LoadBalancingScheme: pulumi.String("INTERNAL_SELF_MANAGED"),
HealthChecks: defaultHealthCheck.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 defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
{
Name = "backend-service-health-check",
HttpsHealthCheck = new Gcp.Compute.Inputs.HealthCheckHttpsHealthCheckArgs
{
Port = 443,
},
});
var @default = new Gcp.Compute.BackendService("default", new()
{
Name = "my-backend-service",
LoadBalancingScheme = "INTERNAL_SELF_MANAGED",
HealthChecks = defaultHealthCheck.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.HealthCheck;
import com.pulumi.gcp.compute.HealthCheckArgs;
import com.pulumi.gcp.compute.inputs.HealthCheckHttpsHealthCheckArgs;
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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
.name("backend-service-health-check")
.httpsHealthCheck(HealthCheckHttpsHealthCheckArgs.builder()
.port(443)
.build())
.build());
var default_ = new BackendService("default", BackendServiceArgs.builder()
.name("my-backend-service")
.loadBalancingScheme("INTERNAL_SELF_MANAGED")
.healthChecks(defaultHealthCheck.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
loadBalancingScheme: INTERNAL_SELF_MANAGED
healthChecks: ${defaultHealthCheck.id}
defaultHealthCheck:
type: gcp:compute:HealthCheck
name: default
properties:
name: backend-service-health-check
httpsHealthCheck:
port: 443
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 defaultHealthCheck = new gcp.compute.HealthCheck("default", {
name: "backend-service-health-check",
httpsHealthCheck: {
port: 443,
},
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
loadBalancingScheme: "INTERNAL_SELF_MANAGED",
healthChecks: defaultHealthCheck.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_health_check = gcp.compute.HealthCheck("default",
name="backend-service-health-check",
https_health_check={
"port": 443,
})
default = gcp.compute.BackendService("default",
name="my-backend-service",
load_balancing_scheme="INTERNAL_SELF_MANAGED",
health_checks=default_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/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
Name: pulumi.String("backend-service-health-check"),
HttpsHealthCheck: &compute.HealthCheckHttpsHealthCheckArgs{
Port: pulumi.Int(443),
},
})
if err != nil {
return err
}
_default, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("my-backend-service"),
LoadBalancingScheme: pulumi.String("INTERNAL_SELF_MANAGED"),
HealthChecks: defaultHealthCheck.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 defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
{
Name = "backend-service-health-check",
HttpsHealthCheck = new Gcp.Compute.Inputs.HealthCheckHttpsHealthCheckArgs
{
Port = 443,
},
});
var @default = new Gcp.Compute.BackendService("default", new()
{
Name = "my-backend-service",
LoadBalancingScheme = "INTERNAL_SELF_MANAGED",
HealthChecks = defaultHealthCheck.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.HealthCheck;
import com.pulumi.gcp.compute.HealthCheckArgs;
import com.pulumi.gcp.compute.inputs.HealthCheckHttpsHealthCheckArgs;
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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
.name("backend-service-health-check")
.httpsHealthCheck(HealthCheckHttpsHealthCheckArgs.builder()
.port(443)
.build())
.build());
var default_ = new BackendService("default", BackendServiceArgs.builder()
.name("my-backend-service")
.loadBalancingScheme("INTERNAL_SELF_MANAGED")
.healthChecks(defaultHealthCheck.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
loadBalancingScheme: INTERNAL_SELF_MANAGED
healthChecks: ${defaultHealthCheck.id}
defaultHealthCheck:
type: gcp:compute:HealthCheck
name: default
properties:
name: backend-service-health-check
httpsHealthCheck:
port: 443
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
Network Services Tls Route Target Tcp Proxy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHealthCheck = new gcp.compute.HealthCheck("default", {
name: "my-health-check",
httpsHealthCheck: {
port: 443,
},
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
loadBalancingScheme: "INTERNAL_MANAGED",
protocol: "TCP",
healthChecks: defaultHealthCheck.id,
});
const defaultTargetTCPProxy = new gcp.compute.TargetTCPProxy("default", {
name: "my-target-tcp-proxy",
loadBalancingScheme: "INTERNAL_MANAGED",
});
const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
name: "my-tls-route",
targetProxies: [defaultTargetTCPProxy.id],
rules: [{
matches: [{
sniHosts: ["example.com"],
}],
action: {
destinations: [{
serviceName: _default.id,
}],
},
}],
});
import pulumi
import pulumi_gcp as gcp
default_health_check = gcp.compute.HealthCheck("default",
name="my-health-check",
https_health_check={
"port": 443,
})
default = gcp.compute.BackendService("default",
name="my-backend-service",
load_balancing_scheme="INTERNAL_MANAGED",
protocol="TCP",
health_checks=default_health_check.id)
default_target_tcp_proxy = gcp.compute.TargetTCPProxy("default",
name="my-target-tcp-proxy",
load_balancing_scheme="INTERNAL_MANAGED")
default_tls_route = gcp.networkservices.TlsRoute("default",
name="my-tls-route",
target_proxies=[default_target_tcp_proxy.id],
rules=[{
"matches": [{
"sni_hosts": ["example.com"],
}],
"action": {
"destinations": [{
"service_name": default.id,
}],
},
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultHealthCheck, err := compute.NewHealthCheck(ctx, "default", &compute.HealthCheckArgs{
Name: pulumi.String("my-health-check"),
HttpsHealthCheck: &compute.HealthCheckHttpsHealthCheckArgs{
Port: pulumi.Int(443),
},
})
if err != nil {
return err
}
_default, err := compute.NewBackendService(ctx, "default", &compute.BackendServiceArgs{
Name: pulumi.String("my-backend-service"),
LoadBalancingScheme: pulumi.String("INTERNAL_MANAGED"),
Protocol: pulumi.String("TCP"),
HealthChecks: defaultHealthCheck.ID(),
})
if err != nil {
return err
}
defaultTargetTCPProxy, err := compute.NewTargetTCPProxy(ctx, "default", &compute.TargetTCPProxyArgs{
Name: pulumi.String("my-target-tcp-proxy"),
LoadBalancingScheme: pulumi.String("INTERNAL_MANAGED"),
})
if err != nil {
return err
}
_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
Name: pulumi.String("my-tls-route"),
TargetProxies: pulumi.StringArray{
defaultTargetTCPProxy.ID(),
},
Rules: networkservices.TlsRouteRuleArray{
&networkservices.TlsRouteRuleArgs{
Matches: networkservices.TlsRouteRuleMatchArray{
&networkservices.TlsRouteRuleMatchArgs{
SniHosts: pulumi.StringArray{
pulumi.String("example.com"),
},
},
},
Action: &networkservices.TlsRouteRuleActionArgs{
Destinations: networkservices.TlsRouteRuleActionDestinationArray{
&networkservices.TlsRouteRuleActionDestinationArgs{
ServiceName: _default.ID(),
},
},
},
},
},
})
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 defaultHealthCheck = new Gcp.Compute.HealthCheck("default", new()
{
Name = "my-health-check",
HttpsHealthCheck = new Gcp.Compute.Inputs.HealthCheckHttpsHealthCheckArgs
{
Port = 443,
},
});
var @default = new Gcp.Compute.BackendService("default", new()
{
Name = "my-backend-service",
LoadBalancingScheme = "INTERNAL_MANAGED",
Protocol = "TCP",
HealthChecks = defaultHealthCheck.Id,
});
var defaultTargetTCPProxy = new Gcp.Compute.TargetTCPProxy("default", new()
{
Name = "my-target-tcp-proxy",
LoadBalancingScheme = "INTERNAL_MANAGED",
});
var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
{
Name = "my-tls-route",
TargetProxies = new[]
{
defaultTargetTCPProxy.Id,
},
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
{
SniHosts = new[]
{
"example.com",
},
},
},
Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
{
ServiceName = @default.Id,
},
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.HealthCheck;
import com.pulumi.gcp.compute.HealthCheckArgs;
import com.pulumi.gcp.compute.inputs.HealthCheckHttpsHealthCheckArgs;
import com.pulumi.gcp.compute.BackendService;
import com.pulumi.gcp.compute.BackendServiceArgs;
import com.pulumi.gcp.compute.TargetTCPProxy;
import com.pulumi.gcp.compute.TargetTCPProxyArgs;
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 defaultHealthCheck = new HealthCheck("defaultHealthCheck", HealthCheckArgs.builder()
.name("my-health-check")
.httpsHealthCheck(HealthCheckHttpsHealthCheckArgs.builder()
.port(443)
.build())
.build());
var default_ = new BackendService("default", BackendServiceArgs.builder()
.name("my-backend-service")
.loadBalancingScheme("INTERNAL_MANAGED")
.protocol("TCP")
.healthChecks(defaultHealthCheck.id())
.build());
var defaultTargetTCPProxy = new TargetTCPProxy("defaultTargetTCPProxy", TargetTCPProxyArgs.builder()
.name("my-target-tcp-proxy")
.loadBalancingScheme("INTERNAL_MANAGED")
.build());
var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
.name("my-tls-route")
.targetProxies(defaultTargetTCPProxy.id())
.rules(TlsRouteRuleArgs.builder()
.matches(TlsRouteRuleMatchArgs.builder()
.sniHosts("example.com")
.build())
.action(TlsRouteRuleActionArgs.builder()
.destinations(TlsRouteRuleActionDestinationArgs.builder()
.serviceName(default_.id())
.build())
.build())
.build())
.build());
}
}
resources:
default:
type: gcp:compute:BackendService
properties:
name: my-backend-service
loadBalancingScheme: INTERNAL_MANAGED
protocol: TCP
healthChecks: ${defaultHealthCheck.id}
defaultHealthCheck:
type: gcp:compute:HealthCheck
name: default
properties:
name: my-health-check
httpsHealthCheck:
port: 443
defaultTargetTCPProxy:
type: gcp:compute:TargetTCPProxy
name: default
properties:
name: my-target-tcp-proxy
loadBalancingScheme: INTERNAL_MANAGED
defaultTlsRoute:
type: gcp:networkservices:TlsRoute
name: default
properties:
name: my-tls-route
targetProxies:
- ${defaultTargetTCPProxy.id}
rules:
- matches:
- sniHosts:
- example.com
action:
destinations:
- serviceName: ${default.id}
Network Services Tls Route Region Target Tcp Proxy Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultRegionHealthCheck = new gcp.compute.RegionHealthCheck("default", {
name: "my-health-check",
region: "europe-west4",
timeoutSec: 1,
checkIntervalSec: 1,
tcpHealthCheck: {
port: 80,
},
});
const _default = new gcp.compute.RegionBackendService("default", {
name: "my-backend-service",
protocol: "TCP",
timeoutSec: 10,
region: "europe-west4",
healthChecks: defaultRegionHealthCheck.id,
loadBalancingScheme: "EXTERNAL_MANAGED",
});
const defaultRegionTargetTcpProxy = new gcp.compute.RegionTargetTcpProxy("default", {
name: "my-target-tcp-proxy",
region: "europe-west4",
loadBalancingScheme: "EXTERNAL_MANAGED",
});
const defaultTlsRoute = new gcp.networkservices.TlsRoute("default", {
name: "my-tls-route",
location: "europe-west4",
targetProxies: [defaultRegionTargetTcpProxy.selfLink],
rules: [{
matches: [{
sniHosts: ["example.com"],
}],
action: {
destinations: [{
serviceName: _default.selfLink,
}],
},
}],
});
import pulumi
import pulumi_gcp as gcp
default_region_health_check = gcp.compute.RegionHealthCheck("default",
name="my-health-check",
region="europe-west4",
timeout_sec=1,
check_interval_sec=1,
tcp_health_check={
"port": 80,
})
default = gcp.compute.RegionBackendService("default",
name="my-backend-service",
protocol="TCP",
timeout_sec=10,
region="europe-west4",
health_checks=default_region_health_check.id,
load_balancing_scheme="EXTERNAL_MANAGED")
default_region_target_tcp_proxy = gcp.compute.RegionTargetTcpProxy("default",
name="my-target-tcp-proxy",
region="europe-west4",
load_balancing_scheme="EXTERNAL_MANAGED")
default_tls_route = gcp.networkservices.TlsRoute("default",
name="my-tls-route",
location="europe-west4",
target_proxies=[default_region_target_tcp_proxy.self_link],
rules=[{
"matches": [{
"sni_hosts": ["example.com"],
}],
"action": {
"destinations": [{
"service_name": default.self_link,
}],
},
}])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
defaultRegionHealthCheck, err := compute.NewRegionHealthCheck(ctx, "default", &compute.RegionHealthCheckArgs{
Name: pulumi.String("my-health-check"),
Region: pulumi.String("europe-west4"),
TimeoutSec: pulumi.Int(1),
CheckIntervalSec: pulumi.Int(1),
TcpHealthCheck: &compute.RegionHealthCheckTcpHealthCheckArgs{
Port: pulumi.Int(80),
},
})
if err != nil {
return err
}
_default, err := compute.NewRegionBackendService(ctx, "default", &compute.RegionBackendServiceArgs{
Name: pulumi.String("my-backend-service"),
Protocol: pulumi.String("TCP"),
TimeoutSec: pulumi.Int(10),
Region: pulumi.String("europe-west4"),
HealthChecks: defaultRegionHealthCheck.ID(),
LoadBalancingScheme: pulumi.String("EXTERNAL_MANAGED"),
})
if err != nil {
return err
}
defaultRegionTargetTcpProxy, err := compute.NewRegionTargetTcpProxy(ctx, "default", &compute.RegionTargetTcpProxyArgs{
Name: pulumi.String("my-target-tcp-proxy"),
Region: pulumi.String("europe-west4"),
LoadBalancingScheme: pulumi.String("EXTERNAL_MANAGED"),
})
if err != nil {
return err
}
_, err = networkservices.NewTlsRoute(ctx, "default", &networkservices.TlsRouteArgs{
Name: pulumi.String("my-tls-route"),
Location: pulumi.String("europe-west4"),
TargetProxies: pulumi.StringArray{
defaultRegionTargetTcpProxy.SelfLink,
},
Rules: networkservices.TlsRouteRuleArray{
&networkservices.TlsRouteRuleArgs{
Matches: networkservices.TlsRouteRuleMatchArray{
&networkservices.TlsRouteRuleMatchArgs{
SniHosts: pulumi.StringArray{
pulumi.String("example.com"),
},
},
},
Action: &networkservices.TlsRouteRuleActionArgs{
Destinations: networkservices.TlsRouteRuleActionDestinationArray{
&networkservices.TlsRouteRuleActionDestinationArgs{
ServiceName: _default.SelfLink,
},
},
},
},
},
})
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 defaultRegionHealthCheck = new Gcp.Compute.RegionHealthCheck("default", new()
{
Name = "my-health-check",
Region = "europe-west4",
TimeoutSec = 1,
CheckIntervalSec = 1,
TcpHealthCheck = new Gcp.Compute.Inputs.RegionHealthCheckTcpHealthCheckArgs
{
Port = 80,
},
});
var @default = new Gcp.Compute.RegionBackendService("default", new()
{
Name = "my-backend-service",
Protocol = "TCP",
TimeoutSec = 10,
Region = "europe-west4",
HealthChecks = defaultRegionHealthCheck.Id,
LoadBalancingScheme = "EXTERNAL_MANAGED",
});
var defaultRegionTargetTcpProxy = new Gcp.Compute.RegionTargetTcpProxy("default", new()
{
Name = "my-target-tcp-proxy",
Region = "europe-west4",
LoadBalancingScheme = "EXTERNAL_MANAGED",
});
var defaultTlsRoute = new Gcp.NetworkServices.TlsRoute("default", new()
{
Name = "my-tls-route",
Location = "europe-west4",
TargetProxies = new[]
{
defaultRegionTargetTcpProxy.SelfLink,
},
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleMatchArgs
{
SniHosts = new[]
{
"example.com",
},
},
},
Action = new Gcp.NetworkServices.Inputs.TlsRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TlsRouteRuleActionDestinationArgs
{
ServiceName = @default.SelfLink,
},
},
},
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.compute.RegionHealthCheck;
import com.pulumi.gcp.compute.RegionHealthCheckArgs;
import com.pulumi.gcp.compute.inputs.RegionHealthCheckTcpHealthCheckArgs;
import com.pulumi.gcp.compute.RegionBackendService;
import com.pulumi.gcp.compute.RegionBackendServiceArgs;
import com.pulumi.gcp.compute.RegionTargetTcpProxy;
import com.pulumi.gcp.compute.RegionTargetTcpProxyArgs;
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 defaultRegionHealthCheck = new RegionHealthCheck("defaultRegionHealthCheck", RegionHealthCheckArgs.builder()
.name("my-health-check")
.region("europe-west4")
.timeoutSec(1)
.checkIntervalSec(1)
.tcpHealthCheck(RegionHealthCheckTcpHealthCheckArgs.builder()
.port(80)
.build())
.build());
var default_ = new RegionBackendService("default", RegionBackendServiceArgs.builder()
.name("my-backend-service")
.protocol("TCP")
.timeoutSec(10)
.region("europe-west4")
.healthChecks(defaultRegionHealthCheck.id())
.loadBalancingScheme("EXTERNAL_MANAGED")
.build());
var defaultRegionTargetTcpProxy = new RegionTargetTcpProxy("defaultRegionTargetTcpProxy", RegionTargetTcpProxyArgs.builder()
.name("my-target-tcp-proxy")
.region("europe-west4")
.loadBalancingScheme("EXTERNAL_MANAGED")
.build());
var defaultTlsRoute = new TlsRoute("defaultTlsRoute", TlsRouteArgs.builder()
.name("my-tls-route")
.location("europe-west4")
.targetProxies(defaultRegionTargetTcpProxy.selfLink())
.rules(TlsRouteRuleArgs.builder()
.matches(TlsRouteRuleMatchArgs.builder()
.sniHosts("example.com")
.build())
.action(TlsRouteRuleActionArgs.builder()
.destinations(TlsRouteRuleActionDestinationArgs.builder()
.serviceName(default_.selfLink())
.build())
.build())
.build())
.build());
}
}
resources:
default:
type: gcp:compute:RegionBackendService
properties:
name: my-backend-service
protocol: TCP
timeoutSec: 10
region: europe-west4
healthChecks: ${defaultRegionHealthCheck.id}
loadBalancingScheme: EXTERNAL_MANAGED
defaultRegionHealthCheck:
type: gcp:compute:RegionHealthCheck
name: default
properties:
name: my-health-check
region: europe-west4
timeoutSec: 1
checkIntervalSec: 1
tcpHealthCheck:
port: '80'
defaultRegionTargetTcpProxy:
type: gcp:compute:RegionTargetTcpProxy
name: default
properties:
name: my-target-tcp-proxy
region: europe-west4
loadBalancingScheme: EXTERNAL_MANAGED
defaultTlsRoute:
type: gcp:networkservices:TlsRoute
name: default
properties:
name: my-tls-route
location: europe-west4
targetProxies:
- ${defaultRegionTargetTcpProxy.selfLink}
rules:
- matches:
- sniHosts:
- example.com
action:
destinations:
- serviceName: ${default.selfLink}
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,
location: Optional[str] = None,
meshes: Optional[Sequence[str]] = None,
name: Optional[str] = None,
project: Optional[str] = None,
target_proxies: Optional[Sequence[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",
},
Location = "string",
Meshes = new[]
{
"string",
},
Name = "string",
Project = "string",
TargetProxies = new[]
{
"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"),
},
Location: pulumi.String("string"),
Meshes: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Project: pulumi.String("string"),
TargetProxies: pulumi.StringArray{
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")
.location("string")
.meshes("string")
.name("string")
.project("string")
.targetProxies("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"],
location="string",
meshes=["string"],
name="string",
project="string",
target_proxies=["string"])
const tlsRouteResource = new gcp.networkservices.TlsRoute("tlsRouteResource", {
rules: [{
action: {
destinations: [{
serviceName: "string",
weight: 0,
}],
},
matches: [{
alpns: ["string"],
sniHosts: ["string"],
}],
}],
description: "string",
gateways: ["string"],
location: "string",
meshes: ["string"],
name: "string",
project: "string",
targetProxies: ["string"],
});
type: gcp:networkservices:TlsRoute
properties:
description: string
gateways:
- string
location: string
meshes:
- string
name: string
project: string
rules:
- action:
destinations:
- serviceName: string
weight: 0
matches:
- alpns:
- string
sniHosts:
- string
targetProxies:
- 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<Tls
Route Rule> - 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//gateways/<gateway_name>
- Location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TlsRoute resource.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Target
Proxies List<string> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- Rules
[]Tls
Route Rule Args - 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//gateways/<gateway_name>
- Location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TlsRoute resource.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Target
Proxies []string - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- rules
List<Tls
Route Rule> - 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//gateways/<gateway_name>
- location String
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TlsRoute resource.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- target
Proxies List<String> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- rules
Tls
Route Rule[] - 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//gateways/<gateway_name>
- location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name string
- Name of the TlsRoute resource.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- target
Proxies string[] - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- rules
Sequence[Tls
Route Rule Args] - 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//gateways/<gateway_name>
- location str
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name str
- Name of the TlsRoute resource.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- target_
proxies Sequence[str] - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- 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//gateways/<gateway_name>
- location String
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TlsRoute resource.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- target
Proxies List<String> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
Outputs
All input properties are implicitly available as output properties. Additionally, the TlsRoute resource produces the following output properties:
- Create
Time string - Time the TlsRoute was created in UTC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TlsRoute was updated in UTC.
- Create
Time string - Time the TlsRoute was created in UTC.
- Id string
- The provider-assigned unique ID for this managed resource.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TlsRoute was updated in UTC.
- create
Time String - Time the TlsRoute was created in UTC.
- id String
- The provider-assigned unique ID for this managed resource.
- self
Link String - Server-defined URL of this resource.
- update
Time String - Time the TlsRoute was updated in UTC.
- create
Time string - Time the TlsRoute was created in UTC.
- id string
- The provider-assigned unique ID for this managed resource.
- self
Link string - Server-defined URL of this resource.
- update
Time 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.
- create
Time String - Time the TlsRoute was created in UTC.
- id String
- The provider-assigned unique ID for this managed resource.
- self
Link String - Server-defined URL of this resource.
- update
Time 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,
location: Optional[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,
target_proxies: Optional[Sequence[str]] = None,
update_time: Optional[str] = None) -> TlsRoutefunc 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)resources: _: type: gcp:networkservices:TlsRoute get: id: ${id}- 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.
- Create
Time 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//gateways/<gateway_name>
- Location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TlsRoute resource.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rules
List<Tls
Route Rule> - Rules that define how traffic is routed and handled. Structure is documented below.
- Self
Link string - Server-defined URL of this resource.
- Target
Proxies List<string> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- Update
Time string - Time the TlsRoute was updated in UTC.
- Create
Time 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//gateways/<gateway_name>
- Location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TlsRoute resource.
- Project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- Rules
[]Tls
Route Rule Args - Rules that define how traffic is routed and handled. Structure is documented below.
- Self
Link string - Server-defined URL of this resource.
- Target
Proxies []string - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- Update
Time string - Time the TlsRoute was updated in UTC.
- create
Time 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//gateways/<gateway_name>
- location String
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TlsRoute resource.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rules
List<Tls
Route Rule> - Rules that define how traffic is routed and handled. Structure is documented below.
- self
Link String - Server-defined URL of this resource.
- target
Proxies List<String> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- update
Time String - Time the TlsRoute was updated in UTC.
- create
Time 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//gateways/<gateway_name>
- location string
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name string
- Name of the TlsRoute resource.
- project string
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rules
Tls
Route Rule[] - Rules that define how traffic is routed and handled. Structure is documented below.
- self
Link string - Server-defined URL of this resource.
- target
Proxies string[] - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- update
Time 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//gateways/<gateway_name>
- location str
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name str
- Name of the TlsRoute resource.
- project str
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rules
Sequence[Tls
Route Rule Args] - Rules that define how traffic is routed and handled. Structure is documented below.
- self_
link str - Server-defined URL of this resource.
- target_
proxies Sequence[str] - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- update_
time str - Time the TlsRoute was updated in UTC.
- create
Time 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//gateways/<gateway_name>
- location String
- Location (region) of the TLS Route.
- 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//meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TlsRoute resource.
- project String
- The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
- rules List<Property Map>
- Rules that define how traffic is routed and handled. Structure is documented below.
- self
Link String - Server-defined URL of this resource.
- target
Proxies List<String> - TargetProxies defines a list of target proxies this TlsRoute is attached to, as one of the routing rules to route the requests served by the load balancer. Each target proxy reference should match the pattern: projects/*/locations/global/targetTcpProxies/<target_tcp_proxy_name>
- update
Time String - Time the TlsRoute was updated in UTC.
Supporting Types
TlsRouteRule, TlsRouteRuleArgs
- Action
Tls
Route Rule Action - Required. A detailed rule defining how to route traffic. Structure is documented below.
- Matches
List<Tls
Route Rule Match> - Matches define the predicate used to match requests to a given action. Structure is documented below.
- Action
Tls
Route Rule Action - Required. A detailed rule defining how to route traffic. Structure is documented below.
- Matches
[]Tls
Route Rule Match - Matches define the predicate used to match requests to a given action. Structure is documented below.
- action
Tls
Route Rule Action - Required. A detailed rule defining how to route traffic. Structure is documented below.
- matches
List<Tls
Route Rule Match> - Matches define the predicate used to match requests to a given action. Structure is documented below.
- action
Tls
Route Rule Action - Required. A detailed rule defining how to route traffic. Structure is documented below.
- matches
Tls
Route Rule Match[] - Matches define the predicate used to match requests to a given action. Structure is documented below.
- action
Tls
Route Rule Action - Required. A detailed rule defining how to route traffic. Structure is documented below.
- matches
Sequence[Tls
Route Rule Match] - 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<Tls
Route Rule Action Destination> - The destination to which traffic should be forwarded. Structure is documented below.
- Destinations
[]Tls
Route Rule Action Destination - The destination to which traffic should be forwarded. Structure is documented below.
- destinations
List<Tls
Route Rule Action Destination> - The destination to which traffic should be forwarded. Structure is documented below.
- destinations
Tls
Route Rule Action Destination[] - The destination to which traffic should be forwarded. Structure is documented below.
- destinations
Sequence[Tls
Route Rule Action Destination] - 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
- Service
Name 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.
- Service
Name 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.
- service
Name 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.
- service
Name 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.
- service
Name 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.
- Sni
Hosts 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.
- Sni
Hosts []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.
- sni
Hosts 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.
- sni
Hosts 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.
- sni
Hosts 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/{{location}}/tlsRoutes/{{name}}projects/{{project}}/locations/global/tlsRoutes/{{name}}{{project}}/{{location}}/{{name}}{{location}}/{{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/{{location}}/tlsRoutes/{{name}}
$ pulumi import gcp:networkservices/tlsRoute:TlsRoute default projects/{{project}}/locations/global/tlsRoutes/{{name}}
$ pulumi import gcp:networkservices/tlsRoute:TlsRoute default {{project}}/{{location}}/{{name}}
$ pulumi import gcp:networkservices/tlsRoute:TlsRoute default {{location}}/{{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-betaTerraform Provider.
published on Thursday, May 7, 2026 by Pulumi
