Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add request_path property on azurerm_lb_probe ressource #14

Closed
wants to merge 5 commits into from

Conversation

mikaelkrief
Copy link

Add request_path proprty in azurerm_lb_probe resource
update the readme by adding port in lb_port variable

Add request_path in lb probe property in case of http protocol
Update the sample with:
Add request_path in lb_port variables ( at position 3)
http-2 = ["80", "Http", "80","/mypath"]
@daniel-ciaglia
Copy link

daniel-ciaglia commented Aug 22, 2018

I'd love to see that patch coming in as we are using the loadbalancer only for HTTP
BUT there needs to be a change to the PR

resource "azurerm_lb_probe" "azlb" {
request_path - the lower() has to be applied to the element checked

resource "azurerm_lb_rule" "azlb" {
protocol - the protocol has to be changed from HTTP to Tcp, else the module fails (see tf docs)

resource "azurerm_lb_probe" "azlb" {
  count               = "${length(var.lb_port)}"
  resource_group_name = "${azurerm_resource_group.azlb.name}"
  loadbalancer_id     = "${azurerm_lb.azlb.id}"
  name                = "${element(keys(var.lb_port), count.index)}"
  protocol            = "${element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 1)}"
  port                = "${element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 2)}"
  interval_in_seconds = "${var.lb_probe_interval}"
  number_of_probes    = "${var.lb_probe_unhealthy_threshold}"
**  request_path        = "${lower(element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 1)) == "http" ? element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 3) : ""}" **
}

resource "azurerm_lb_rule" "azlb" {
  count                          = "${length(var.lb_port)}"
  resource_group_name            = "${azurerm_resource_group.azlb.name}"
  loadbalancer_id                = "${azurerm_lb.azlb.id}"
  name                           = "${element(keys(var.lb_port), count.index)}"
**  protocol                       = "${lower(element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 1)) == "http" ? "Tcp" : element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 1)}" **
  frontend_port                  = "${element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 0)}"
  backend_port                   = "${element(var.lb_port["${element(keys(var.lb_port), count.index)}"], 2)}"
  frontend_ip_configuration_name = "${var.frontend_name}"
  enable_floating_ip             = false
  backend_address_pool_id        = "${azurerm_lb_backend_address_pool.azlb.id}"
  idle_timeout_in_minutes        = 5
  probe_id                       = "${element(azurerm_lb_probe.azlb.*.id,count.index)}"
  depends_on                     = ["azurerm_lb_probe.azlb"]
}

@mikaelkrief
Copy link
Author

@daniel-ciaglia , I just updated my PR.

@daniel-ciaglia
Copy link

@mikaelkrief thanks! LGTM!

@yupwei68
Copy link
Contributor

Hi @mikaelkrief , thanks for opening this PR. 🚀 . Would you mind updating your code to merge the latest code?

@yupwei68
Copy link
Contributor

yupwei68 commented Aug 7, 2020

Hi @mikaelkrief , thanks for opening this PR. Since we have not got response from you, I have pushed one PR to accomplish this feature. Please try our latest release v3.0.0 which has supported this feature.

@yupwei68 yupwei68 closed this Aug 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants