displague / deprecated-terraform-provider-linode

[OLD] Terraform provider plugin for Linode Cloud resources.. See
https://github.com/terraform-providers/terraform-provider-linode
Mozilla Public License 2.0
15 stars 5 forks source link

implement linode_nodebalancer resources #6

Closed displague closed 6 years ago

displague commented 6 years ago

WIP is here https://github.com/displague/terraform-provider-linode/compare/master...displague:nodebalancer?expand=1

Goal resources would allow for TF config such as:

resource "linode_nodebalancer" "example-nb" {
   label = "example.com"
   region = "${var.region}"
   client_conn_throttle = 0
}

resource "linode_nodebalancer_config" "example-https" {
   port = 443
   nodebalancer = "${linode_nodebalancer.example-nb.id}"
   protocol = "http"
   algorithm = "roundrobin"
   stickiness = "http_cookie"
   check = "http_body"
   check_interval = "90"
   check_timeout = "10"
   check_attempts = "3"
   check_path = "/test"
   check_body = "it works"
   check_passive = true
   cipher_suite = "recommended"
   # ssl_cert FUTURE pair with letsencrypt resource
   # ssl_key FUTURE pair with letsencrypt resource
   # https://opencredo.com/letsencrypt-terraform/
}

resource "linode_nodebalancer_config" "example-http" {
   port = 80
   nodebalancer = "${linode_nodebalancer.example-nb.id}"
   protocol = "http"
   algorithm = "roundrobin"
   stickiness = "http_cookie"
   check = "http_body"
   check_interval = "90"
   check_timeout = "10"
   check_attempts = "3"
   check_path = "/test"
   check_body = "it works"
   check_passive = true
}

resource "linode_nodebalancer_node" "example-80-www" {
  # LABEL becomes example-80-www
  config = "${linode_nodebalancer.default}"
  address = "${linode_instance.nginx.*.private_ipaddress}"
  weight = 50
  mode = "accept"
}

resource "linode_nodebalancer_node" "CNAME-www" {
  address = "${linode_instance.www2.ipv4_address}"
  weight = 50
}

...