ovh.IpLoadBalancing.TcpRoute
Explore with Pulumi AI
Manage TCP route for a loadbalancer service
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
const tcpreject = new ovh.iploadbalancing.TcpRoute("tcpreject", {
action: {
type: "reject",
},
serviceName: "loadbalancer-xxxxxxxxxxxxxxxxxx",
weight: 1,
});
import pulumi
import pulumi_ovh as ovh
tcpreject = ovh.ip_load_balancing.TcpRoute("tcpreject",
action=ovh.ip_load_balancing.TcpRouteActionArgs(
type="reject",
),
service_name="loadbalancer-xxxxxxxxxxxxxxxxxx",
weight=1)
package main
import (
"github.com/ovh/pulumi-ovh/sdk/go/ovh/IpLoadBalancing"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := IpLoadBalancing.NewTcpRoute(ctx, "tcpreject", &IpLoadBalancing.TcpRouteArgs{
Action: &iploadbalancing.TcpRouteActionArgs{
Type: pulumi.String("reject"),
},
ServiceName: pulumi.String("loadbalancer-xxxxxxxxxxxxxxxxxx"),
Weight: pulumi.Int(1),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;
return await Deployment.RunAsync(() =>
{
var tcpreject = new Ovh.IpLoadBalancing.TcpRoute("tcpreject", new()
{
Action = new Ovh.IpLoadBalancing.Inputs.TcpRouteActionArgs
{
Type = "reject",
},
ServiceName = "loadbalancer-xxxxxxxxxxxxxxxxxx",
Weight = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.IpLoadBalancing.TcpRoute;
import com.pulumi.ovh.IpLoadBalancing.TcpRouteArgs;
import com.pulumi.ovh.IpLoadBalancing.inputs.TcpRouteActionArgs;
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 tcpreject = new TcpRoute("tcpreject", TcpRouteArgs.builder()
.action(TcpRouteActionArgs.builder()
.type("reject")
.build())
.serviceName("loadbalancer-xxxxxxxxxxxxxxxxxx")
.weight(1)
.build());
}
}
resources:
tcpreject:
type: ovh:IpLoadBalancing:TcpRoute
properties:
action:
type: reject
serviceName: loadbalancer-xxxxxxxxxxxxxxxxxx
weight: 1
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,
action: Optional[_iploadbalancing.TcpRouteActionArgs] = None,
service_name: Optional[str] = None,
display_name: Optional[str] = None,
frontend_id: Optional[int] = None,
weight: Optional[int] = 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: ovh:IpLoadBalancing: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 Ovh.IpLoadBalancing.TcpRoute("tcpRouteResource", new()
{
Action = new Ovh.IpLoadBalancing.Inputs.TcpRouteActionArgs
{
Type = "string",
Target = "string",
},
ServiceName = "string",
DisplayName = "string",
FrontendId = 0,
Weight = 0,
});
example, err := IpLoadBalancing.NewTcpRoute(ctx, "tcpRouteResource", &IpLoadBalancing.TcpRouteArgs{
Action: &iploadbalancing.TcpRouteActionArgs{
Type: pulumi.String("string"),
Target: pulumi.String("string"),
},
ServiceName: pulumi.String("string"),
DisplayName: pulumi.String("string"),
FrontendId: pulumi.Int(0),
Weight: pulumi.Int(0),
})
var tcpRouteResource = new TcpRoute("tcpRouteResource", TcpRouteArgs.builder()
.action(TcpRouteActionArgs.builder()
.type("string")
.target("string")
.build())
.serviceName("string")
.displayName("string")
.frontendId(0)
.weight(0)
.build());
tcp_route_resource = ovh.ip_load_balancing.TcpRoute("tcpRouteResource",
action=ovh.ip_load_balancing.TcpRouteActionArgs(
type="string",
target="string",
),
service_name="string",
display_name="string",
frontend_id=0,
weight=0)
const tcpRouteResource = new ovh.iploadbalancing.TcpRoute("tcpRouteResource", {
action: {
type: "string",
target: "string",
},
serviceName: "string",
displayName: "string",
frontendId: 0,
weight: 0,
});
type: ovh:IpLoadBalancing:TcpRoute
properties:
action:
target: string
type: string
displayName: string
frontendId: 0
serviceName: string
weight: 0
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:
- Action
Tcp
Route Action - Action triggered when all rules match
- Service
Name string - The internal name of your IP load balancing
- Display
Name string - Human readable name for your route, this field is for you
- Frontend
Id int - Route traffic for this frontend
- Weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- Action
Tcp
Route Action Args - Action triggered when all rules match
- Service
Name string - The internal name of your IP load balancing
- Display
Name string - Human readable name for your route, this field is for you
- Frontend
Id int - Route traffic for this frontend
- Weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
Tcp
Route Action - Action triggered when all rules match
- service
Name String - The internal name of your IP load balancing
- display
Name String - Human readable name for your route, this field is for you
- frontend
Id Integer - Route traffic for this frontend
- weight Integer
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
Tcp
Route Action - Action triggered when all rules match
- service
Name string - The internal name of your IP load balancing
- display
Name string - Human readable name for your route, this field is for you
- frontend
Id number - Route traffic for this frontend
- weight number
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
iploadbalancing.
Tcp Route Action Args - Action triggered when all rules match
- service_
name str - The internal name of your IP load balancing
- display_
name str - Human readable name for your route, this field is for you
- frontend_
id int - Route traffic for this frontend
- weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action Property Map
- Action triggered when all rules match
- service
Name String - The internal name of your IP load balancing
- display
Name String - Human readable name for your route, this field is for you
- frontend
Id Number - Route traffic for this frontend
- weight Number
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
Outputs
All input properties are implicitly available as output properties. Additionally, the TcpRoute resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Rules
List<Tcp
Route Rule> - List of rules to match to trigger action
- Status string
- Route status. Routes in "ok" state are ready to operate
- Id string
- The provider-assigned unique ID for this managed resource.
- Rules
[]Tcp
Route Rule Type - List of rules to match to trigger action
- Status string
- Route status. Routes in "ok" state are ready to operate
- id String
- The provider-assigned unique ID for this managed resource.
- rules
List<Tcp
Route Rule> - List of rules to match to trigger action
- status String
- Route status. Routes in "ok" state are ready to operate
- id string
- The provider-assigned unique ID for this managed resource.
- rules
Tcp
Route Rule[] - List of rules to match to trigger action
- status string
- Route status. Routes in "ok" state are ready to operate
- id str
- The provider-assigned unique ID for this managed resource.
- rules
Sequence[iploadbalancing.
Tcp Route Rule] - List of rules to match to trigger action
- status str
- Route status. Routes in "ok" state are ready to operate
- id String
- The provider-assigned unique ID for this managed resource.
- rules List<Property Map>
- List of rules to match to trigger action
- status String
- Route status. Routes in "ok" state are ready to operate
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,
action: Optional[_iploadbalancing.TcpRouteActionArgs] = None,
display_name: Optional[str] = None,
frontend_id: Optional[int] = None,
rules: Optional[Sequence[_iploadbalancing.TcpRouteRuleArgs]] = None,
service_name: Optional[str] = None,
status: Optional[str] = None,
weight: Optional[int] = 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.
- Action
Tcp
Route Action - Action triggered when all rules match
- Display
Name string - Human readable name for your route, this field is for you
- Frontend
Id int - Route traffic for this frontend
- Rules
List<Tcp
Route Rule> - List of rules to match to trigger action
- Service
Name string - The internal name of your IP load balancing
- Status string
- Route status. Routes in "ok" state are ready to operate
- Weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- Action
Tcp
Route Action Args - Action triggered when all rules match
- Display
Name string - Human readable name for your route, this field is for you
- Frontend
Id int - Route traffic for this frontend
- Rules
[]Tcp
Route Rule Type Args - List of rules to match to trigger action
- Service
Name string - The internal name of your IP load balancing
- Status string
- Route status. Routes in "ok" state are ready to operate
- Weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
Tcp
Route Action - Action triggered when all rules match
- display
Name String - Human readable name for your route, this field is for you
- frontend
Id Integer - Route traffic for this frontend
- rules
List<Tcp
Route Rule> - List of rules to match to trigger action
- service
Name String - The internal name of your IP load balancing
- status String
- Route status. Routes in "ok" state are ready to operate
- weight Integer
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
Tcp
Route Action - Action triggered when all rules match
- display
Name string - Human readable name for your route, this field is for you
- frontend
Id number - Route traffic for this frontend
- rules
Tcp
Route Rule[] - List of rules to match to trigger action
- service
Name string - The internal name of your IP load balancing
- status string
- Route status. Routes in "ok" state are ready to operate
- weight number
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action
iploadbalancing.
Tcp Route Action Args - Action triggered when all rules match
- display_
name str - Human readable name for your route, this field is for you
- frontend_
id int - Route traffic for this frontend
- rules
Sequence[iploadbalancing.
Tcp Route Rule Args] - List of rules to match to trigger action
- service_
name str - The internal name of your IP load balancing
- status str
- Route status. Routes in "ok" state are ready to operate
- weight int
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
- action Property Map
- Action triggered when all rules match
- display
Name String - Human readable name for your route, this field is for you
- frontend
Id Number - Route traffic for this frontend
- rules List<Property Map>
- List of rules to match to trigger action
- service
Name String - The internal name of your IP load balancing
- status String
- Route status. Routes in "ok" state are ready to operate
- weight Number
- Route priority ([0..255]). 0 if null. Highest priority routes are evaluated first. Only the first matching route will trigger an action
Supporting Types
TcpRouteAction, TcpRouteActionArgs
TcpRouteRule, TcpRouteRuleArgs
- Field string
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- Match string
- Matching operator. Not all operators are available for all fields. See "availableRules"
- Negate bool
- Invert the matching operator effect
- Pattern string
- Value to match against this match. Interpretation if this field depends on the match and field
- Rule
Id int - Id of your rule
- Sub
Field string - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
- Field string
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- Match string
- Matching operator. Not all operators are available for all fields. See "availableRules"
- Negate bool
- Invert the matching operator effect
- Pattern string
- Value to match against this match. Interpretation if this field depends on the match and field
- Rule
Id int - Id of your rule
- Sub
Field string - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
- field String
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- match String
- Matching operator. Not all operators are available for all fields. See "availableRules"
- negate Boolean
- Invert the matching operator effect
- pattern String
- Value to match against this match. Interpretation if this field depends on the match and field
- rule
Id Integer - Id of your rule
- sub
Field String - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
- field string
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- match string
- Matching operator. Not all operators are available for all fields. See "availableRules"
- negate boolean
- Invert the matching operator effect
- pattern string
- Value to match against this match. Interpretation if this field depends on the match and field
- rule
Id number - Id of your rule
- sub
Field string - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
- field str
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- match str
- Matching operator. Not all operators are available for all fields. See "availableRules"
- negate bool
- Invert the matching operator effect
- pattern str
- Value to match against this match. Interpretation if this field depends on the match and field
- rule_
id int - Id of your rule
- sub_
field str - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
- field String
- Name of the field to match like "protocol" or "host" "/ipLoadbalancing/{serviceName}/route/availableRules" for a list of available rules
- match String
- Matching operator. Not all operators are available for all fields. See "availableRules"
- negate Boolean
- Invert the matching operator effect
- pattern String
- Value to match against this match. Interpretation if this field depends on the match and field
- rule
Id Number - Id of your rule
- sub
Field String - Name of sub-field, if applicable. This may be a Cookie or Header name for instance
Import
TCP route can be imported using the following format service_name
and the id
of the route separated by “/” e.g.
$ terraform import ovh_iploadbalancing_tcp_route.tcpreject service_name/route_id
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ovh ovh/pulumi-ovh
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
ovh
Terraform Provider.