From 36bb34c83df120bab52cc3b04185b6322ab333e4 Mon Sep 17 00:00:00 2001 From: ellisonmarks Date: Mon, 19 Aug 2024 02:06:08 -0700 Subject: [PATCH] Adds the IdleTimeout parameter to the RouteAction section of the TcpRoute resource. (#11454) Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com> --- mmv1/products/networkservices/TcpRoute.yaml | 8 ++++++++ .../examples/network_services_tcp_route_actions.tf.erb | 1 + .../resource_network_services_tcp_route_test.go.erb | 2 ++ 3 files changed, 11 insertions(+) diff --git a/mmv1/products/networkservices/TcpRoute.yaml b/mmv1/products/networkservices/TcpRoute.yaml index 7fae44f3f0bc..47e590ed4ea2 100644 --- a/mmv1/products/networkservices/TcpRoute.yaml +++ b/mmv1/products/networkservices/TcpRoute.yaml @@ -181,3 +181,11 @@ properties: name: originalDestination description: | If true, Router will use the destination IP and port of the original connection as the destination of the request. + - !ruby/object:Api::Type::String + name: idleTimeout + description: | + Specifies the idle timeout for the selected route. The idle timeout is defined as the period in which there are no bytes sent or received on either the upstream or downstream connection. If not set, the default idle timeout is 30 seconds. If set to 0s, the timeout will be disabled. + + A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s". + validation: !ruby/object:Provider::Terraform::Validation + regex: '^(0|[1-9][0-9]*)(\.[0-9]{1,9})?s$' diff --git a/mmv1/templates/terraform/examples/network_services_tcp_route_actions.tf.erb b/mmv1/templates/terraform/examples/network_services_tcp_route_actions.tf.erb index c4e20a8ebbef..699c72c33d6e 100644 --- a/mmv1/templates/terraform/examples/network_services_tcp_route_actions.tf.erb +++ b/mmv1/templates/terraform/examples/network_services_tcp_route_actions.tf.erb @@ -26,6 +26,7 @@ resource "google_network_services_tcp_route" "<%= ctx[:primary_resource_id] %>" weight = 1 } original_destination = false + idle_timeout = "60s" } } } diff --git a/mmv1/third_party/terraform/services/networkservices/resource_network_services_tcp_route_test.go.erb b/mmv1/third_party/terraform/services/networkservices/resource_network_services_tcp_route_test.go.erb index 49f195379a8c..3b99e150515f 100644 --- a/mmv1/third_party/terraform/services/networkservices/resource_network_services_tcp_route_test.go.erb +++ b/mmv1/third_party/terraform/services/networkservices/resource_network_services_tcp_route_test.go.erb @@ -75,6 +75,7 @@ resource "google_network_services_tcp_route" "foobar" { weight = 1 } original_destination = false + idle_timeout = "60s" } } } @@ -112,6 +113,7 @@ resource "google_network_services_tcp_route" "foobar" { weight = 1 } original_destination = false + idle_timeout = "120s" } } }