Skip to content

Add optional_mode and optional_fields support to backend service log_config #604

Description

@db-vtx

Is your feature request related to a problem? Please describe.
The log_config block for google_compute_backend_service in this module only exposes enable and sample_rate:

log_config = object({
  enable      = optional(bool)
  sample_rate = optional(number)
})

The underlying google_compute_backend_service resource's log_config also supports optional_mode and optional_fields, which control which optional fields (e.g. request/response headers) are included in load balancer logs. There's currently no way to set these through this module.

Describe the solution you'd like
Extend the log_config object type in variables.tf to include:

log_config = object({
  enable          = optional(bool)
  sample_rate     = optional(number)
  optional_mode   = optional(string)
  optional_fields = optional(list(string))
})

and pass them through in the dynamic "log_config" block in main.tf.

Describe alternatives you've considered
None — this is a straightforward passthrough of an existing provider field.

Additional context
Provider docs:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions