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]: The time units in the lb monitor setup are not recognized and seconds are assumed #1165

Closed michalgcsg closed 1 month ago

michalgcsg commented 6 months ago

Terraform Core Version

1.8.3

citrixadc Provider Version

1.39.0

Operating system

Ubuntu 22.04.4 LTS

Affected Resource(s)

resource "citrixadc_lbmonitor" "tf_lbmonitor_test" { monitorname = "tf_test_monitor" type = "TCP" interval = "60" }

Equivalent NetScaler CLI Command

add lb monitor tf_test_monitor TCP -deviation 0 -interval 60 -resptimeoutThresh 0 -retries 3 -failureRetries 0 -alertRetries 0 -successRetries 1 -IPMapping 0.0.0.0 -state ENABLED -reverse NO -transparent NO -ipTunnel NO -tos NO -secure NO

Expected Behavior

Subsequent terraform plan/terraform apply commands should not modify the created monitor

Actual Behavior

It looks like the provider does not reflect the time unit set on the interval, which is represented by 1 minute:

show lb monitor tf_test_monitor 1) Name.......:tf_test_monitor Type......: TCP State....: ENABLED Standard parameters: Interval.........: 1 min Retries...........: 3 Response timeout.: 2 sec Down time.........: 30 sec Reverse..........: NO Transparent.......: NO Secure...........: NO

As a result it thinks that the monitor needs to be updated each time: mgtest$ terraform plan citrixadc_lbmonitor.tf_lbmonitor_test: Refreshing state... [id=tf_test_monitor] citrixadc_lbvserver.lb_test: Refreshing state... [id=lb_test]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place

Terraform will perform the following actions:

citrixadc_lbmonitor.tf_lbmonitor_test will be updated in-place

~ resource "citrixadc_lbmonitor" "tf_lbmonitor_test" { id = "tf_test_monitor" ~ interval = 1 -> 60

(87 unchanged attributes hidden)

}

Plan: 0 to add, 1 to change, 0 to destroy.

Relevant Error/Panic Output Snippet

No response

Terraform Configuration Files

resource "citrixadc_lbmonitor" "tf_lbmonitor_test" { monitorname = "tf_test_monitor" type = "TCP" interval = "60" }

Steps to Reproduce

  1. create the resource of the monitor
  2. run terraform apply to actually create a monitor in the NetScaler
  3. run terraform plan - this will show that the monitor parameter will be updated. This will be relevant to any monitor type as interval is a generic parameter

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

sumanth-lingappa commented 6 months ago

Same as https://github.com/netscaler/ansible-collection-netscaleradc/issues/324