citrix / terraform-provider-citrixadc

Part of NetScaler Automation Toolkit | https://github.com/netscaler/automation-toolkit
https://registry.terraform.io/providers/citrix/citrixadc
Apache License 2.0
119 stars 59 forks source link

[BUG] citrixadc_lbvserver setting attribute authn401 = "ON" is not possible #1093

Closed kaiAsmOne closed 1 year ago

kaiAsmOne commented 1 year ago

Contact us

For any immediate issues or help , reach out to us at NetScaler-AutomationToolkit@cloud.com !

When creating an lb_vserver with authn401 = "ON" returns the following error:

╷ │ Error: [ERROR] nitro-go: Failed to create resource of type lbvserver, name=lb_app.company.com, err=failed: 599 Netscaler specific error ({ "errorcode": 2652, "message": "Turn authentication off first", "severity": "ERROR" }) │ │ with module.app_app_company_com.citrixadc_lbvserver.app_lb, │ on .terraform/modules/app_app_company_com/main.tf line 36, in resource "citrixadc_lbvserver" "app_lb": │ 36: resource "citrixadc_lbvserver" "app_lb" { │

How do i implement an lb_vserver with 401 enabled ? as of now i have to create the lb_vserver with 401=off and manually activate it in the gui after each terraform apply..

The lb_vserver terraform plan output is as follows:

module.app_app_company_com.citrixadc_lbvserver.app_lb will be created

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behaviour:

  1. My terraform files are
    # my terraform script here
  2. which terraform command I am getting the error
    # terrafrom command
  3. Terraform output logs to the log file (./tf.log). Append TF_LOG=TRACE NS_LOG=TRACE TF_LOG_PATH=./tf.log to your terraform command
    # terraform output logs.
  4. Error I am facing on the console
    # console error

Expected behaviour A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please fill the following information):

Additional context Add any other context about the problem here.

kaiAsmOne commented 1 year ago

This bug is messing up all the lb_vservers i have that do OAuth 2.0 V2 MSAL JWT API Authentication. If a lb_vserver has authn401 = "ON" every terraform apply will set the lb_vserver back to Forms Based Authentication.

If i manually in the terraform code set authn401 = "OFF", Do a terraform apply, Then manually in the GUI set the lb_vserver back to authn401 = "ON", change the code to authn401 = "ON" and do a terraform apply the terraform apply will set the lb_vserver back to Forms Based Authentication.

Due to this all of our exposed API´s with OAuth 2.0 V2 MSAL JWT API Authentication stops working everytime i do a terraform apply and forget to login to all the netscalers and change the lb_vservers back to authn401 = "ON"

kaiAsmOne commented 1 year ago

This is actually a documentation issue. The Attribute authentication is described to Enable or disable authentication. This attribute is actually = Enable Forms Based Authentication.

I advise you to update the documentation on this attribute.

When i changed my terraform code to have attribute authentication = "OFF" && authn401 = "ON" my terraform code works as expected / intended.

kaiAsmOne commented 1 year ago

I will close this issue to reduce the workload on this provider. I Hope if other people struggle with confusing documentation regarding this attribute they will be able to find this info using google