ovh.IpLoadBalancing.TcpFarmServer
Explore with Pulumi AI
Creates a backend server entry linked to loadbalancing group (farm)
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", {
port: 8080,
serviceName: lb.then(lb => lb.serviceName),
zone: "all",
});
const backend = new ovh.iploadbalancing.TcpFarmServer("backend", {
address: "4.5.6.7",
backup: true,
displayName: "mybackend",
farmId: farmname.id,
port: 80,
probe: true,
proxyProtocolVersion: "v2",
serviceName: lb.then(lb => lb.serviceName),
ssl: false,
status: "active",
weight: 2,
});
import pulumi
import pulumi_ovh as ovh
lb = ovh.IpLoadBalancing.get_ip_load_balancing(service_name="ip-1.2.3.4",
state="ok")
farmname = ovh.ip_load_balancing.TcpFarm("farmname",
port=8080,
service_name=lb.service_name,
zone="all")
backend = ovh.ip_load_balancing.TcpFarmServer("backend",
address="4.5.6.7",
backup=True,
display_name="mybackend",
farm_id=farmname.id,
port=80,
probe=True,
proxy_protocol_version="v2",
service_name=lb.service_name,
ssl=False,
status="active",
weight=2)
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 {
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
}
farmname, err := IpLoadBalancing.NewTcpFarm(ctx, "farmname", &IpLoadBalancing.TcpFarmArgs{
Port: pulumi.Int(8080),
ServiceName: pulumi.String(lb.ServiceName),
Zone: pulumi.String("all"),
})
if err != nil {
return err
}
_, err = IpLoadBalancing.NewTcpFarmServer(ctx, "backend", &IpLoadBalancing.TcpFarmServerArgs{
Address: pulumi.String("4.5.6.7"),
Backup: pulumi.Bool(true),
DisplayName: pulumi.String("mybackend"),
FarmId: farmname.ID(),
Port: pulumi.Int(80),
Probe: pulumi.Bool(true),
ProxyProtocolVersion: pulumi.String("v2"),
ServiceName: pulumi.String(lb.ServiceName),
Ssl: pulumi.Bool(false),
Status: pulumi.String("active"),
Weight: pulumi.Int(2),
})
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 lb = Ovh.IpLoadBalancing.GetIpLoadBalancing.Invoke(new()
{
ServiceName = "ip-1.2.3.4",
State = "ok",
});
var farmname = new Ovh.IpLoadBalancing.TcpFarm("farmname", new()
{
Port = 8080,
ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
Zone = "all",
});
var backend = new Ovh.IpLoadBalancing.TcpFarmServer("backend", new()
{
Address = "4.5.6.7",
Backup = true,
DisplayName = "mybackend",
FarmId = farmname.Id,
Port = 80,
Probe = true,
ProxyProtocolVersion = "v2",
ServiceName = lb.Apply(getIpLoadBalancingResult => getIpLoadBalancingResult.ServiceName),
Ssl = false,
Status = "active",
Weight = 2,
});
});
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 com.pulumi.ovh.IpLoadBalancing.TcpFarmServer;
import com.pulumi.ovh.IpLoadBalancing.TcpFarmServerArgs;
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()
.port(8080)
.serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
.zone("all")
.build());
var backend = new TcpFarmServer("backend", TcpFarmServerArgs.builder()
.address("4.5.6.7")
.backup(true)
.displayName("mybackend")
.farmId(farmname.id())
.port(80)
.probe(true)
.proxyProtocolVersion("v2")
.serviceName(lb.applyValue(getIpLoadBalancingResult -> getIpLoadBalancingResult.serviceName()))
.ssl(false)
.status("active")
.weight(2)
.build());
}
}
resources:
farmname:
type: ovh:IpLoadBalancing:TcpFarm
properties:
port: 8080
serviceName: ${lb.serviceName}
zone: all
backend:
type: ovh:IpLoadBalancing:TcpFarmServer
properties:
address: 4.5.6.7
backup: true
displayName: mybackend
farmId: ${farmname.id}
port: 80
probe: true
proxyProtocolVersion: v2
serviceName: ${lb.serviceName}
ssl: false
status: active
weight: 2
variables:
lb:
fn::invoke:
Function: ovh:IpLoadBalancing:getIpLoadBalancing
Arguments:
serviceName: ip-1.2.3.4
state: ok
Create TcpFarmServer Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TcpFarmServer(name: string, args: TcpFarmServerArgs, opts?: CustomResourceOptions);
@overload
def TcpFarmServer(resource_name: str,
args: TcpFarmServerArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TcpFarmServer(resource_name: str,
opts: Optional[ResourceOptions] = None,
farm_id: Optional[int] = None,
status: Optional[str] = None,
service_name: Optional[str] = None,
address: Optional[str] = None,
display_name: Optional[str] = None,
on_marked_down: Optional[str] = None,
port: Optional[int] = None,
probe: Optional[bool] = None,
proxy_protocol_version: Optional[str] = None,
chain: Optional[str] = None,
ssl: Optional[bool] = None,
backup: Optional[bool] = None,
weight: Optional[int] = None)
func NewTcpFarmServer(ctx *Context, name string, args TcpFarmServerArgs, opts ...ResourceOption) (*TcpFarmServer, error)
public TcpFarmServer(string name, TcpFarmServerArgs args, CustomResourceOptions? opts = null)
public TcpFarmServer(String name, TcpFarmServerArgs args)
public TcpFarmServer(String name, TcpFarmServerArgs args, CustomResourceOptions options)
type: ovh:IpLoadBalancing:TcpFarmServer
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 TcpFarmServerArgs
- 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 TcpFarmServerArgs
- 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 TcpFarmServerArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TcpFarmServerArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TcpFarmServerArgs
- 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 tcpFarmServerResource = new Ovh.IpLoadBalancing.TcpFarmServer("tcpFarmServerResource", new()
{
FarmId = 0,
Status = "string",
ServiceName = "string",
Address = "string",
DisplayName = "string",
OnMarkedDown = "string",
Port = 0,
Probe = false,
ProxyProtocolVersion = "string",
Chain = "string",
Ssl = false,
Backup = false,
Weight = 0,
});
example, err := IpLoadBalancing.NewTcpFarmServer(ctx, "tcpFarmServerResource", &IpLoadBalancing.TcpFarmServerArgs{
FarmId: pulumi.Int(0),
Status: pulumi.String("string"),
ServiceName: pulumi.String("string"),
Address: pulumi.String("string"),
DisplayName: pulumi.String("string"),
OnMarkedDown: pulumi.String("string"),
Port: pulumi.Int(0),
Probe: pulumi.Bool(false),
ProxyProtocolVersion: pulumi.String("string"),
Chain: pulumi.String("string"),
Ssl: pulumi.Bool(false),
Backup: pulumi.Bool(false),
Weight: pulumi.Int(0),
})
var tcpFarmServerResource = new TcpFarmServer("tcpFarmServerResource", TcpFarmServerArgs.builder()
.farmId(0)
.status("string")
.serviceName("string")
.address("string")
.displayName("string")
.onMarkedDown("string")
.port(0)
.probe(false)
.proxyProtocolVersion("string")
.chain("string")
.ssl(false)
.backup(false)
.weight(0)
.build());
tcp_farm_server_resource = ovh.ip_load_balancing.TcpFarmServer("tcpFarmServerResource",
farm_id=0,
status="string",
service_name="string",
address="string",
display_name="string",
on_marked_down="string",
port=0,
probe=False,
proxy_protocol_version="string",
chain="string",
ssl=False,
backup=False,
weight=0)
const tcpFarmServerResource = new ovh.iploadbalancing.TcpFarmServer("tcpFarmServerResource", {
farmId: 0,
status: "string",
serviceName: "string",
address: "string",
displayName: "string",
onMarkedDown: "string",
port: 0,
probe: false,
proxyProtocolVersion: "string",
chain: "string",
ssl: false,
backup: false,
weight: 0,
});
type: ovh:IpLoadBalancing:TcpFarmServer
properties:
address: string
backup: false
chain: string
displayName: string
farmId: 0
onMarkedDown: string
port: 0
probe: false
proxyProtocolVersion: string
serviceName: string
ssl: false
status: string
weight: 0
TcpFarmServer 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 TcpFarmServer resource accepts the following input properties:
- Address string
- Address of the backend server (IP from either internal or OVHcloud network)
- Farm
Id int - ID of the farm this server is attached to
- Service
Name string - The internal name of your IP load balancing
- Status string
- backend status -
active
orinactive
- Backup bool
- is it a backup server used in case of failure of all the non-backup backends
- Chain string
- Display
Name string - Label for the server
- On
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - Port int
- Port that backend will respond on
- Probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- Proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - Ssl bool
- is the connection ciphered with SSL (TLS)
- Weight int
- used in loadbalancing algorithm
- Address string
- Address of the backend server (IP from either internal or OVHcloud network)
- Farm
Id int - ID of the farm this server is attached to
- Service
Name string - The internal name of your IP load balancing
- Status string
- backend status -
active
orinactive
- Backup bool
- is it a backup server used in case of failure of all the non-backup backends
- Chain string
- Display
Name string - Label for the server
- On
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - Port int
- Port that backend will respond on
- Probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- Proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - Ssl bool
- is the connection ciphered with SSL (TLS)
- Weight int
- used in loadbalancing algorithm
- address String
- Address of the backend server (IP from either internal or OVHcloud network)
- farm
Id Integer - ID of the farm this server is attached to
- service
Name String - The internal name of your IP load balancing
- status String
- backend status -
active
orinactive
- backup Boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain String
- display
Name String - Label for the server
- on
Marked StringDown - enable action when backend marked down. (
shutdown-sessions
) - port Integer
- Port that backend will respond on
- probe Boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol StringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - ssl Boolean
- is the connection ciphered with SSL (TLS)
- weight Integer
- used in loadbalancing algorithm
- address string
- Address of the backend server (IP from either internal or OVHcloud network)
- farm
Id number - ID of the farm this server is attached to
- service
Name string - The internal name of your IP load balancing
- status string
- backend status -
active
orinactive
- backup boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain string
- display
Name string - Label for the server
- on
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - port number
- Port that backend will respond on
- probe boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - ssl boolean
- is the connection ciphered with SSL (TLS)
- weight number
- used in loadbalancing algorithm
- address str
- Address of the backend server (IP from either internal or OVHcloud network)
- farm_
id int - ID of the farm this server is attached to
- service_
name str - The internal name of your IP load balancing
- status str
- backend status -
active
orinactive
- backup bool
- is it a backup server used in case of failure of all the non-backup backends
- chain str
- display_
name str - Label for the server
- on_
marked_ strdown - enable action when backend marked down. (
shutdown-sessions
) - port int
- Port that backend will respond on
- probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy_
protocol_ strversion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - ssl bool
- is the connection ciphered with SSL (TLS)
- weight int
- used in loadbalancing algorithm
- address String
- Address of the backend server (IP from either internal or OVHcloud network)
- farm
Id Number - ID of the farm this server is attached to
- service
Name String - The internal name of your IP load balancing
- status String
- backend status -
active
orinactive
- backup Boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain String
- display
Name String - Label for the server
- on
Marked StringDown - enable action when backend marked down. (
shutdown-sessions
) - port Number
- Port that backend will respond on
- probe Boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol StringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - ssl Boolean
- is the connection ciphered with SSL (TLS)
- weight Number
- used in loadbalancing algorithm
Outputs
All input properties are implicitly available as output properties. Additionally, the TcpFarmServer 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 TcpFarmServer Resource
Get an existing TcpFarmServer 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?: TcpFarmServerState, opts?: CustomResourceOptions): TcpFarmServer
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address: Optional[str] = None,
backup: Optional[bool] = None,
chain: Optional[str] = None,
display_name: Optional[str] = None,
farm_id: Optional[int] = None,
on_marked_down: Optional[str] = None,
port: Optional[int] = None,
probe: Optional[bool] = None,
proxy_protocol_version: Optional[str] = None,
service_name: Optional[str] = None,
ssl: Optional[bool] = None,
status: Optional[str] = None,
weight: Optional[int] = None) -> TcpFarmServer
func GetTcpFarmServer(ctx *Context, name string, id IDInput, state *TcpFarmServerState, opts ...ResourceOption) (*TcpFarmServer, error)
public static TcpFarmServer Get(string name, Input<string> id, TcpFarmServerState? state, CustomResourceOptions? opts = null)
public static TcpFarmServer get(String name, Output<String> id, TcpFarmServerState 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.
- Address string
- Address of the backend server (IP from either internal or OVHcloud network)
- Backup bool
- is it a backup server used in case of failure of all the non-backup backends
- Chain string
- Display
Name string - Label for the server
- Farm
Id int - ID of the farm this server is attached to
- On
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - Port int
- Port that backend will respond on
- Probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- Proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - Service
Name string - The internal name of your IP load balancing
- Ssl bool
- is the connection ciphered with SSL (TLS)
- Status string
- backend status -
active
orinactive
- Weight int
- used in loadbalancing algorithm
- Address string
- Address of the backend server (IP from either internal or OVHcloud network)
- Backup bool
- is it a backup server used in case of failure of all the non-backup backends
- Chain string
- Display
Name string - Label for the server
- Farm
Id int - ID of the farm this server is attached to
- On
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - Port int
- Port that backend will respond on
- Probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- Proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - Service
Name string - The internal name of your IP load balancing
- Ssl bool
- is the connection ciphered with SSL (TLS)
- Status string
- backend status -
active
orinactive
- Weight int
- used in loadbalancing algorithm
- address String
- Address of the backend server (IP from either internal or OVHcloud network)
- backup Boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain String
- display
Name String - Label for the server
- farm
Id Integer - ID of the farm this server is attached to
- on
Marked StringDown - enable action when backend marked down. (
shutdown-sessions
) - port Integer
- Port that backend will respond on
- probe Boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol StringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - service
Name String - The internal name of your IP load balancing
- ssl Boolean
- is the connection ciphered with SSL (TLS)
- status String
- backend status -
active
orinactive
- weight Integer
- used in loadbalancing algorithm
- address string
- Address of the backend server (IP from either internal or OVHcloud network)
- backup boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain string
- display
Name string - Label for the server
- farm
Id number - ID of the farm this server is attached to
- on
Marked stringDown - enable action when backend marked down. (
shutdown-sessions
) - port number
- Port that backend will respond on
- probe boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol stringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - service
Name string - The internal name of your IP load balancing
- ssl boolean
- is the connection ciphered with SSL (TLS)
- status string
- backend status -
active
orinactive
- weight number
- used in loadbalancing algorithm
- address str
- Address of the backend server (IP from either internal or OVHcloud network)
- backup bool
- is it a backup server used in case of failure of all the non-backup backends
- chain str
- display_
name str - Label for the server
- farm_
id int - ID of the farm this server is attached to
- on_
marked_ strdown - enable action when backend marked down. (
shutdown-sessions
) - port int
- Port that backend will respond on
- probe bool
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy_
protocol_ strversion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - service_
name str - The internal name of your IP load balancing
- ssl bool
- is the connection ciphered with SSL (TLS)
- status str
- backend status -
active
orinactive
- weight int
- used in loadbalancing algorithm
- address String
- Address of the backend server (IP from either internal or OVHcloud network)
- backup Boolean
- is it a backup server used in case of failure of all the non-backup backends
- chain String
- display
Name String - Label for the server
- farm
Id Number - ID of the farm this server is attached to
- on
Marked StringDown - enable action when backend marked down. (
shutdown-sessions
) - port Number
- Port that backend will respond on
- probe Boolean
- defines if backend will be probed to determine health and keep as active in farm if healthy
- proxy
Protocol StringVersion - version of the PROXY protocol used to pass origin connection information from loadbalancer to receiving service (
v1
,v2
,v2-ssl
,v2-ssl-cn
) - service
Name String - The internal name of your IP load balancing
- ssl Boolean
- is the connection ciphered with SSL (TLS)
- status String
- backend status -
active
orinactive
- weight Number
- used in loadbalancing algorithm
Import
TCP farm server can be imported using the following format service_name
, the id
of the farm and the id
of the server separated by “/” e.g.
$ terraform import ovh_iploadbalancing_tcp_farm_server.backend service_name/farm_id/server_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.