1. Packages
  2. OVH
  3. API Docs
  4. IpLoadBalancing
  5. TcpFarm
OVHCloud v2.1.0 published on Friday, Mar 28, 2025 by OVHcloud

ovh.IpLoadBalancing.TcpFarm

Explore with Pulumi AI

Creates a backend server group (farm) to be used by loadbalancing frontend(s)

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as ovh from "@ovhcloud/pulumi-ovh";
import * as ovh from "@pulumi/ovh";

const lb = ovh.IpLoadBalancing.getIpLoadBalancing({
    serviceName: "ip-1.2.3.4",
    state: "ok",
});
const farmName = new ovh.iploadbalancing.TcpFarm("farmName", {
    displayName: "ingress-8080-gra",
    serviceName: lb.then(lb => lb.serviceName),
    zone: "GRA",
});
Copy
import pulumi
import pulumi_ovh as ovh

lb = ovh.IpLoadBalancing.get_ip_load_balancing(service_name="ip-1.2.3.4",
    state="ok")
farm_name = ovh.ip_load_balancing.TcpFarm("farmName",
    display_name="ingress-8080-gra",
    service_name=lb.service_name,
    zone="GRA")
Copy
package main

import (
	"github.com/ovh/pulumi-ovh/sdk/v2/go/ovh/iploadbalancing"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		lb, err := iploadbalancing.GetIpLoadBalancing(ctx, &iploadbalancing.GetIpLoadBalancingArgs{
			ServiceName: pulumi.StringRef("ip-1.2.3.4"),
			State:       pulumi.StringRef("ok"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = iploadbalancing.NewTcpFarm(ctx, "farmName", &iploadbalancing.TcpFarmArgs{
			DisplayName: pulumi.String("ingress-8080-gra"),
			ServiceName: pulumi.String(lb.ServiceName),
			Zone:        pulumi.String("GRA"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ovh = Pulumi.Ovh;

return await Deployment.RunAsync(() => 
{
    var lb = Ovh.IpLoadBalancing.GetIpLoadBalancing.Invoke(new()
    {
        ServiceName = "ip-1.2.3.4",
        State = "ok",
    });

    var farmName = new Ovh.IpLoadBalancing.TcpFarm("farmName", new()
    {
        DisplayName = "ingress-8080-gra",
        ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
        Zone = "GRA",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ovh.IpLoadBalancing.IpLoadBalancingFunctions;
import com.pulumi.ovh.IpLoadBalancing.inputs.GetIpLoadBalancingArgs;
import com.pulumi.ovh.IpLoadBalancing.TcpFarm;
import com.pulumi.ovh.IpLoadBalancing.TcpFarmArgs;
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) {
        final var lb = IpLoadBalancingFunctions.getIpLoadBalancing(GetIpLoadBalancingArgs.builder()
            .serviceName("ip-1.2.3.4")
            .state("ok")
            .build());

        var farmName = new TcpFarm("farmName", TcpFarmArgs.builder()
            .displayName("ingress-8080-gra")
            .serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
            .zone("GRA")
            .build());

    }
}
Copy
resources:
  farmName:
    type: ovh:IpLoadBalancing:TcpFarm
    properties:
      displayName: ingress-8080-gra
      serviceName: ${lb.serviceName}
      zone: GRA
variables:
  lb:
    fn::invoke:
      function: ovh:IpLoadBalancing:getIpLoadBalancing
      arguments:
        serviceName: ip-1.2.3.4
        state: ok
Copy

Create TcpFarm Resource

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

Constructor syntax

new TcpFarm(name: string, args: TcpFarmArgs, opts?: CustomResourceOptions);
@overload
def TcpFarm(resource_name: str,
            args: TcpFarmArgs,
            opts: Optional[ResourceOptions] = None)

@overload
def TcpFarm(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            service_name: Optional[str] = None,
            zone: Optional[str] = None,
            balance: Optional[str] = None,
            display_name: Optional[str] = None,
            port: Optional[int] = None,
            probe: Optional[_iploadbalancing.TcpFarmProbeArgs] = None,
            stickiness: Optional[str] = None,
            vrack_network_id: Optional[int] = None)
func NewTcpFarm(ctx *Context, name string, args TcpFarmArgs, opts ...ResourceOption) (*TcpFarm, error)
public TcpFarm(string name, TcpFarmArgs args, CustomResourceOptions? opts = null)
public TcpFarm(String name, TcpFarmArgs args)
public TcpFarm(String name, TcpFarmArgs args, CustomResourceOptions options)
type: ovh:IpLoadBalancing:TcpFarm
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TcpFarmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TcpFarmArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TcpFarmArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TcpFarmArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TcpFarmArgs
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 tcpFarmResource = new Ovh.IpLoadBalancing.TcpFarm("tcpFarmResource", new()
{
    ServiceName = "string",
    Zone = "string",
    Balance = "string",
    DisplayName = "string",
    Port = 0,
    Probe = new Ovh.IpLoadBalancing.Inputs.TcpFarmProbeArgs
    {
        Type = "string",
        ForceSsl = false,
        Interval = 0,
        Match = "string",
        Method = "string",
        Negate = false,
        Pattern = "string",
        Port = 0,
        Url = "string",
    },
    Stickiness = "string",
    VrackNetworkId = 0,
});
Copy
example, err := IpLoadBalancing.NewTcpFarm(ctx, "tcpFarmResource", &IpLoadBalancing.TcpFarmArgs{
	ServiceName: pulumi.String("string"),
	Zone:        pulumi.String("string"),
	Balance:     pulumi.String("string"),
	DisplayName: pulumi.String("string"),
	Port:        pulumi.Int(0),
	Probe: &iploadbalancing.TcpFarmProbeArgs{
		Type:     pulumi.String("string"),
		ForceSsl: pulumi.Bool(false),
		Interval: pulumi.Int(0),
		Match:    pulumi.String("string"),
		Method:   pulumi.String("string"),
		Negate:   pulumi.Bool(false),
		Pattern:  pulumi.String("string"),
		Port:     pulumi.Int(0),
		Url:      pulumi.String("string"),
	},
	Stickiness:     pulumi.String("string"),
	VrackNetworkId: pulumi.Int(0),
})
Copy
var tcpFarmResource = new TcpFarm("tcpFarmResource", TcpFarmArgs.builder()
    .serviceName("string")
    .zone("string")
    .balance("string")
    .displayName("string")
    .port(0)
    .probe(TcpFarmProbeArgs.builder()
        .type("string")
        .forceSsl(false)
        .interval(0)
        .match("string")
        .method("string")
        .negate(false)
        .pattern("string")
        .port(0)
        .url("string")
        .build())
    .stickiness("string")
    .vrackNetworkId(0)
    .build());
Copy
tcp_farm_resource = ovh.ip_load_balancing.TcpFarm("tcpFarmResource",
    service_name="string",
    zone="string",
    balance="string",
    display_name="string",
    port=0,
    probe={
        "type": "string",
        "force_ssl": False,
        "interval": 0,
        "match": "string",
        "method": "string",
        "negate": False,
        "pattern": "string",
        "port": 0,
        "url": "string",
    },
    stickiness="string",
    vrack_network_id=0)
Copy
const tcpFarmResource = new ovh.iploadbalancing.TcpFarm("tcpFarmResource", {
    serviceName: "string",
    zone: "string",
    balance: "string",
    displayName: "string",
    port: 0,
    probe: {
        type: "string",
        forceSsl: false,
        interval: 0,
        match: "string",
        method: "string",
        negate: false,
        pattern: "string",
        port: 0,
        url: "string",
    },
    stickiness: "string",
    vrackNetworkId: 0,
});
Copy
type: ovh:IpLoadBalancing:TcpFarm
properties:
    balance: string
    displayName: string
    port: 0
    probe:
        forceSsl: false
        interval: 0
        match: string
        method: string
        negate: false
        pattern: string
        port: 0
        type: string
        url: string
    serviceName: string
    stickiness: string
    vrackNetworkId: 0
    zone: string
Copy

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

ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your IP load balancing
Zone
This property is required.
Changes to this property will trigger replacement.
string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
Balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
DisplayName string
Readable label for loadbalancer farm
Port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
Probe TcpFarmProbe
define a backend healthcheck probe
Stickiness string
Stickiness type. No stickiness if null (sourceIp)
VrackNetworkId int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your IP load balancing
Zone
This property is required.
Changes to this property will trigger replacement.
string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
Balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
DisplayName string
Readable label for loadbalancer farm
Port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
Probe TcpFarmProbeArgs
define a backend healthcheck probe
Stickiness string
Stickiness type. No stickiness if null (sourceIp)
VrackNetworkId int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The internal name of your IP load balancing
zone
This property is required.
Changes to this property will trigger replacement.
String
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance String
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName String
Readable label for loadbalancer farm
port Integer
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe TcpFarmProbe
define a backend healthcheck probe
stickiness String
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId Integer
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The internal name of your IP load balancing
zone
This property is required.
Changes to this property will trigger replacement.
string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName string
Readable label for loadbalancer farm
port number
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe TcpFarmProbe
define a backend healthcheck probe
stickiness string
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId number
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
service_name
This property is required.
Changes to this property will trigger replacement.
str
The internal name of your IP load balancing
zone
This property is required.
Changes to this property will trigger replacement.
str
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance str
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
display_name str
Readable label for loadbalancer farm
port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe iploadbalancing.TcpFarmProbeArgs
define a backend healthcheck probe
stickiness str
Stickiness type. No stickiness if null (sourceIp)
vrack_network_id int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The internal name of your IP load balancing
zone
This property is required.
Changes to this property will trigger replacement.
String
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance String
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName String
Readable label for loadbalancer farm
port Number
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe Property Map
define a backend healthcheck probe
stickiness String
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId Number
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack

Outputs

All input properties are implicitly available as output properties. Additionally, the TcpFarm 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 TcpFarm Resource

Get an existing TcpFarm 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?: TcpFarmState, opts?: CustomResourceOptions): TcpFarm
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        balance: Optional[str] = None,
        display_name: Optional[str] = None,
        port: Optional[int] = None,
        probe: Optional[_iploadbalancing.TcpFarmProbeArgs] = None,
        service_name: Optional[str] = None,
        stickiness: Optional[str] = None,
        vrack_network_id: Optional[int] = None,
        zone: Optional[str] = None) -> TcpFarm
func GetTcpFarm(ctx *Context, name string, id IDInput, state *TcpFarmState, opts ...ResourceOption) (*TcpFarm, error)
public static TcpFarm Get(string name, Input<string> id, TcpFarmState? state, CustomResourceOptions? opts = null)
public static TcpFarm get(String name, Output<String> id, TcpFarmState state, CustomResourceOptions options)
resources:  _:    type: ovh:IpLoadBalancing:TcpFarm    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
DisplayName string
Readable label for loadbalancer farm
Port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
Probe TcpFarmProbe
define a backend healthcheck probe
ServiceName Changes to this property will trigger replacement. string
The internal name of your IP load balancing
Stickiness string
Stickiness type. No stickiness if null (sourceIp)
VrackNetworkId int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
Zone Changes to this property will trigger replacement. string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
Balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
DisplayName string
Readable label for loadbalancer farm
Port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
Probe TcpFarmProbeArgs
define a backend healthcheck probe
ServiceName Changes to this property will trigger replacement. string
The internal name of your IP load balancing
Stickiness string
Stickiness type. No stickiness if null (sourceIp)
VrackNetworkId int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
Zone Changes to this property will trigger replacement. string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance String
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName String
Readable label for loadbalancer farm
port Integer
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe TcpFarmProbe
define a backend healthcheck probe
serviceName Changes to this property will trigger replacement. String
The internal name of your IP load balancing
stickiness String
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId Integer
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
zone Changes to this property will trigger replacement. String
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance string
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName string
Readable label for loadbalancer farm
port number
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe TcpFarmProbe
define a backend healthcheck probe
serviceName Changes to this property will trigger replacement. string
The internal name of your IP load balancing
stickiness string
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId number
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
zone Changes to this property will trigger replacement. string
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance str
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
display_name str
Readable label for loadbalancer farm
port int
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe iploadbalancing.TcpFarmProbeArgs
define a backend healthcheck probe
service_name Changes to this property will trigger replacement. str
The internal name of your IP load balancing
stickiness str
Stickiness type. No stickiness if null (sourceIp)
vrack_network_id int
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
zone Changes to this property will trigger replacement. str
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)
balance String
Load balancing algorithm. roundrobin if null (first, leastconn, roundrobin, source)
displayName String
Readable label for loadbalancer farm
port Number
Port attached to your farm ([1..49151]). Inherited from frontend if null
probe Property Map
define a backend healthcheck probe
serviceName Changes to this property will trigger replacement. String
The internal name of your IP load balancing
stickiness String
Stickiness type. No stickiness if null (sourceIp)
vrackNetworkId Number
Internal Load Balancer identifier of the vRack private network to attach to your farm, mandatory when your Load Balancer is attached to a vRack
zone Changes to this property will trigger replacement. String
Zone where the farm will be defined (ie. GRA, BHS also supports ALL)

Supporting Types

TcpFarmProbe
, TcpFarmProbeArgs

Type This property is required. string
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
ForceSsl bool
Force use of SSL (TLS)
Interval int
probe interval, Value between 30 and 3600 seconds, default 30
Match string
What to match pattern against (contains, default, internal, matches, status)
Method string
HTTP probe method (GET, HEAD, OPTIONS, internal)
Negate bool
Negate probe result
Pattern string
Pattern to match against match
Port int
Port for backends to receive traffic on.
Url string
URL for HTTP probe type.
Type This property is required. string
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
ForceSsl bool
Force use of SSL (TLS)
Interval int
probe interval, Value between 30 and 3600 seconds, default 30
Match string
What to match pattern against (contains, default, internal, matches, status)
Method string
HTTP probe method (GET, HEAD, OPTIONS, internal)
Negate bool
Negate probe result
Pattern string
Pattern to match against match
Port int
Port for backends to receive traffic on.
Url string
URL for HTTP probe type.
type This property is required. String
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
forceSsl Boolean
Force use of SSL (TLS)
interval Integer
probe interval, Value between 30 and 3600 seconds, default 30
match String
What to match pattern against (contains, default, internal, matches, status)
method String
HTTP probe method (GET, HEAD, OPTIONS, internal)
negate Boolean
Negate probe result
pattern String
Pattern to match against match
port Integer
Port for backends to receive traffic on.
url String
URL for HTTP probe type.
type This property is required. string
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
forceSsl boolean
Force use of SSL (TLS)
interval number
probe interval, Value between 30 and 3600 seconds, default 30
match string
What to match pattern against (contains, default, internal, matches, status)
method string
HTTP probe method (GET, HEAD, OPTIONS, internal)
negate boolean
Negate probe result
pattern string
Pattern to match against match
port number
Port for backends to receive traffic on.
url string
URL for HTTP probe type.
type This property is required. str
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
force_ssl bool
Force use of SSL (TLS)
interval int
probe interval, Value between 30 and 3600 seconds, default 30
match str
What to match pattern against (contains, default, internal, matches, status)
method str
HTTP probe method (GET, HEAD, OPTIONS, internal)
negate bool
Negate probe result
pattern str
Pattern to match against match
port int
Port for backends to receive traffic on.
url str
URL for HTTP probe type.
type This property is required. String
Valid values : http, internal, mysql, oco, pgsql, smtp, tcp
forceSsl Boolean
Force use of SSL (TLS)
interval Number
probe interval, Value between 30 and 3600 seconds, default 30
match String
What to match pattern against (contains, default, internal, matches, status)
method String
HTTP probe method (GET, HEAD, OPTIONS, internal)
negate Boolean
Negate probe result
pattern String
Pattern to match against match
port Number
Port for backends to receive traffic on.
url String
URL for HTTP probe type.

Import

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

bash

$ pulumi import ovh:IpLoadBalancing/tcpFarm:TcpFarm farmname service_name/farm_id
Copy

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.