1. Packages
  2. OVH
  3. API Docs
  4. IpLoadBalancing
  5. TcpRouteRule
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

ovh.IpLoadBalancing.TcpRouteRule

Explore with Pulumi AI

ovh logo
OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud

    Manage rules for TCP route.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovhcloud/pulumi-ovh";
    
    const reject = new ovh.iploadbalancing.TcpRoute("reject", {
        serviceName: "loadbalancer-xxxxxxxxxxxxxxxxxx",
        weight: 1,
        frontendId: 11111,
        action: {
            type: "reject",
        },
    });
    const examplerule = new ovh.iploadbalancing.TcpRouteRule("examplerule", {
        serviceName: "loadbalancer-xxxxxxxxxxxxxxxxxx",
        routeId: reject.id,
        displayName: "Match example.com host",
        field: "sni",
        match: "is",
        negate: false,
        pattern: "example.com",
    });
    
    import pulumi
    import pulumi_ovh as ovh
    
    reject = ovh.ip_load_balancing.TcpRoute("reject",
        service_name="loadbalancer-xxxxxxxxxxxxxxxxxx",
        weight=1,
        frontend_id=11111,
        action={
            "type": "reject",
        })
    examplerule = ovh.ip_load_balancing.TcpRouteRule("examplerule",
        service_name="loadbalancer-xxxxxxxxxxxxxxxxxx",
        route_id=reject.id,
        display_name="Match example.com host",
        field="sni",
        match="is",
        negate=False,
        pattern="example.com")
    
    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 {
    		reject, err := IpLoadBalancing.NewTcpRoute(ctx, "reject", &IpLoadBalancing.TcpRouteArgs{
    			ServiceName: pulumi.String("loadbalancer-xxxxxxxxxxxxxxxxxx"),
    			Weight:      pulumi.Int(1),
    			FrontendId:  pulumi.Int(11111),
    			Action: &iploadbalancing.TcpRouteActionArgs{
    				Type: pulumi.String("reject"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = IpLoadBalancing.NewTcpRouteRule(ctx, "examplerule", &IpLoadBalancing.TcpRouteRuleArgs{
    			ServiceName: pulumi.String("loadbalancer-xxxxxxxxxxxxxxxxxx"),
    			RouteId:     reject.ID(),
    			DisplayName: pulumi.String("Match example.com host"),
    			Field:       pulumi.String("sni"),
    			Match:       pulumi.String("is"),
    			Negate:      pulumi.Bool(false),
    			Pattern:     pulumi.String("example.com"),
    		})
    		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 reject = new Ovh.IpLoadBalancing.TcpRoute("reject", new()
        {
            ServiceName = "loadbalancer-xxxxxxxxxxxxxxxxxx",
            Weight = 1,
            FrontendId = 11111,
            Action = new Ovh.IpLoadBalancing.Inputs.TcpRouteActionArgs
            {
                Type = "reject",
            },
        });
    
        var examplerule = new Ovh.IpLoadBalancing.TcpRouteRule("examplerule", new()
        {
            ServiceName = "loadbalancer-xxxxxxxxxxxxxxxxxx",
            RouteId = reject.Id,
            DisplayName = "Match example.com host",
            Field = "sni",
            Match = "is",
            Negate = false,
            Pattern = "example.com",
        });
    
    });
    
    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 com.pulumi.ovh.IpLoadBalancing.TcpRouteRule;
    import com.pulumi.ovh.IpLoadBalancing.TcpRouteRuleArgs;
    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 reject = new TcpRoute("reject", TcpRouteArgs.builder()
                .serviceName("loadbalancer-xxxxxxxxxxxxxxxxxx")
                .weight(1)
                .frontendId(11111)
                .action(TcpRouteActionArgs.builder()
                    .type("reject")
                    .build())
                .build());
    
            var examplerule = new TcpRouteRule("examplerule", TcpRouteRuleArgs.builder()
                .serviceName("loadbalancer-xxxxxxxxxxxxxxxxxx")
                .routeId(reject.id())
                .displayName("Match example.com host")
                .field("sni")
                .match("is")
                .negate(false)
                .pattern("example.com")
                .build());
    
        }
    }
    
    resources:
      reject:
        type: ovh:IpLoadBalancing:TcpRoute
        properties:
          serviceName: loadbalancer-xxxxxxxxxxxxxxxxxx
          weight: 1
          frontendId: 11111
          action:
            type: reject
      examplerule:
        type: ovh:IpLoadBalancing:TcpRouteRule
        properties:
          serviceName: loadbalancer-xxxxxxxxxxxxxxxxxx
          routeId: ${reject.id}
          displayName: Match example.com host
          field: sni
          match: is
          negate: false
          pattern: example.com
    

    Create TcpRouteRule Resource

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

    Constructor syntax

    new TcpRouteRule(name: string, args: TcpRouteRuleArgs, opts?: CustomResourceOptions);
    @overload
    def TcpRouteRule(resource_name: str,
                     args: TcpRouteRuleInitArgs,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def TcpRouteRule(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     field: Optional[str] = None,
                     match: Optional[str] = None,
                     route_id: Optional[str] = None,
                     service_name: Optional[str] = None,
                     display_name: Optional[str] = None,
                     negate: Optional[bool] = None,
                     pattern: Optional[str] = None,
                     sub_field: Optional[str] = None)
    func NewTcpRouteRule(ctx *Context, name string, args TcpRouteRuleArgs, opts ...ResourceOption) (*TcpRouteRule, error)
    public TcpRouteRule(string name, TcpRouteRuleArgs args, CustomResourceOptions? opts = null)
    public TcpRouteRule(String name, TcpRouteRuleArgs args)
    public TcpRouteRule(String name, TcpRouteRuleArgs args, CustomResourceOptions options)
    
    type: ovh:IpLoadBalancing:TcpRouteRule
    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 TcpRouteRuleArgs
    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 TcpRouteRuleInitArgs
    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 TcpRouteRuleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TcpRouteRuleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TcpRouteRuleArgs
    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 tcpRouteRuleResource = new Ovh.IpLoadBalancing.TcpRouteRule("tcpRouteRuleResource", new()
    {
        Field = "string",
        Match = "string",
        RouteId = "string",
        ServiceName = "string",
        DisplayName = "string",
        Negate = false,
        Pattern = "string",
        SubField = "string",
    });
    
    example, err := IpLoadBalancing.NewTcpRouteRule(ctx, "tcpRouteRuleResource", &IpLoadBalancing.TcpRouteRuleArgs{
    	Field:       pulumi.String("string"),
    	Match:       pulumi.String("string"),
    	RouteId:     pulumi.String("string"),
    	ServiceName: pulumi.String("string"),
    	DisplayName: pulumi.String("string"),
    	Negate:      pulumi.Bool(false),
    	Pattern:     pulumi.String("string"),
    	SubField:    pulumi.String("string"),
    })
    
    var tcpRouteRuleResource = new TcpRouteRule("tcpRouteRuleResource", TcpRouteRuleArgs.builder()
        .field("string")
        .match("string")
        .routeId("string")
        .serviceName("string")
        .displayName("string")
        .negate(false)
        .pattern("string")
        .subField("string")
        .build());
    
    tcp_route_rule_resource = ovh.ip_load_balancing.TcpRouteRule("tcpRouteRuleResource",
        field="string",
        match="string",
        route_id="string",
        service_name="string",
        display_name="string",
        negate=False,
        pattern="string",
        sub_field="string")
    
    const tcpRouteRuleResource = new ovh.iploadbalancing.TcpRouteRule("tcpRouteRuleResource", {
        field: "string",
        match: "string",
        routeId: "string",
        serviceName: "string",
        displayName: "string",
        negate: false,
        pattern: "string",
        subField: "string",
    });
    
    type: ovh:IpLoadBalancing:TcpRouteRule
    properties:
        displayName: string
        field: string
        match: string
        negate: false
        pattern: string
        routeId: string
        serviceName: string
        subField: string
    

    TcpRouteRule 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 TcpRouteRule resource accepts the following input properties:

    Field string
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    Match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    RouteId string
    The route to apply this rule
    ServiceName string
    The internal name of your IP load balancing
    DisplayName string
    Human readable name for your rule, this field is for you
    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
    SubField 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". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    Match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    RouteId string
    The route to apply this rule
    ServiceName string
    The internal name of your IP load balancing
    DisplayName string
    Human readable name for your rule, this field is for you
    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
    SubField 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". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match String
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    routeId String
    The route to apply this rule
    serviceName String
    The internal name of your IP load balancing
    displayName String
    Human readable name for your rule, this field is for you
    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
    subField 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". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    routeId string
    The route to apply this rule
    serviceName string
    The internal name of your IP load balancing
    displayName string
    Human readable name for your rule, this field is for you
    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
    subField 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". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match str
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    route_id str
    The route to apply this rule
    service_name str
    The internal name of your IP load balancing
    display_name str
    Human readable name for your rule, this field is for you
    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
    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". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match String
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    routeId String
    The route to apply this rule
    serviceName String
    The internal name of your IP load balancing
    displayName String
    Human readable name for your rule, this field is for you
    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
    subField String
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing TcpRouteRule Resource

    Get an existing TcpRouteRule 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?: TcpRouteRuleState, opts?: CustomResourceOptions): TcpRouteRule
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            display_name: Optional[str] = None,
            field: Optional[str] = None,
            match: Optional[str] = None,
            negate: Optional[bool] = None,
            pattern: Optional[str] = None,
            route_id: Optional[str] = None,
            service_name: Optional[str] = None,
            sub_field: Optional[str] = None) -> TcpRouteRule
    func GetTcpRouteRule(ctx *Context, name string, id IDInput, state *TcpRouteRuleState, opts ...ResourceOption) (*TcpRouteRule, error)
    public static TcpRouteRule Get(string name, Input<string> id, TcpRouteRuleState? state, CustomResourceOptions? opts = null)
    public static TcpRouteRule get(String name, Output<String> id, TcpRouteRuleState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    DisplayName string
    Human readable name for your rule, this field is for you
    Field string
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    Match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    RouteId string
    The route to apply this rule
    ServiceName string
    The internal name of your IP load balancing
    SubField string
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance
    DisplayName string
    Human readable name for your rule, this field is for you
    Field string
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    Match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    RouteId string
    The route to apply this rule
    ServiceName string
    The internal name of your IP load balancing
    SubField string
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance
    displayName String
    Human readable name for your rule, this field is for you
    field String
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match String
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    routeId String
    The route to apply this rule
    serviceName String
    The internal name of your IP load balancing
    subField String
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance
    displayName string
    Human readable name for your rule, this field is for you
    field string
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match string
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    routeId string
    The route to apply this rule
    serviceName string
    The internal name of your IP load balancing
    subField string
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance
    display_name str
    Human readable name for your rule, this field is for you
    field str
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match str
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    route_id str
    The route to apply this rule
    service_name str
    The internal name of your IP load balancing
    sub_field str
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance
    displayName String
    Human readable name for your rule, this field is for you
    field String
    Name of the field to match like "protocol" or "host". See "/ipLoadbalancing/{serviceName}/availableRouteRules" for a list of available rules
    match String
    Matching operator. Not all operators are available for all fields. See "/ipLoadbalancing/{serviceName}/availableRouteRules"
    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
    routeId String
    The route to apply this rule
    serviceName String
    The internal name of your IP load balancing
    subField String
    Name of sub-field, if applicable. This may be a Cookie or Header name for instance

    Import

    TCP route rule can be imported using the following format service_name, the id of the route and the id of the rule separated by “/” e.g.

    $ terraform import ovh_iploadbalancing_tcp_route_rule.examplerule service_name/route_id/rule_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.
    ovh logo
    OVHCloud v1.0.0 published on Wednesday, Oct 30, 2024 by OVHcloud