Skip to content

Support optional_fields in Serverless NEGs #546

@twistedpair

Description

@twistedpair

TL;DR

TLS cipher logging, and other custom fields, can now be logged by the backends. However, this config is not supported in the Serverless NEG module in this repo.

This is cause serverless backends with existing optional fields to be removed, and break the creation of new backends with optional fields (error below):

googleapi: Error 400: Invalid value for field 'resource.logConfig': '{  "enable": true,  "sampleRate": 1.0,  "optionalMode": "CUSTOM"}'. Optional fields for this backend service must be provided when optional mode is set to CUSTOM., invalid

Terraform Resources

- [optional_mode](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_backend_service#optional_mode-1)
- [optional_fields](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_backend_service#optional_fields-1)

Detailed design

The missing config should be inserted [here](https://github.com/terraform-google-modules/terraform-google-lb-http/blob/main/modules/serverless_negs/main.tf#L230). 

- [optional_mode](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_backend_service#optional_mode-1)
- [optional_fields](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/compute_backend_service#optional_fields-1)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions