Skip to main content

DigitalOcean Loadbalancer - Terraform

Requirements

NameVersion
terraform>= 1.9
digitalocean~> 2.40

Providers

NameVersion
digitalocean~> 2.40

Modules

No modules.

Resources

NameType
digitalocean_loadbalancer.publicresource

Inputs

NameDescriptionTypeDefaultRequired
cookie_ttl_secondsThe time-to-live (TTL) for the cookie in seconds.numbernullno
disable_lets_encrypt_dns_recordsBoolean controlling whether to disable the creation of DNS records for Let's Encrypt certificates.boolfalseno
droplet_idsA list of Droplet IDs to be assigned to the Load Balancer.list(string)nullno
droplet_tagThe tag of Droplets to be assigned to the Load Balancer.stringnullno
enable_backend_keepaliveBoolean controlling whether to enable backend keepalive.boolfalseno
enable_proxy_protocolBoolean controlling whether to enable the PROXY protocol.boolfalseno
firewall_allowA list of firewall rules to allow.list(any)[]no
firewall_denyA list of firewall rules to deny.list(any)[]no
forwarding_rulesA map of forwarding rules for the Load Balancer.
map(object({
entry_port = number
entry_protocol = string
target_port = number
target_protocol = string
certificate_name = string
tls_passthrough = bool
}))
\{}no
healthcheck_check_interval_secondsThe interval between health checks in seconds.number10no
healthcheck_pathThe path to use for health checks.string"/"no
healthcheck_portThe port to use for health checks.number8080no
healthcheck_protocolThe protocol to use for health checks.string"http"no
healthy_thresholdThe number of consecutive health check successes before considering a target healthy.number5no
http_idle_timeout_secondsThe idle timeout for HTTP connections in seconds.number60no
nameThe name of the Load Balancer.stringn/ayes
networkThe network where the Load Balancer will be created. It must be either public or private. Defaults to public.string"EXTERNAL"no
project_idThe ID of the project where the Load Balancer will be created.stringnullno
redirect_http_to_httpsBoolean controlling whether to redirect HTTP traffic to HTTPS.boolfalseno
regionThe region where the Load Balancer will be created.stringn/ayes
response_timeout_secondsThe timeout for health check responses in seconds.number5no
sizeThe size of the Load Balancer. It must be either lb-small, lb-medium, or lb-large. Defaults to lb-small.string"lb-small"no
size_unitThe unit of the size of the Load Balancer. It must be a number in the range 1 to 100.stringnullno
sticky_sessions_cookie_nameThe name of the cookie to use for sticky sessions.stringnullno
sticky_sessions_typeThe type of sticky sessions to use. It must be either none, cookies, or source_ip. Defaults to none.string"none"no
typeThe type of the Load Balancer. It must be either fwd or glb. Defaults to fwd.string"REGIONAL"no
unhealthy_thresholdThe number of consecutive health check failures before considering a target unhealthy.number3no
vpc_uuidThe ID of the VPC where the Load Balancer will be located.stringnullno

Outputs

NameDescription
loadbalancer_idThe ID of the DigitalOcean Load Balancer
loadbalancer_ipThe IP address of the DigitalOcean Load Balancer
loadbalancer_urnThe URN of the DigitalOcean Load Balancer