The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

LoadBalancer

Create a LoadBalancer Resource

def LoadBalancer(resource_name: str, opts: Optional[ResourceOptions] = None, backends: Optional[Sequence[LoadBalancerBackendArgs]] = None, fail_timeout: Optional[int] = None, health_check_path: Optional[str] = None, hostname: Optional[str] = None, ignore_invalid_backend_tls: Optional[bool] = None, max_conns: Optional[int] = None, max_request_size: Optional[int] = None, policy: Optional[str] = None, port: Optional[int] = None, protocol: Optional[str] = None, tls_certificate: Optional[str] = None, tls_key: Optional[str] = None)
func NewLoadBalancer(ctx *Context, name string, args LoadBalancerArgs, opts ...ResourceOption) (*LoadBalancer, error)
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args LoadBalancerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

LoadBalancer Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The LoadBalancer resource accepts the following input properties:

Backends List<LoadBalancerBackendArgs>

a list of backend instances, each containing an instance_id, protocol (http or https) and port

FailTimeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

Hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

MaxConns int

how many concurrent connections can each backend handle, defaults to 10

MaxRequestSize int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

Policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

Port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

Protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

HealthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

IgnoreInvalidBackendTls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

TlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

TlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

Backends []LoadBalancerBackend

a list of backend instances, each containing an instance_id, protocol (http or https) and port

FailTimeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

Hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

MaxConns int

how many concurrent connections can each backend handle, defaults to 10

MaxRequestSize int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

Policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

Port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

Protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

HealthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

IgnoreInvalidBackendTls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

TlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

TlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

backends LoadBalancerBackend[]

a list of backend instances, each containing an instance_id, protocol (http or https) and port

failTimeout number

how long to wait in seconds before determining a backend has failed, defaults to 30

hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

maxConns number

how many concurrent connections can each backend handle, defaults to 10

maxRequestSize number

the size in megabytes of the maximum request content that will be accepted, defaults to 20

policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

port number

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

healthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

ignoreInvalidBackendTls boolean

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

tlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

tlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

backends Sequence[LoadBalancerBackendArgs]

a list of backend instances, each containing an instance_id, protocol (http or https) and port

fail_timeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

hostname str

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

max_conns int

how many concurrent connections can each backend handle, defaults to 10

max_request_size int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

policy str

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

protocol str

either http or https. If you specify https then you must also provide the next two fields, the default is http

health_check_path str

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

ignore_invalid_backend_tls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

tls_certificate str

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

tls_key str

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

Outputs

All input properties are implicitly available as output properties. Additionally, the LoadBalancer 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing LoadBalancer Resource

Get an existing LoadBalancer 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?: LoadBalancerState, opts?: CustomResourceOptions): LoadBalancer
@staticmethod
def get(resource_name: str, id: str, opts: Optional[ResourceOptions] = None, backends: Optional[Sequence[LoadBalancerBackendArgs]] = None, fail_timeout: Optional[int] = None, health_check_path: Optional[str] = None, hostname: Optional[str] = None, ignore_invalid_backend_tls: Optional[bool] = None, max_conns: Optional[int] = None, max_request_size: Optional[int] = None, policy: Optional[str] = None, port: Optional[int] = None, protocol: Optional[str] = None, tls_certificate: Optional[str] = None, tls_key: Optional[str] = None) -> LoadBalancer
func GetLoadBalancer(ctx *Context, name string, id IDInput, state *LoadBalancerState, opts ...ResourceOption) (*LoadBalancer, error)
public static LoadBalancer Get(string name, Input<string> id, LoadBalancerState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

Backends List<LoadBalancerBackendArgs>

a list of backend instances, each containing an instance_id, protocol (http or https) and port

FailTimeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

HealthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

Hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

IgnoreInvalidBackendTls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

MaxConns int

how many concurrent connections can each backend handle, defaults to 10

MaxRequestSize int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

Policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

Port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

Protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

TlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

TlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

Backends []LoadBalancerBackend

a list of backend instances, each containing an instance_id, protocol (http or https) and port

FailTimeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

HealthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

Hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

IgnoreInvalidBackendTls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

MaxConns int

how many concurrent connections can each backend handle, defaults to 10

MaxRequestSize int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

Policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

Port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

Protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

TlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

TlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

backends LoadBalancerBackend[]

a list of backend instances, each containing an instance_id, protocol (http or https) and port

failTimeout number

how long to wait in seconds before determining a backend has failed, defaults to 30

healthCheckPath string

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

hostname string

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

ignoreInvalidBackendTls boolean

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

maxConns number

how many concurrent connections can each backend handle, defaults to 10

maxRequestSize number

the size in megabytes of the maximum request content that will be accepted, defaults to 20

policy string

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

port number

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

protocol string

either http or https. If you specify https then you must also provide the next two fields, the default is http

tlsCertificate string

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

tlsKey string

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

backends Sequence[LoadBalancerBackendArgs]

a list of backend instances, each containing an instance_id, protocol (http or https) and port

fail_timeout int

how long to wait in seconds before determining a backend has failed, defaults to 30

health_check_path str

what URL should be used on the backends to determine if it’s OK (2xx/3xx status), defaults to /

hostname str

the hostname to receive traffic for, e.g. www.example.com (optional: sets hostname to loadbalancer-uuid.civo.com if blank)

ignore_invalid_backend_tls bool

should self-signed/invalid certificates be ignored from the backend servers, defaults to true

max_conns int

how many concurrent connections can each backend handle, defaults to 10

max_request_size int

the size in megabytes of the maximum request content that will be accepted, defaults to 20

policy str

one of: least_conn (sends new requests to the least busy server), random (sends new requests to a random backend), round_robin (sends new requests to the next backend in order), ip_hash (sends requests from a given IP address to the same backend), default is random

port int

you can listen on any port, the default is 80 to match the default protocol of http,if not you must specify it here (commonly 80 for HTTP or 443 for HTTPS)

protocol str

either http or https. If you specify https then you must also provide the next two fields, the default is http

tls_certificate str

if your protocol is https then you should send the TLS certificate in Base64-encoded PEM format

tls_key str

if your protocol is https then you should send the TLS private key in Base64-encoded PEM format

Supporting Types

LoadBalancerBackend

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

InstanceId string
Port int
Protocol string
InstanceId string
Port int
Protocol string
instanceId string
port number
protocol string
instance_id str
port int
protocol str

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.