Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requestlog_template is added to the state as responselog_template #955

Closed
marcsauter opened this issue Mar 28, 2024 · 4 comments · Fixed by #986
Closed

requestlog_template is added to the state as responselog_template #955

marcsauter opened this issue Mar 28, 2024 · 4 comments · Fixed by #986
Labels
Backlog issue will be tracked by JIRA in backlog

Comments

@marcsauter
Copy link

_ = d.Set("responselog_template", pp.RequestLogTemplate)

@pgouband
Copy link
Collaborator

Hi @marcsauter

Can you give more information about your request?

@amolari
Copy link

amolari commented Apr 11, 2024

hello @pgouband
Marc is working at my customer. They observed the following issue in the module bigip_ltm_request_log_profile:

  1. TF config is
resource "bigip_ltm_request_log_profile" "tf_access_log_sec" {
  name                = "/Common/tf-access-log-sec"
  defaults_from       = bigip_ltm_request_log_profile.tf_request_log_pf.name
  request_logging     = "enabled"
  requestlog_template = "<134> $${TIME_MSECS} $${TIME_OFFSET} bigip_host=$${BIGIP_HOSTNAME} type=request"
  response_logging    = "enabled"
  responselog_template = "<134> $${TIME_MSECS} $${TIME_OFFSET} bigip_host=$${BIGIP_HOSTNAME} type=response"
}
  1. After TF apply, the configuration is correct on the BIG-IP:
ltm profile request-log tf-access-log-sec {
    app-service none
    defaults-from tf-request-log-pf
    request-log-template "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=request"
    request-logging enabled
    response-log-template "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=response"
    response-logging enabled
}
  1. however, in the TF state (because of the error in provider code mentioned above by Marc), we do see:
$ terraform state show bigip_ltm_request_log_profile.tf_access_log_sec
2024-04-11T13:38:28.958+0200 [INFO]  provider: configuring client automatic mTLS
2024-04-11T13:38:28.998+0200 [INFO]  provider.terraform-provider-bigip_v1.22.0: configuring server automatic mTLS: timestamp=2024-04-11T13:38:28.998+0200
# bigip_ltm_request_log_profile.tf_access_log_sec:
resource "bigip_ltm_request_log_profile" "tf_access_log_sec" {
    defaults_from        = "/Common/tf-request-log-pf"
    id                   = "/Common/tf-access-log-sec"
    name                 = "/Common/tf-access-log-sec"
    request_logging      = "enabled"
    requestlog_template  = "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=request"
    response_logging     = "enabled"
    responselog_template = "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=request"
}

==> responselog_template = requestlo_template

  1. Result: TF sees a config drift and re-applied the config everytime:
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:

  # bigip_ltm_request_log_profile.tf_access_log_sec will be updated in-place
  ~ resource "bigip_ltm_request_log_profile" "tf_access_log_sec" {
        id                   = "/Common/tf-access-log-sec"
        name                 = "/Common/tf-access-log-sec"
      ~ responselog_template = "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=request" -> "<134> ${TIME_MSECS} ${TIME_OFFSET} bigip_host=${BIGIP_HOSTNAME} type=response"
        # (4 unchanged attributes hidden)
    }

Please fix this issue, thank you.

@amolari
Copy link

amolari commented Apr 11, 2024

I guess this issue is the same as this one #950

@pgouband
Copy link
Collaborator

Hi,

Thanks for reporting. Added to the backlog and internal tracking ID for this request is: INFRAANO-1539.

@pgouband pgouband added Backlog issue will be tracked by JIRA in backlog and removed waiting-response labels Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backlog issue will be tracked by JIRA in backlog
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants