gcp.networkservices.TcpRoute
Explore with Pulumi AI
Example Usage
Network Services Tcp 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 defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
name: "my-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
rules: [{
matches: [{
address: "10.0.0.1/32",
port: "8081",
}],
action: {
destinations: [{
serviceName: _default.id,
weight: 1,
}],
originalDestination: false,
},
}],
});
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_tcp_route = gcp.networkservices.TcpRoute("default",
name="my-tcp-route",
labels={
"foo": "bar",
},
description="my description",
rules=[gcp.networkservices.TcpRouteRuleArgs(
matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
address="10.0.0.1/32",
port="8081",
)],
action=gcp.networkservices.TcpRouteRuleActionArgs(
destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
service_name=default.id,
weight=1,
)],
original_destination=False,
),
)])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
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.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
Name: pulumi.String("my-tcp-route"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
Rules: networkservices.TcpRouteRuleArray{
&networkservices.TcpRouteRuleArgs{
Matches: networkservices.TcpRouteRuleMatchArray{
&networkservices.TcpRouteRuleMatchArgs{
Address: pulumi.String("10.0.0.1/32"),
Port: pulumi.String("8081"),
},
},
Action: &networkservices.TcpRouteRuleActionArgs{
Destinations: networkservices.TcpRouteRuleActionDestinationArray{
&networkservices.TcpRouteRuleActionDestinationArgs{
ServiceName: _default.ID(),
Weight: pulumi.Int(1),
},
},
OriginalDestination: pulumi.Bool(false),
},
},
},
})
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 defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
{
Name = "my-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
{
Address = "10.0.0.1/32",
Port = "8081",
},
},
Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
{
ServiceName = @default.Id,
Weight = 1,
},
},
OriginalDestination = false,
},
},
},
});
});
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.TcpRoute;
import com.pulumi.gcp.networkservices.TcpRouteArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
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 defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
.name("my-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.rules(TcpRouteRuleArgs.builder()
.matches(TcpRouteRuleMatchArgs.builder()
.address("10.0.0.1/32")
.port("8081")
.build())
.action(TcpRouteRuleActionArgs.builder()
.destinations(TcpRouteRuleActionDestinationArgs.builder()
.serviceName(default_.id())
.weight(1)
.build())
.originalDestination(false)
.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
defaultTcpRoute:
type: gcp:networkservices:TcpRoute
name: default
properties:
name: my-tcp-route
labels:
foo: bar
description: my description
rules:
- matches:
- address: 10.0.0.1/32
port: '8081'
action:
destinations:
- serviceName: ${default.id}
weight: 1
originalDestination: false
Network Services Tcp Route Actions
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
name: "backend-service-health-check",
requestPath: "/",
checkIntervalSec: 1,
timeoutSec: 1,
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
healthChecks: defaultHttpHealthCheck.id,
});
const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
name: "my-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
rules: [{
action: {
destinations: [{
serviceName: _default.id,
weight: 1,
}],
originalDestination: false,
},
}],
});
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_tcp_route = gcp.networkservices.TcpRoute("default",
name="my-tcp-route",
labels={
"foo": "bar",
},
description="my description",
rules=[gcp.networkservices.TcpRouteRuleArgs(
action=gcp.networkservices.TcpRouteRuleActionArgs(
destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
service_name=default.id,
weight=1,
)],
original_destination=False,
),
)])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
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.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
Name: pulumi.String("my-tcp-route"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
Rules: networkservices.TcpRouteRuleArray{
&networkservices.TcpRouteRuleArgs{
Action: &networkservices.TcpRouteRuleActionArgs{
Destinations: networkservices.TcpRouteRuleActionDestinationArray{
&networkservices.TcpRouteRuleActionDestinationArgs{
ServiceName: _default.ID(),
Weight: pulumi.Int(1),
},
},
OriginalDestination: pulumi.Bool(false),
},
},
},
})
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 defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
{
Name = "my-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
{
Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
{
ServiceName = @default.Id,
Weight = 1,
},
},
OriginalDestination = false,
},
},
},
});
});
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.TcpRoute;
import com.pulumi.gcp.networkservices.TcpRouteArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
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 defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
.name("my-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.rules(TcpRouteRuleArgs.builder()
.action(TcpRouteRuleActionArgs.builder()
.destinations(TcpRouteRuleActionDestinationArgs.builder()
.serviceName(default_.id())
.weight(1)
.build())
.originalDestination(false)
.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
defaultTcpRoute:
type: gcp:networkservices:TcpRoute
name: default
properties:
name: my-tcp-route
labels:
foo: bar
description: my description
rules:
- action:
destinations:
- serviceName: ${default.id}
weight: 1
originalDestination: false
Network Services Tcp 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-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
});
const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
name: "my-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
meshes: [defaultMesh.id],
rules: [{
matches: [{
address: "10.0.0.1/32",
port: "8081",
}],
action: {
destinations: [{
serviceName: _default.id,
weight: 1,
}],
originalDestination: false,
},
}],
});
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-tcp-route",
labels={
"foo": "bar",
},
description="my description")
default_tcp_route = gcp.networkservices.TcpRoute("default",
name="my-tcp-route",
labels={
"foo": "bar",
},
description="my description",
meshes=[default_mesh.id],
rules=[gcp.networkservices.TcpRouteRuleArgs(
matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
address="10.0.0.1/32",
port="8081",
)],
action=gcp.networkservices.TcpRouteRuleActionArgs(
destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
service_name=default.id,
weight=1,
)],
original_destination=False,
),
)])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
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-tcp-route"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
})
if err != nil {
return err
}
_, err = networkservices.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
Name: pulumi.String("my-tcp-route"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
Meshes: pulumi.StringArray{
defaultMesh.ID(),
},
Rules: networkservices.TcpRouteRuleArray{
&networkservices.TcpRouteRuleArgs{
Matches: networkservices.TcpRouteRuleMatchArray{
&networkservices.TcpRouteRuleMatchArgs{
Address: pulumi.String("10.0.0.1/32"),
Port: pulumi.String("8081"),
},
},
Action: &networkservices.TcpRouteRuleActionArgs{
Destinations: networkservices.TcpRouteRuleActionDestinationArray{
&networkservices.TcpRouteRuleActionDestinationArgs{
ServiceName: _default.ID(),
Weight: pulumi.Int(1),
},
},
OriginalDestination: pulumi.Bool(false),
},
},
},
})
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-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
});
var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
{
Name = "my-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Meshes = new[]
{
defaultMesh.Id,
},
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
{
Address = "10.0.0.1/32",
Port = "8081",
},
},
Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
{
ServiceName = @default.Id,
Weight = 1,
},
},
OriginalDestination = false,
},
},
},
});
});
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.TcpRoute;
import com.pulumi.gcp.networkservices.TcpRouteArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
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-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.build());
var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
.name("my-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.meshes(defaultMesh.id())
.rules(TcpRouteRuleArgs.builder()
.matches(TcpRouteRuleMatchArgs.builder()
.address("10.0.0.1/32")
.port("8081")
.build())
.action(TcpRouteRuleActionArgs.builder()
.destinations(TcpRouteRuleActionDestinationArgs.builder()
.serviceName(default_.id())
.weight(1)
.build())
.originalDestination(false)
.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-tcp-route
labels:
foo: bar
description: my description
defaultTcpRoute:
type: gcp:networkservices:TcpRoute
name: default
properties:
name: my-tcp-route
labels:
foo: bar
description: my description
meshes:
- ${defaultMesh.id}
rules:
- matches:
- address: 10.0.0.1/32
port: '8081'
action:
destinations:
- serviceName: ${default.id}
weight: 1
originalDestination: false
Network Services Tcp Route Gateway Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const defaultHttpHealthCheck = new gcp.compute.HttpHealthCheck("default", {
name: "backend-service-health-check",
requestPath: "/",
checkIntervalSec: 1,
timeoutSec: 1,
});
const _default = new gcp.compute.BackendService("default", {
name: "my-backend-service",
healthChecks: defaultHttpHealthCheck.id,
});
const defaultGateway = new gcp.networkservices.Gateway("default", {
name: "my-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
scope: "my-scope",
type: "OPEN_MESH",
ports: [443],
});
const defaultTcpRoute = new gcp.networkservices.TcpRoute("default", {
name: "my-tcp-route",
labels: {
foo: "bar",
},
description: "my description",
gateways: [defaultGateway.id],
rules: [{
matches: [{
address: "10.0.0.1/32",
port: "8081",
}],
action: {
destinations: [{
serviceName: _default.id,
weight: 1,
}],
originalDestination: false,
},
}],
});
import 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-tcp-route",
labels={
"foo": "bar",
},
description="my description",
scope="my-scope",
type="OPEN_MESH",
ports=[443])
default_tcp_route = gcp.networkservices.TcpRoute("default",
name="my-tcp-route",
labels={
"foo": "bar",
},
description="my description",
gateways=[default_gateway.id],
rules=[gcp.networkservices.TcpRouteRuleArgs(
matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
address="10.0.0.1/32",
port="8081",
)],
action=gcp.networkservices.TcpRouteRuleActionArgs(
destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
service_name=default.id,
weight=1,
)],
original_destination=False,
),
)])
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/compute"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/networkservices"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
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-tcp-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.NewTcpRoute(ctx, "default", &networkservices.TcpRouteArgs{
Name: pulumi.String("my-tcp-route"),
Labels: pulumi.StringMap{
"foo": pulumi.String("bar"),
},
Description: pulumi.String("my description"),
Gateways: pulumi.StringArray{
defaultGateway.ID(),
},
Rules: networkservices.TcpRouteRuleArray{
&networkservices.TcpRouteRuleArgs{
Matches: networkservices.TcpRouteRuleMatchArray{
&networkservices.TcpRouteRuleMatchArgs{
Address: pulumi.String("10.0.0.1/32"),
Port: pulumi.String("8081"),
},
},
Action: &networkservices.TcpRouteRuleActionArgs{
Destinations: networkservices.TcpRouteRuleActionDestinationArray{
&networkservices.TcpRouteRuleActionDestinationArgs{
ServiceName: _default.ID(),
Weight: pulumi.Int(1),
},
},
OriginalDestination: pulumi.Bool(false),
},
},
},
})
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-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Scope = "my-scope",
Type = "OPEN_MESH",
Ports = new[]
{
443,
},
});
var defaultTcpRoute = new Gcp.NetworkServices.TcpRoute("default", new()
{
Name = "my-tcp-route",
Labels =
{
{ "foo", "bar" },
},
Description = "my description",
Gateways = new[]
{
defaultGateway.Id,
},
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
{
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
{
Address = "10.0.0.1/32",
Port = "8081",
},
},
Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
{
ServiceName = @default.Id,
Weight = 1,
},
},
OriginalDestination = false,
},
},
},
});
});
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.TcpRoute;
import com.pulumi.gcp.networkservices.TcpRouteArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleArgs;
import com.pulumi.gcp.networkservices.inputs.TcpRouteRuleActionArgs;
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-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.scope("my-scope")
.type("OPEN_MESH")
.ports(443)
.build());
var defaultTcpRoute = new TcpRoute("defaultTcpRoute", TcpRouteArgs.builder()
.name("my-tcp-route")
.labels(Map.of("foo", "bar"))
.description("my description")
.gateways(defaultGateway.id())
.rules(TcpRouteRuleArgs.builder()
.matches(TcpRouteRuleMatchArgs.builder()
.address("10.0.0.1/32")
.port("8081")
.build())
.action(TcpRouteRuleActionArgs.builder()
.destinations(TcpRouteRuleActionDestinationArgs.builder()
.serviceName(default_.id())
.weight(1)
.build())
.originalDestination(false)
.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-tcp-route
labels:
foo: bar
description: my description
scope: my-scope
type: OPEN_MESH
ports:
- 443
defaultTcpRoute:
type: gcp:networkservices:TcpRoute
name: default
properties:
name: my-tcp-route
labels:
foo: bar
description: my description
gateways:
- ${defaultGateway.id}
rules:
- matches:
- address: 10.0.0.1/32
port: '8081'
action:
destinations:
- serviceName: ${default.id}
weight: 1
originalDestination: false
Create TcpRoute Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TcpRoute(name: string, args: TcpRouteArgs, opts?: CustomResourceOptions);
@overload
def TcpRoute(resource_name: str,
args: TcpRouteArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TcpRoute(resource_name: str,
opts: Optional[ResourceOptions] = None,
rules: Optional[Sequence[TcpRouteRuleArgs]] = None,
description: Optional[str] = None,
gateways: Optional[Sequence[str]] = None,
labels: Optional[Mapping[str, str]] = None,
meshes: Optional[Sequence[str]] = None,
name: Optional[str] = None,
project: Optional[str] = None)
func NewTcpRoute(ctx *Context, name string, args TcpRouteArgs, opts ...ResourceOption) (*TcpRoute, error)
public TcpRoute(string name, TcpRouteArgs args, CustomResourceOptions? opts = null)
public TcpRoute(String name, TcpRouteArgs args)
public TcpRoute(String name, TcpRouteArgs args, CustomResourceOptions options)
type: gcp:networkservices:TcpRoute
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 TcpRouteArgs
- 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 TcpRouteArgs
- 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 TcpRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TcpRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TcpRouteArgs
- 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 tcpRouteResource = new Gcp.NetworkServices.TcpRoute("tcpRouteResource", new()
{
Rules = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleArgs
{
Action = new Gcp.NetworkServices.Inputs.TcpRouteRuleActionArgs
{
Destinations = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleActionDestinationArgs
{
ServiceName = "string",
Weight = 0,
},
},
OriginalDestination = false,
},
Matches = new[]
{
new Gcp.NetworkServices.Inputs.TcpRouteRuleMatchArgs
{
Address = "string",
Port = "string",
},
},
},
},
Description = "string",
Gateways = new[]
{
"string",
},
Labels =
{
{ "string", "string" },
},
Meshes = new[]
{
"string",
},
Name = "string",
Project = "string",
});
example, err := networkservices.NewTcpRoute(ctx, "tcpRouteResource", &networkservices.TcpRouteArgs{
Rules: networkservices.TcpRouteRuleArray{
&networkservices.TcpRouteRuleArgs{
Action: &networkservices.TcpRouteRuleActionArgs{
Destinations: networkservices.TcpRouteRuleActionDestinationArray{
&networkservices.TcpRouteRuleActionDestinationArgs{
ServiceName: pulumi.String("string"),
Weight: pulumi.Int(0),
},
},
OriginalDestination: pulumi.Bool(false),
},
Matches: networkservices.TcpRouteRuleMatchArray{
&networkservices.TcpRouteRuleMatchArgs{
Address: pulumi.String("string"),
Port: pulumi.String("string"),
},
},
},
},
Description: pulumi.String("string"),
Gateways: pulumi.StringArray{
pulumi.String("string"),
},
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Meshes: pulumi.StringArray{
pulumi.String("string"),
},
Name: pulumi.String("string"),
Project: pulumi.String("string"),
})
var tcpRouteResource = new TcpRoute("tcpRouteResource", TcpRouteArgs.builder()
.rules(TcpRouteRuleArgs.builder()
.action(TcpRouteRuleActionArgs.builder()
.destinations(TcpRouteRuleActionDestinationArgs.builder()
.serviceName("string")
.weight(0)
.build())
.originalDestination(false)
.build())
.matches(TcpRouteRuleMatchArgs.builder()
.address("string")
.port("string")
.build())
.build())
.description("string")
.gateways("string")
.labels(Map.of("string", "string"))
.meshes("string")
.name("string")
.project("string")
.build());
tcp_route_resource = gcp.networkservices.TcpRoute("tcpRouteResource",
rules=[gcp.networkservices.TcpRouteRuleArgs(
action=gcp.networkservices.TcpRouteRuleActionArgs(
destinations=[gcp.networkservices.TcpRouteRuleActionDestinationArgs(
service_name="string",
weight=0,
)],
original_destination=False,
),
matches=[gcp.networkservices.TcpRouteRuleMatchArgs(
address="string",
port="string",
)],
)],
description="string",
gateways=["string"],
labels={
"string": "string",
},
meshes=["string"],
name="string",
project="string")
const tcpRouteResource = new gcp.networkservices.TcpRoute("tcpRouteResource", {
rules: [{
action: {
destinations: [{
serviceName: "string",
weight: 0,
}],
originalDestination: false,
},
matches: [{
address: "string",
port: "string",
}],
}],
description: "string",
gateways: ["string"],
labels: {
string: "string",
},
meshes: ["string"],
name: "string",
project: "string",
});
type: gcp:networkservices:TcpRoute
properties:
description: string
gateways:
- string
labels:
string: string
meshes:
- string
name: string
project: string
rules:
- action:
destinations:
- serviceName: string
weight: 0
originalDestination: false
matches:
- address: string
port: string
TcpRoute Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The TcpRoute resource accepts the following input properties:
- Rules
List<Tcp
Route Rule> - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Gateways List<string>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- Labels Dictionary<string, string>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- Meshes List<string>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TcpRoute resource.
- Project string
- Rules
[]Tcp
Route Rule Args - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Gateways []string
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- Labels map[string]string
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- Meshes []string
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TcpRoute resource.
- Project string
- rules
List<Tcp
Route Rule> - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- description String
- A free-text description of the resource. Max length 1024 characters.
- gateways List<String>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Map<String,String>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes List<String>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TcpRoute resource.
- project String
- rules
Tcp
Route Rule[] - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- description string
- A free-text description of the resource. Max length 1024 characters.
- gateways string[]
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels {[key: string]: string}
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes string[]
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name string
- Name of the TcpRoute resource.
- project string
- rules
Sequence[Tcp
Route Rule Args] - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- description str
- A free-text description of the resource. Max length 1024 characters.
- gateways Sequence[str]
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Mapping[str, str]
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes Sequence[str]
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name str
- Name of the TcpRoute resource.
- project str
- rules List<Property Map>
- Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- description String
- A free-text description of the resource. Max length 1024 characters.
- gateways List<String>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Map<String>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes List<String>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TcpRoute resource.
- project String
Outputs
All input properties are implicitly available as output properties. Additionally, the TcpRoute resource produces the following output properties:
- Create
Time string - Time the TcpRoute was created in UTC.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TcpRoute was updated in UTC.
- Create
Time string - Time the TcpRoute was created in UTC.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Id string
- The provider-assigned unique ID for this managed resource.
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TcpRoute was updated in UTC.
- create
Time String - Time the TcpRoute was created in UTC.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - Server-defined URL of this resource.
- update
Time String - Time the TcpRoute was updated in UTC.
- create
Time string - Time the TcpRoute was created in UTC.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id string
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link string - Server-defined URL of this resource.
- update
Time string - Time the TcpRoute was updated in UTC.
- create_
time str - Time the TcpRoute was created in UTC.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id str
- The provider-assigned unique ID for this managed resource.
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- self_
link str - Server-defined URL of this resource.
- update_
time str - Time the TcpRoute was updated in UTC.
- create
Time String - Time the TcpRoute was created in UTC.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- id String
- The provider-assigned unique ID for this managed resource.
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- self
Link String - Server-defined URL of this resource.
- update
Time String - Time the TcpRoute was updated in UTC.
Look up Existing TcpRoute Resource
Get an existing TcpRoute 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?: TcpRouteState, opts?: CustomResourceOptions): TcpRoute
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
description: Optional[str] = None,
effective_labels: Optional[Mapping[str, str]] = None,
gateways: Optional[Sequence[str]] = None,
labels: Optional[Mapping[str, str]] = None,
meshes: Optional[Sequence[str]] = None,
name: Optional[str] = None,
project: Optional[str] = None,
pulumi_labels: Optional[Mapping[str, str]] = None,
rules: Optional[Sequence[TcpRouteRuleArgs]] = None,
self_link: Optional[str] = None,
update_time: Optional[str] = None) -> TcpRoute
func GetTcpRoute(ctx *Context, name string, id IDInput, state *TcpRouteState, opts ...ResourceOption) (*TcpRoute, error)
public static TcpRoute Get(string name, Input<string> id, TcpRouteState? state, CustomResourceOptions? opts = null)
public static TcpRoute get(String name, Output<String> id, TcpRouteState 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.
- Create
Time string - Time the TcpRoute was created in UTC.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Effective
Labels Dictionary<string, string> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Gateways List<string>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- Labels Dictionary<string, string>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- Meshes List<string>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TcpRoute resource.
- Project string
- Pulumi
Labels Dictionary<string, string> - The combination of labels configured directly on the resource and default labels configured on the provider.
- Rules
List<Tcp
Route Rule> - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TcpRoute was updated in UTC.
- Create
Time string - Time the TcpRoute was created in UTC.
- Description string
- A free-text description of the resource. Max length 1024 characters.
- Effective
Labels map[string]string - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- Gateways []string
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- Labels map[string]string
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- Meshes []string
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- Name string
- Name of the TcpRoute resource.
- Project string
- Pulumi
Labels map[string]string - The combination of labels configured directly on the resource and default labels configured on the provider.
- Rules
[]Tcp
Route Rule Args - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- Self
Link string - Server-defined URL of this resource.
- Update
Time string - Time the TcpRoute was updated in UTC.
- create
Time String - Time the TcpRoute was created in UTC.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels Map<String,String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- gateways List<String>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Map<String,String>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes List<String>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TcpRoute resource.
- project String
- pulumi
Labels Map<String,String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- rules
List<Tcp
Route Rule> - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- self
Link String - Server-defined URL of this resource.
- update
Time String - Time the TcpRoute was updated in UTC.
- create
Time string - Time the TcpRoute was created in UTC.
- description string
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels {[key: string]: string} - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- gateways string[]
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels {[key: string]: string}
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes string[]
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name string
- Name of the TcpRoute resource.
- project string
- pulumi
Labels {[key: string]: string} - The combination of labels configured directly on the resource and default labels configured on the provider.
- rules
Tcp
Route Rule[] - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- self
Link string - Server-defined URL of this resource.
- update
Time string - Time the TcpRoute was updated in UTC.
- create_
time str - Time the TcpRoute was created in UTC.
- description str
- A free-text description of the resource. Max length 1024 characters.
- effective_
labels Mapping[str, str] - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- gateways Sequence[str]
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Mapping[str, str]
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes Sequence[str]
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name str
- Name of the TcpRoute resource.
- project str
- pulumi_
labels Mapping[str, str] - The combination of labels configured directly on the resource and default labels configured on the provider.
- rules
Sequence[Tcp
Route Rule Args] - Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- self_
link str - Server-defined URL of this resource.
- update_
time str - Time the TcpRoute was updated in UTC.
- create
Time String - Time the TcpRoute was created in UTC.
- description String
- A free-text description of the resource. Max length 1024 characters.
- effective
Labels Map<String> - All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services.
- gateways List<String>
- Gateways defines a list of gateways this TcpRoute is attached to, as one of the routing rules to route the requests served by the gateway. Each gateway reference should match the pattern: projects/*/locations/global/gateways/<gateway_name>
- labels Map<String>
- Set of label tags associated with the TcpRoute resource. Note: This field is non-authoritative, and will only manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels present on the resource.
- meshes List<String>
- Meshes defines a list of meshes this TcpRoute is attached to, as one of the routing rules to route the requests served by the mesh. Each mesh reference should match the pattern: projects/*/locations/global/meshes/<mesh_name> The attached Mesh should be of a type SIDECAR
- name String
- Name of the TcpRoute resource.
- project String
- pulumi
Labels Map<String> - The combination of labels configured directly on the resource and default labels configured on the provider.
- rules List<Property Map>
- Rules that define how traffic is routed and handled. At least one RouteRule must be supplied. If there are multiple rules then the action taken will be the first rule to match. Structure is documented below.
- self
Link String - Server-defined URL of this resource.
- update
Time String - Time the TcpRoute was updated in UTC.
Supporting Types
TcpRouteRule, TcpRouteRuleArgs
- Action
Tcp
Route Rule Action - A detailed rule defining how to route traffic. Structure is documented below.
- Matches
List<Tcp
Route Rule Match> - RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
- Action
Tcp
Route Rule Action - A detailed rule defining how to route traffic. Structure is documented below.
- Matches
[]Tcp
Route Rule Match - RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
- action
Tcp
Route Rule Action - A detailed rule defining how to route traffic. Structure is documented below.
- matches
List<Tcp
Route Rule Match> - RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
- action
Tcp
Route Rule Action - A detailed rule defining how to route traffic. Structure is documented below.
- matches
Tcp
Route Rule Match[] - RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
- action
Tcp
Route Rule Action - A detailed rule defining how to route traffic. Structure is documented below.
- matches
Sequence[Tcp
Route Rule Match] - RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
- action Property Map
- A detailed rule defining how to route traffic. Structure is documented below.
- matches List<Property Map>
- RouteMatch defines the predicate used to match requests to a given action. Multiple match types are "OR"ed for evaluation. If no routeMatch field is specified, this rule will unconditionally match traffic. Structure is documented below.
TcpRouteRuleAction, TcpRouteRuleActionArgs
- Destinations
List<Tcp
Route Rule Action Destination> - The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- Original
Destination bool - If true, Router will use the destination IP and port of the original connection as the destination of the request.
- Destinations
[]Tcp
Route Rule Action Destination - The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- Original
Destination bool - If true, Router will use the destination IP and port of the original connection as the destination of the request.
- destinations
List<Tcp
Route Rule Action Destination> - The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- original
Destination Boolean - If true, Router will use the destination IP and port of the original connection as the destination of the request.
- destinations
Tcp
Route Rule Action Destination[] - The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- original
Destination boolean - If true, Router will use the destination IP and port of the original connection as the destination of the request.
- destinations
Sequence[Tcp
Route Rule Action Destination] - The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- original_
destination bool - If true, Router will use the destination IP and port of the original connection as the destination of the request.
- destinations List<Property Map>
- The destination services to which traffic should be forwarded. At least one destination service is required. Structure is documented below.
- original
Destination Boolean - If true, Router will use the destination IP and port of the original connection as the destination of the request.
TcpRouteRuleActionDestination, TcpRouteRuleActionDestinationArgs
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
- 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. This is computed as: weight/Sum(weights in this destination list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports.
If only one serviceName is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend.
If weights are specified for any one service name, they need to be specified for all of them.
If weights are unspecified for all services, then, traffic is distributed in equal proportions to all of them.
TcpRouteRuleMatch, TcpRouteRuleMatchArgs
- Address string
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- Port string
- Specifies the destination port to match against.
- Address string
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- Port string
- Specifies the destination port to match against.
- address String
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- port String
- Specifies the destination port to match against.
- address string
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- port string
- Specifies the destination port to match against.
- address str
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- port str
- Specifies the destination port to match against.
- address String
- Must be specified in the CIDR range format. A CIDR range consists of an IP Address and a prefix length to construct the subnet mask. By default, the prefix length is 32 (i.e. matches a single IP address). Only IPV4 addresses are supported. Examples: "10.0.0.1" - matches against this exact IP address. "10.0.0.0/8" - matches against any IP address within the 10.0.0.0 subnet and 255.255.255.0 mask. "0.0.0.0/0" - matches against any IP address'.
- port String
- Specifies the destination port to match against.
Import
TcpRoute can be imported using any of these accepted formats:
projects/{{project}}/locations/global/tcpRoutes/{{name}}
{{project}}/{{name}}
{{name}}
When using the pulumi import
command, TcpRoute can be imported using one of the formats above. For example:
$ pulumi import gcp:networkservices/tcpRoute:TcpRoute default projects/{{project}}/locations/global/tcpRoutes/{{name}}
$ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{project}}/{{name}}
$ pulumi import gcp:networkservices/tcpRoute:TcpRoute default {{name}}
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.