PaloAltoNetworks / terraform-provider-panos

Terraform Panos provider
https://www.terraform.io/docs/providers/panos/
MIT License
89 stars 73 forks source link

panos_syslog_server_profile user_id_format (user_id) changes not deploying #437

Open Rifwan22 opened 7 months ago

Rifwan22 commented 7 months ago

Describe the bug

panos_syslog_server_profile user_id_format (user_id) changes not getting deploy with version 1.11.0

Expected behavior

should work same as other config arguments for an example - config_format

Current behaviour

terraform changes are not getting deploy even though it says deployed and the next time if we are trying to execute terraform build it will show its trying to update each time and its keep repeating the same also in panorama it will remain with default value.

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:

  # module.panorama-xx.panos_panorama_syslog_server_profile.panorama-syslog-server-profile-resource will be updated in-place
  ~ resource "panos_panorama_syslog_server_profile" "panorama-syslog-server-profile-resource" {
        id                 = ":::palo-syslog-server-profile"
        name               = "palo-syslog-server-profile"
      + user_id_format     = "test-format"
        # (14 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Steps to reproduce

use syslog_server_profile with user_id_format (https://registry.terraform.io/providers/PaloAltoNetworks/panos/latest/docs/resources/syslog_server_profile.html#user_id_format)

Screenshots

debugging

2024-04-17T11:12:33.855Z [WARN]  Provider "provider[\"registry.terraform.io/paloaltonetworks/panos\"]" produced an unexpected new value for module.panorama-config-standalone.panos_panorama_syslog_server_profile.panorama-syslog-server-profile-resource, but we are tolerating it because it is using the legacy plugin SDK.
    The following problems may be the cause of any confusing errors from downstream operations:
      - .user_id_format: was cty.StringVal("test-format"), but now cty.StringVal("")
module.panorama-config-standalone.panos_panorama_syslog_server_profile.panorama-syslog-server-profile-resource: Modifications complete after 1s [id=:::palo-syslog-server-profile]
2024-04-17T11:12:33.859Z [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF"
2024-04-17T11:12:33.862Z [DEBUG] provider: plugin process exited: path=.terraform/providers/registry.terraform.io/paloaltonetworks/panos/1.11.0/linux_amd64/terraform-provider-panos_v1.11.0 pid=61
2024-04-17T11:12:33.862Z [DEBUG] provider: plugin exited
shinmog commented 7 months ago

Can you please provide the following:

Rifwan22 commented 7 months ago

Can you please provide the following:

  • the version of PAN-OS you're using
  • a Terraform plan file that reproduces this error

Thanks @shinmog Here is the plan and we are using PAN-OS 10.2.8

`   ~ update in-place       Terraform will perform the following actions:       # module.panorama-config-standalone.panos_panorama_syslog_server_profile.panorama-syslog-server-profile-resource will be updated in-place

 ~ resource "panos_panorama_syslog_server_profile" "panorama-syslog-server-profile-resource" {   id = ":::palo-syslog-server-profile"   name = "palo-syslog-server-profile"   + user_id_format = "CEF:0|Palo Alto Networks|PAN-OS|$sender_sw_version|$subtype|$type|1|rt=$cef-formatted-receive_time deviceExternalId=$serial cs1Label=Factor Type cs1=$factortype cs3Label=Virtual System cs3=$vsys cs4Label=Data Source Name cs4=$datasourcename cs5Label=Data Source cs5=$datasource cs6Label=Data Source Type cs6=$datasourcetype cn1Label=Factor Number cn1=$factorno cn2Label=Virtual System ID cn2=$vsys_id cn3Label=Timeout Threshold cn3=$timeout src=$ip spt=$beginport dpt=$endport cnt=$repeatcnt duser=$user externalId=$seqno cat=$eventid end=$factorcompletiontime PanOSDGl1=$dg_hier_level_1 PanOSDGl2=$dg_hier_level_2 PanOSDGl3=$dg_hier_level_3 PanOSDGl4=$dg_hier_level_4 PanOSVsysName=$vsys_name dvchost=$device_name PanOSActionFlags=$actionflags PanOSUGFlags=$ugflags PanOSUserBySource=$userbysource PanOSTimeGeneratedHighResolution=$high_res_timestamp"   (14 unchanged attributes hidden)

(1 unchanged block hidden) }   Plan: 0 to add, 1 to change, 0 to destroy. `