IBM-Cloud / terraform-provider-ibm

https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs
Mozilla Public License 2.0
339 stars 663 forks source link

running the latest 1.20.1 provider and it doesn't support cookie type session affinity for ibm_lbaas #2218

Closed texkelly closed 3 years ago

texkelly commented 3 years ago

Hi - running the latest 1.20.1 provider and it still doesn't support cookie type session affinity in ibm_lbaas resource, which we require.

[07:49:05 UTC] -> terraform plan Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage.


Error: "protocols.0.session_stickiness" must contain a value from []string{"SOURCE_IP"}, got "cookie"

on clb.tf line 1, in resource "ibm_lbaas" "clb": 1: resource "ibm_lbaas" "clb" {

[08:01:26 UTC] -> cat clb.tf resource "ibm_lbaas" "clb" { name = "${var.customer_url}-clb" description = "Terraform generated CLB for ${var.customer_url}" subnets = [ibm_compute_vm_instance.app[0].private_subnet_id] protocols { frontend_protocol = "HTTPS" frontend_port = 443 backend_protocol = "HTTPS" backend_port = 443 load_balancing_method = "weighted_round_robin" tls_certificate_id = var.ssl_certificate_id session_stickiness = "cookie" } depends_on = [ibm_compute_vm_instance.app[0]] }

resource "ibm_lbaas_server_instance_attachment" "clb_member1" { private_ip_address = ibm_compute_vm_instance.app[0].ipv4_address_private weight = 100 lbaas_id = ibm_lbaas.clb.id depends_on = [ibm_lbaas.clb] }

resource "ibm_lbaas_server_instance_attachment" "clb_member2" { private_ip_address = ibm_compute_vm_instance.app[1].ipv4_address_private weight = 1 lbaas_id = ibm_lbaas.clb.id depends_on = [ibm_lbaas.clb] }

resource "ibm_lbaas_health_monitor" "clb_hm" { protocol = ibm_lbaas.clb.health_monitors[0].protocol port = ibm_lbaas.clb.health_monitors[0].port timeout = 2 interval = 5 max_retries = 2 url_path = "/ibm_security_logout" lbaas_id = ibm_lbaas.clb.id monitor_id = ibm_lbaas.clb.health_monitors[0].monitor_id depends_on = [ibm_lbaas.clb,ibm_lbaas_server_instance_attachment.clb_member1,ibm_lbaas_server_instance_attachment.clb_member2] }

texkelly commented 3 years ago

Should be "HTTP_COOKIE" - still doesn't work tho: [00:40:17 UTC] -> cat ../../../logs/tririga_small_prod-110_plan.log Refreshing Terraform state in-memory prior to plan... The refreshed state will be used to calculate this plan, but will not be persisted to local or remote state storage.

data.ibm_compute_ssh_key.automation: Refreshing state...


Error: "protocols.0.session_stickiness" must contain a value from []string{"SOURCE_IP"}, got "HTTP_COOKIE"

on clb.tf line 1, in resource "ibm_lbaas" "clb": 1: resource "ibm_lbaas" "clb" {

root@x00921 [tri-automate-wdc04-5.cds.tririga.com]:/automation/awx-data/deployments/tridemo/tririga_small_prod-110 [00:40:34 UTC] -> cat clb.tf resource "ibm_lbaas" "clb" { name = "${var.customer_url}-clb" description = "Terraform generated CLB for ${var.customer_url}" subnets = [ibm_compute_vm_instance.app[0].private_subnet_id] protocols { frontend_protocol = "HTTPS" frontend_port = 443 backend_protocol = "HTTPS" backend_port = 443 load_balancing_method = "weighted_round_robin" tls_certificate_id = var.ssl_certificate_id

session_stickiness = "SOURCE_IP"

session_stickiness    = "HTTP_COOKIE"

} ssl_ciphers = [ "AES128-GCM-SHA256", "AES256-GCM-SHA384", "AES256-SHA256", "ECDHE-RSA-AES128-GCM-SHA256", "ECDHE-RSA-AES256-GCM-SHA384", "ECDHE-RSA-AES256-SHA384", ] depends_on = [ibm_compute_vm_instance.app[0]] }

resource "ibm_lbaas_server_instance_attachment" "clb_member1" { private_ip_address = ibm_compute_vm_instance.app[0].ipv4_address_private weight = 100 lbaas_id = ibm_lbaas.clb.id depends_on = [ibm_lbaas.clb] }

resource "ibm_lbaas_server_instance_attachment" "clb_member2" { private_ip_address = ibm_compute_vm_instance.app[1].ipv4_address_private weight = 1 lbaas_id = ibm_lbaas.clb.id depends_on = [ibm_lbaas.clb] }

resource "ibm_lbaas_health_monitor" "clb_hm" { protocol = ibm_lbaas.clb.health_monitors[0].protocol port = ibm_lbaas.clb.health_monitors[0].port timeout = 2 interval = 5 max_retries = 2 url_path = "/ibm_security_logout" lbaas_id = ibm_lbaas.clb.id monitor_id = ibm_lbaas.clb.health_monitors[0].monitor_id depends_on = [ibm_lbaas.clb,ibm_lbaas_server_instance_attachment.clb_member1,ibm_lbaas_server_instance_attachment.clb_member2] }

kavya498 commented 3 years ago

Available in 1.21.0