Skip to content

particuleio/terraform-scaleway-loadbalancer

Repository files navigation

terraform-scaleway-loadbalancer

terraform-scaleway-loadbalancer

Terraform module to create and manage Scaleway Load Balancers.

This module creates and configures the following resources:

It allows to define multiple Load Balancers using a map of Load Balancer definitions.

Every output is available at the Load Balancer definition scope in the output.this Terraform Output.

This module supports Managed Load Balancer IPs (created using this module) as well as Non-Managed Load Balancer IPs by setting the create_ip Load Balancer attribute to false and by passing the corresponding information in the ip attribute that matches the ones in the Scaleway Load Balancer IP Datasource

Usage

module "loadbalancers" {
  source = "particuleio/loadbalancer/scaleway"

  loadbalancers = {
    # define each Load Balancer in the `loadbalancers` map.
    default = {
      type = "LB-S"
      name = "default-lb"
      backends = [
        {
          name             = "sample-test"
          forward_port     = 80
          forward_protocol = "http"
        }
      ]
      frontends = [
        {
          name         = "sample-frontend"
          inbound_port = 80
          backend_name = "sample-test"  # match the backend name
        }
      ]
    }
  }
}

Examples

Examples are available in the ./examples/ directory.

Requirements

Name Version
terraform >= 0.13
scaleway ~> 2.0

Providers

Name Version
scaleway ~> 2.0

Modules

No modules.

Resources

Name Type
scaleway_lb.this resource
scaleway_lb_backend.this resource
scaleway_lb_certificate.this resource
scaleway_lb_frontend.this resource
scaleway_lb_ip.this resource
scaleway_lb_ip.this data source

Inputs

Name Description Type Default Required
loadbalancers The Scaleway Load Balancers configurations map(any) n/a yes
region Region to be used with the Scaleway provider string "fr-par" no
zone Zone to be used with the Scaleway provider string "fr-par-1" no

Outputs

Name Description
loadbalancer_backends The Scaleway Load Balancer Backends
loadbalancer_frontends The Scaleway Load Balancer Frontends
loadbalancers The Scaleway Load Balancer resources
this Map of every Load Balancer configuration: LBs, LB IPs, Backends, Frontends, Certificates