Open Samir-Cit opened 3 weeks ago
We may want to apply default_if_empty here?
We may want to apply default_if_empty here?
If we use any kind of default value (Eg.: default_if_empty
and default_from_api
) for this field it will send the value even when creating a Gateway
that is not type = "SECURE_WEB_GATEWAY"
and this will fail to create the resource.
Note: This field should only be filled if the type of the Gateway is Secure Web Proxy.
Community Note
Description
The Gateway API currently says that this new field
routingMode
supports two values:NEXT_HOP_ROUTING_MODE
andEXPLICIT_ROUTING_MODE
During the development of this new fiel on this PR we noticied that the Gateway API doesn't return the value of this new field when the value is
EXPLICIT_ROUTING_MODE
(this field only return when the value isNEXT_HOP_ROUTING_MODE
) Because of this API behavior the valueEXPLICIT_ROUTING_MODE
was removed from the Terraform Enum field. Even though the API says the field is required whentype = "SECURE WEB GATEWAY"
it accepts empty and set the valueEXPLICIT_ROUTING_MODE
, which apparently is the default.We needed to remove the value from provider to make the resource work but we should add once the API changes. Since the API says that this field is required when the gateway is SWP, it's good to have this value on the Terraform Enum and returning on the API (at least when the type is secure web proxy)
New or Affected Resource(s)
Potential Terraform Configuration
https://github.com/hashicorp/terraform-provider-google/blob/5edbe4354dff8ace7da97e489ad47f8fdaea8b02/google/services/networkservices/resource_network_services_gateway_test.go#L945
Terraform code:
Terraform output:
See:
"routing_mode": ""
References
https://cloud.google.com/secure-web-proxy/docs/deploy-next-hop
b/373406338