Closed sumanth-lingappa closed 7 months ago
I had something similar happen with ecc curve settings. I had to modify my code to manually define every single entry as it shows up after deployment. Even the optional items that are defaults. Once I did that then I no longer had it re-applying settings that existed.
It´s not that strange when you look at how the REST API is implemented at the Netscaler. Netscaler gui talks with itself using REST API.
If you sniff the traffic in sslplain you will notice that the attributes of the appfw profile are not optional, all settings are set everytime you do one small change to the appfw / waf profile in gui :)
What does the state file look like after first apply, shouldn't all those default attributes be there? If that's the case, I'd assume that there would be no issue as TF would know the current state, is the NITRO call. It returning the complete picture in this case?
Hello @sumanth-lingappa @kaiAsmOne @gusmb @jeffriechers Thanks for your patience. We have worked on this and and it is now available in the terraform registry. Please download the latest terraform-provider-citrixadc version v1.38.0. Now you don't need to provide the entire appfwprofile attributes to update a single attribute.
Thank you
Contact us
Bug Report
Describe the bug A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behaviour:
TF_LOG=TRACE NS_LOG=TRACE TF_LOG_PATH=./tf.log
to your terraform commandTerraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
Terraform will perform the following actions:
citrixadc_appfwprofile.tf_appfwprofile1 will be created
Plan: 1 to add, 0 to change, 0 to destroy.
Do you want to perform these actions? Terraform will perform the actions described above. Only 'yes' will be accepted to approve.
Enter a value: yes
citrixadc_appfwprofile.tf_appfwprofile1: Creating... citrixadc_appfwprofile.tf_appfwprofile1: Creation complete after 0s [id=tf_appfwprofile1]
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
root@cloud-client:~/apply-waf-configuration# terraform plan -var-file example.tfvars citrixadc_nsfeature.tf_nsfeature: Refreshing state... [id=tf-nsfeature-20230913053538261700000001] citrixadc_lbvserver.tf_lbvserver2: Refreshing state... [id=tf_lbvserver2] citrixadc_nsip.snip: Refreshing state... [id=192.168.3.10] citrixadc_service.web-echoserver1: Refreshing state... [id=web-echoserver1] citrixadc_lbvserver.tf_lbvserver1: Refreshing state... [id=tf_lbvserver1] citrixadc_appfwprofile.tf_appfwprofile1: Refreshing state... [id=tf_appfwprofile1] citrixadc_csvserver.tf_csvserver: Refreshing state... [id=tf_csvserver] citrixadc_service.web-echoserver2: Refreshing state... [id=web-echoserver2] citrixadc_lbvserver_service_binding.lb_binding1: Refreshing state... [id=tf_lbvserver1,web-echoserver1] citrixadc_csaction.tf_csaction1: Refreshing state... [id=tf_csaction1] citrixadc_lbvserver_service_binding.lb_binding2: Refreshing state... [id=tf_lbvserver2,web-echoserver2] citrixadc_csaction.tf_csaction2: Refreshing state... [id=tf_csaction2] citrixadc_cspolicy.tf_policy_echoserver1: Refreshing state... [id=tf_policy_echoserver1] citrixadc_cspolicy.tf_policy_echoserver2: Refreshing state... [id=tf_policy_echoserver2] citrixadc_csvserver_cspolicy_binding.tf_csvscspolbind_echoserver1: Refreshing state... [id=tf_csvserver,tf_policy_echoserver1] citrixadc_csvserver_cspolicy_binding.tf_csvscspolbind_echoserver2: Refreshing state... [id=tf_csvserver,tf_policy_echoserver2]
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_appfwprofile.tf_appfwprofile1 will be updated in-place
~ resource "citrixadc_appfwprofile" "tf_appfwprofile1" { ~ bufferoverflowaction = [
(51 unchanged attributes hidden)
}
Plan: 0 to add, 1 to change, 0 to destroy.
────────────────────────────────────────────────────────────────────────────────────────────────────
Note: You didn't use the -out option to save this plan, so Terraform can't guarantee to take exactly these actions if you run "terraform apply" now.
Expected behaviour The
terraform plan
immediately after theterraform apply
should not have any changes to be shownScreenshots If applicable, add screenshots to help explain your problem.
Environment (please fill the following information):
terraform version
outputterraform-provider-citrixadc version
go version
outputAdditional context I am executing NetScaler Community labs - netscaler-adc-basic-application-protection-configuration-waf-using-terraform