oracle / terraform-provider-oci

Terraform Oracle Cloud Infrastructure provider
https://www.terraform.io/docs/providers/oci/
Mozilla Public License 2.0
758 stars 674 forks source link

Impossible disable session persistence in oci_load_balancer_backend_set #1624

Open gtuttolomondo opened 2 years ago

gtuttolomondo commented 2 years ago

Community Note

Terraform Version and Provider Version

Terraform v1.2.2 on windows_amd64

Affected Resource(s)

oci_load_balancer_backend_set

Terraform Configuration Files

provider "registry.terraform.io/oracle/oci" { version = "4.81.0" constraints = "4.81.0" hashes = [ "h1:gcqGBIK6a7tNRY3kxPsdFfGGA06aG3uxn4kIntKU5hU=", "h1:zS80qpd9GcJlH/5EQPvQoBrzg0FoOWdo+tvSvFLZHA4=", "zh:2ff8fc33bd80de53afd901bf691d8197a8ed5588255e9af27d0d897d81d2f476", "zh:30dc0dc313ae672424caa316e53e727bd825ee5c7fb5cdfde12c6489452e9c54", "zh:406fa9ffba9e47da7ae6326f6ad84bbde771d5e70a991045bbf0b22e0fc932e0", "zh:423f0d5081ed12a6849e0f9f88e9c7d5a45ccc42fbd203dabc0c9bbc698d4ff8", "zh:5cbc0682b978bb333f17436df978b937e2cccb3bd53712a5bed7acd78b7c1d54", "zh:5d91f8f63be47330554003394ca6cd408bbd2708d93e53d3efdc007f69c9c505", "zh:63070c1c02a15de69670801f132e2f8afc9a287818e7dc0150717592aaaabbd9", "zh:8610f2fef5f13057b1de5837be535d2f977316df6663b7a3e7e326eba12da864", "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", "zh:9fa21387f7d76f54c80bb9b36f3a1914385c0bb877dc81eb00086444a7416af7", "zh:a0b40afe1c54c86c54794b1bbadfd3d02c5c4dca6c366b90e12121fa51778aff", "zh:e0b941f2a9eebd9440bb145366094bd4f281be157cb21929a17a484437f54cb0", "zh:ecd8ef5ecb367d4cc4162fc6f75d1b296c2a49e1f20c57109c1f291c67badcc1", "zh:f6ff2ad95a49b34f38fbebf230161324805d5fdaad4b5a1a40ae07458afd9ca9", "zh:fdcb78f1fd383ab197697e53cdd6b2d79cc237749861a3172fdee2f6dde52ec1", ] }

Copy-paste your Terraform configurations here - for large Terraform configs,

please use a service like Dropbox and share a link to the ZIP file.

Please remove any sensitive information from configuration files before sharing them.



### Debug Output

<!---
Please provide a link to a GitHub Gist containing the complete debug output. Please do NOT paste the debug output in the issue; just paste a link to the Gist.

To obtain the debug output, see the [Verbose logging for OCI Terraform Provider](https://www.terraform.io/docs/providers/oci/guides/troubleshooting.html#verbose-logging-for-oci-terraform-provider).

Github Gist: https://gist.github.com/
--->

### Panic Output

<!--- 
If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the `crash.log`. 

Github Gist: https://gist.github.com/
--->

### Expected Behavior

Removing the following code from resource the session persistence should be disabled

  lb_cookie_session_persistence_configuration {
      cookie_name        = each.value.session_persistence.cookie_name
      disable_fallback   = each.value.session_persistence.disable_fallback
      domain             = each.value.session_persistence.domain
      is_http_only       = each.value.session_persistence.is_http_only
      is_secure          = each.value.session_persistence.is_secure
      max_age_in_seconds = each.value.session_persistence.max_age_in_seconds
      path               = each.value.session_persistence.path    
  }

### Actual Behavior

Removing the   lb_cookie_session_persistence_configuration { } terraform plan reports no changes. So disabling doesn't work

### Steps to Reproduce

<!--- Please list the steps required to reproduce the issue. --->

1. prepare a tf file with the oci_load_balancer_backend_set resource enabling session persistence

resource "oci_load_balancer_backend_set" "backend_set" {
  for_each = local.backend_sets
  #Required
  health_checker {
    #Required
    protocol = each.value.health_check_protocol

    #Optional
    interval_ms         = each.value.interval_ms
    port                = each.value.port
    response_body_regex = each.value.response_body_regex
    retries             = each.value.retries
    return_code         = each.value.return_code
    timeout_in_millis   = each.value.timeout_in_millis
    url_path            = each.value.backend_set_health_checker_url_path
  }
  load_balancer_id = oci_load_balancer_load_balancer.app_load_balancer.id
  name             = each.value.backend_set_name
  policy           = each.value.backend_set_policy

  lb_cookie_session_persistence_configuration {
      cookie_name        = each.value.session_persistence.cookie_name
      disable_fallback   = each.value.session_persistence.disable_fallback
      domain             = each.value.session_persistence.domain
      is_http_only       = each.value.session_persistence.is_http_only
      is_secure          = each.value.session_persistence.is_secure
      max_age_in_seconds = each.value.session_persistence.max_age_in_seconds
      path               = each.value.session_persistence.path    
  }
}

2. remove  lb_cookie_session_persistence_configuration {...}  code to remove session persistence
3. run terraform apply
4. No changes are applied

### Important Factoids

<!--- Is there anything atypical about your environment that we should know? For example: Is the issue specific to a region? --->

### References

<!---
Information about referencing Github Issues: https://help.github.com/articles/basic-writing-and-formatting-syntax/#referencing-issues-and-pull-requests

Are there any other GitHub issues (open or closed) or pull requests that should be linked here? Vendor documentation? For example:
--->
ravinitp commented 1 year ago

Thank you for reporting the issue. We have raised an internal ticket to track this. Our service engineers will get back to you.