hcloud.LoadBalancerService
Explore with Pulumi AI
Define services for Hetzner Cloud Load Balancers.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using HCloud = Pulumi.HCloud;
return await Deployment.RunAsync(() =>
{
var loadBalancer = new HCloud.LoadBalancer("loadBalancer", new()
{
LoadBalancerType = "lb11",
Location = "nbg1",
});
var loadBalancerService = new HCloud.LoadBalancerService("loadBalancerService", new()
{
LoadBalancerId = hcloud_load_balancer.Test_load_balancer.Id,
Protocol = "http",
});
});
package main
import (
"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := hcloud.NewLoadBalancer(ctx, "loadBalancer", &hcloud.LoadBalancerArgs{
LoadBalancerType: pulumi.String("lb11"),
Location: pulumi.String("nbg1"),
})
if err != nil {
return err
}
_, err = hcloud.NewLoadBalancerService(ctx, "loadBalancerService", &hcloud.LoadBalancerServiceArgs{
LoadBalancerId: pulumi.Any(hcloud_load_balancer.Test_load_balancer.Id),
Protocol: pulumi.String("http"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.hcloud.LoadBalancer;
import com.pulumi.hcloud.LoadBalancerArgs;
import com.pulumi.hcloud.LoadBalancerService;
import com.pulumi.hcloud.LoadBalancerServiceArgs;
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 loadBalancer = new LoadBalancer("loadBalancer", LoadBalancerArgs.builder()
.loadBalancerType("lb11")
.location("nbg1")
.build());
var loadBalancerService = new LoadBalancerService("loadBalancerService", LoadBalancerServiceArgs.builder()
.loadBalancerId(hcloud_load_balancer.test_load_balancer().id())
.protocol("http")
.build());
}
}
import pulumi
import pulumi_hcloud as hcloud
load_balancer = hcloud.LoadBalancer("loadBalancer",
load_balancer_type="lb11",
location="nbg1")
load_balancer_service = hcloud.LoadBalancerService("loadBalancerService",
load_balancer_id=hcloud_load_balancer["test_load_balancer"]["id"],
protocol="http")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";
const loadBalancer = new hcloud.LoadBalancer("loadBalancer", {
loadBalancerType: "lb11",
location: "nbg1",
});
const loadBalancerService = new hcloud.LoadBalancerService("loadBalancerService", {
loadBalancerId: hcloud_load_balancer.test_load_balancer.id,
protocol: "http",
});
resources:
loadBalancer:
type: hcloud:LoadBalancer
properties:
loadBalancerType: lb11
location: nbg1
loadBalancerService:
type: hcloud:LoadBalancerService
properties:
loadBalancerId: ${hcloud_load_balancer.test_load_balancer.id}
protocol: http
Create LoadBalancerService Resource
new LoadBalancerService(name: string, args: LoadBalancerServiceArgs, opts?: CustomResourceOptions);
@overload
def LoadBalancerService(resource_name: str,
opts: Optional[ResourceOptions] = None,
destination_port: Optional[int] = None,
health_check: Optional[LoadBalancerServiceHealthCheckArgs] = None,
http: Optional[LoadBalancerServiceHttpArgs] = None,
listen_port: Optional[int] = None,
load_balancer_id: Optional[str] = None,
protocol: Optional[str] = None,
proxyprotocol: Optional[bool] = None)
@overload
def LoadBalancerService(resource_name: str,
args: LoadBalancerServiceArgs,
opts: Optional[ResourceOptions] = None)
func NewLoadBalancerService(ctx *Context, name string, args LoadBalancerServiceArgs, opts ...ResourceOption) (*LoadBalancerService, error)
public LoadBalancerService(string name, LoadBalancerServiceArgs args, CustomResourceOptions? opts = null)
public LoadBalancerService(String name, LoadBalancerServiceArgs args)
public LoadBalancerService(String name, LoadBalancerServiceArgs args, CustomResourceOptions options)
type: hcloud:LoadBalancerService
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerServiceArgs
- 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 LoadBalancerServiceArgs
- 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 LoadBalancerServiceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LoadBalancerServiceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LoadBalancerServiceArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
LoadBalancerService 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 LoadBalancerService resource accepts the following input properties:
- Load
Balancer stringId Id of the load balancer this service belongs to.
- Protocol string
Protocol of the service.
http
,https
ortcp
- Destination
Port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- Health
Check Pulumi.HCloud. Inputs. Load Balancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- Http
Pulumi.
HCloud. Inputs. Load Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- Listen
Port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Proxyprotocol bool
Enable proxyprotocol.
- Load
Balancer stringId Id of the load balancer this service belongs to.
- Protocol string
Protocol of the service.
http
,https
ortcp
- Destination
Port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- Health
Check LoadBalancer Service Health Check Args List of health check configurations when
protocol
ishttp
orhttps
.- Http
Load
Balancer Service Http Args List of http configurations when
protocol
ishttp
orhttps
.- Listen
Port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Proxyprotocol bool
Enable proxyprotocol.
- load
Balancer StringId Id of the load balancer this service belongs to.
- protocol String
Protocol of the service.
http
,https
ortcp
- destination
Port Integer Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check LoadBalancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- listen
Port Integer Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- proxyprotocol Boolean
Enable proxyprotocol.
- load
Balancer stringId Id of the load balancer this service belongs to.
- protocol string
Protocol of the service.
http
,https
ortcp
- destination
Port number Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check LoadBalancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- listen
Port number Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- proxyprotocol boolean
Enable proxyprotocol.
- load_
balancer_ strid Id of the load balancer this service belongs to.
- protocol str
Protocol of the service.
http
,https
ortcp
- destination_
port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health_
check LoadBalancer Service Health Check Args List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http Args List of http configurations when
protocol
ishttp
orhttps
.- listen_
port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- proxyprotocol bool
Enable proxyprotocol.
- load
Balancer StringId Id of the load balancer this service belongs to.
- protocol String
Protocol of the service.
http
,https
ortcp
- destination
Port Number Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check Property Map List of health check configurations when
protocol
ishttp
orhttps
.- http Property Map
List of http configurations when
protocol
ishttp
orhttps
.- listen
Port Number Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- proxyprotocol Boolean
Enable proxyprotocol.
Outputs
All input properties are implicitly available as output properties. Additionally, the LoadBalancerService 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 LoadBalancerService Resource
Get an existing LoadBalancerService 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?: LoadBalancerServiceState, opts?: CustomResourceOptions): LoadBalancerService
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
destination_port: Optional[int] = None,
health_check: Optional[LoadBalancerServiceHealthCheckArgs] = None,
http: Optional[LoadBalancerServiceHttpArgs] = None,
listen_port: Optional[int] = None,
load_balancer_id: Optional[str] = None,
protocol: Optional[str] = None,
proxyprotocol: Optional[bool] = None) -> LoadBalancerService
func GetLoadBalancerService(ctx *Context, name string, id IDInput, state *LoadBalancerServiceState, opts ...ResourceOption) (*LoadBalancerService, error)
public static LoadBalancerService Get(string name, Input<string> id, LoadBalancerServiceState? state, CustomResourceOptions? opts = null)
public static LoadBalancerService get(String name, Output<String> id, LoadBalancerServiceState 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.
- Destination
Port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- Health
Check Pulumi.HCloud. Inputs. Load Balancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- Http
Pulumi.
HCloud. Inputs. Load Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- Listen
Port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Load
Balancer stringId Id of the load balancer this service belongs to.
- Protocol string
Protocol of the service.
http
,https
ortcp
- Proxyprotocol bool
Enable proxyprotocol.
- Destination
Port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- Health
Check LoadBalancer Service Health Check Args List of health check configurations when
protocol
ishttp
orhttps
.- Http
Load
Balancer Service Http Args List of http configurations when
protocol
ishttp
orhttps
.- Listen
Port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Load
Balancer stringId Id of the load balancer this service belongs to.
- Protocol string
Protocol of the service.
http
,https
ortcp
- Proxyprotocol bool
Enable proxyprotocol.
- destination
Port Integer Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check LoadBalancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- listen
Port Integer Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- load
Balancer StringId Id of the load balancer this service belongs to.
- protocol String
Protocol of the service.
http
,https
ortcp
- proxyprotocol Boolean
Enable proxyprotocol.
- destination
Port number Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check LoadBalancer Service Health Check List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http List of http configurations when
protocol
ishttp
orhttps
.- listen
Port number Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- load
Balancer stringId Id of the load balancer this service belongs to.
- protocol string
Protocol of the service.
http
,https
ortcp
- proxyprotocol boolean
Enable proxyprotocol.
- destination_
port int Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health_
check LoadBalancer Service Health Check Args List of health check configurations when
protocol
ishttp
orhttps
.- http
Load
Balancer Service Http Args List of http configurations when
protocol
ishttp
orhttps
.- listen_
port int Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- load_
balancer_ strid Id of the load balancer this service belongs to.
- protocol str
Protocol of the service.
http
,https
ortcp
- proxyprotocol bool
Enable proxyprotocol.
- destination
Port Number Port the service connects to the targets on, required if protocol is
tcp
. Can be everything between1
and65535
.- health
Check Property Map List of health check configurations when
protocol
ishttp
orhttps
.- http Property Map
List of http configurations when
protocol
ishttp
orhttps
.- listen
Port Number Port the service listen on, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- load
Balancer StringId Id of the load balancer this service belongs to.
- protocol String
Protocol of the service.
http
,https
ortcp
- proxyprotocol Boolean
Enable proxyprotocol.
Supporting Types
LoadBalancerServiceHealthCheck, LoadBalancerServiceHealthCheckArgs
- Interval int
Interval how often the health check will be performed, in seconds.
- Port int
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Protocol string
Protocol the health check uses.
http
ortcp
- Timeout int
Timeout when a health check try will be canceled if there is no response, in seconds.
- Http
Pulumi.
HCloud. Inputs. Load Balancer Service Health Check Http List of http configurations. Required if
protocol
ishttp
.- Retries int
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
- Interval int
Interval how often the health check will be performed, in seconds.
- Port int
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- Protocol string
Protocol the health check uses.
http
ortcp
- Timeout int
Timeout when a health check try will be canceled if there is no response, in seconds.
- Http
Load
Balancer Service Health Check Http List of http configurations. Required if
protocol
ishttp
.- Retries int
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
- interval Integer
Interval how often the health check will be performed, in seconds.
- port Integer
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- protocol String
Protocol the health check uses.
http
ortcp
- timeout Integer
Timeout when a health check try will be canceled if there is no response, in seconds.
- http
Load
Balancer Service Health Check Http List of http configurations. Required if
protocol
ishttp
.- retries Integer
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
- interval number
Interval how often the health check will be performed, in seconds.
- port number
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- protocol string
Protocol the health check uses.
http
ortcp
- timeout number
Timeout when a health check try will be canceled if there is no response, in seconds.
- http
Load
Balancer Service Health Check Http List of http configurations. Required if
protocol
ishttp
.- retries number
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
- interval int
Interval how often the health check will be performed, in seconds.
- port int
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- protocol str
Protocol the health check uses.
http
ortcp
- timeout int
Timeout when a health check try will be canceled if there is no response, in seconds.
- http
Load
Balancer Service Health Check Http List of http configurations. Required if
protocol
ishttp
.- retries int
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
- interval Number
Interval how often the health check will be performed, in seconds.
- port Number
Port the health check tries to connect to, required if protocol is
tcp
. Can be everything between1
and65535
. Must be unique per Load Balancer.- protocol String
Protocol the health check uses.
http
ortcp
- timeout Number
Timeout when a health check try will be canceled if there is no response, in seconds.
- http Property Map
List of http configurations. Required if
protocol
ishttp
.- retries Number
Number of tries a health check will be performed until a target will be listed as
unhealthy
.
LoadBalancerServiceHealthCheckHttp, LoadBalancerServiceHealthCheckHttpArgs
- Domain string
Domain we try to access when performing the Health Check.
- Path string
Path we try to access when performing the Health Check.
- Response string
Response we expect to be included in the Target response when a Health Check was performed.
- Status
Codes List<string> We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- Tls bool
Enable TLS certificate checking.
- Domain string
Domain we try to access when performing the Health Check.
- Path string
Path we try to access when performing the Health Check.
- Response string
Response we expect to be included in the Target response when a Health Check was performed.
- Status
Codes []string We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- Tls bool
Enable TLS certificate checking.
- domain String
Domain we try to access when performing the Health Check.
- path String
Path we try to access when performing the Health Check.
- response String
Response we expect to be included in the Target response when a Health Check was performed.
- status
Codes List<String> We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- tls Boolean
Enable TLS certificate checking.
- domain string
Domain we try to access when performing the Health Check.
- path string
Path we try to access when performing the Health Check.
- response string
Response we expect to be included in the Target response when a Health Check was performed.
- status
Codes string[] We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- tls boolean
Enable TLS certificate checking.
- domain str
Domain we try to access when performing the Health Check.
- path str
Path we try to access when performing the Health Check.
- response str
Response we expect to be included in the Target response when a Health Check was performed.
- status_
codes Sequence[str] We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- tls bool
Enable TLS certificate checking.
- domain String
Domain we try to access when performing the Health Check.
- path String
Path we try to access when performing the Health Check.
- response String
Response we expect to be included in the Target response when a Health Check was performed.
- status
Codes List<String> We expect that the target answers with these status codes. If not the target is marked as
unhealthy
.- tls Boolean
Enable TLS certificate checking.
LoadBalancerServiceHttp, LoadBalancerServiceHttpArgs
- Certificates List<int>
List of IDs from certificates which the Load Balancer has.
- int
Lifetime of the cookie for sticky session (in seconds). Default:
300
- string
Name of the cookie for sticky session. Default:
HCLBSTICKY
- Redirect
Http bool Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- Sticky
Sessions bool Enable sticky sessions
- Certificates []int
List of IDs from certificates which the Load Balancer has.
- int
Lifetime of the cookie for sticky session (in seconds). Default:
300
- string
Name of the cookie for sticky session. Default:
HCLBSTICKY
- Redirect
Http bool Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- Sticky
Sessions bool Enable sticky sessions
- certificates List<Integer>
List of IDs from certificates which the Load Balancer has.
- Integer
Lifetime of the cookie for sticky session (in seconds). Default:
300
- String
Name of the cookie for sticky session. Default:
HCLBSTICKY
- redirect
Http Boolean Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- sticky
Sessions Boolean Enable sticky sessions
- certificates number[]
List of IDs from certificates which the Load Balancer has.
- number
Lifetime of the cookie for sticky session (in seconds). Default:
300
- string
Name of the cookie for sticky session. Default:
HCLBSTICKY
- redirect
Http boolean Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- sticky
Sessions boolean Enable sticky sessions
- certificates Sequence[int]
List of IDs from certificates which the Load Balancer has.
- int
Lifetime of the cookie for sticky session (in seconds). Default:
300
- str
Name of the cookie for sticky session. Default:
HCLBSTICKY
- redirect_
http bool Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- sticky_
sessions bool Enable sticky sessions
- certificates List<Number>
List of IDs from certificates which the Load Balancer has.
- Number
Lifetime of the cookie for sticky session (in seconds). Default:
300
- String
Name of the cookie for sticky session. Default:
HCLBSTICKY
- redirect
Http Boolean Redirect HTTP to HTTPS traffic. Only supported for services with
protocol
https
using the default HTTP port80
.- sticky
Sessions Boolean Enable sticky sessions
Import
Load Balancer Service entries can be imported using a compound ID with the following format<load-balancer-id>__<listen-port>
$ pulumi import hcloud:index/loadBalancerService:LoadBalancerService myloadbalancernetwork 123__80
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
hcloud
Terraform Provider.