Skip to content

Commit 95e7adc

Browse files
Terraform Team Automationvsin12
authored andcommitted
Added - Support for Configurable timeouts to OCI Service Mesh
1 parent 175588a commit 95e7adc

20 files changed

+168
-32
lines changed

examples/service_mesh/ingress_gateway_route_table.tf

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ resource "oci_service_mesh_ingress_gateway_route_table" "test_ingress_gateway_ro
2828
is_path_rewrite_enabled = local.ingress_gateway_route_table_route_rules_is_path_rewrite_enabled
2929
path = local.ingress_gateway_route_table_route_rules_path
3030
path_type = local.ingress_gateway_route_table_route_rules_path_type
31+
request_timeout_in_ms = local.ingress_gateway_route_table_route_rules_request_timeout_in_ms
3132
}
3233

3334
#Optional
@@ -66,4 +67,5 @@ locals {
6667
ingress_gateway_route_table_route_rules_ingress_gateway_host_name = "test-host"
6768
ingress_gateway_route_table_route_rules_ingress_gateway_host_port = "2000"
6869
// allowed values for above are between 1024 and 65535
69-
}
70+
ingress_gateway_route_table_route_rules_request_timeout_in_ms = 100
71+
}

examples/service_mesh/service_dependencies.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ resource "oci_certificates_management_ca_bundle" "test_ca_bundle" {
55
name = local.ca_bundle_name
66
}
77

8+
resource "random_id" "id" {
9+
byte_length = 8
10+
}
11+
812
locals {
9-
ca_bundle_name = "test-ca-bundle"
10-
ca_bundle_ca_bundle_pem = "-----BEGIN CERTIFICATE-----\nMIICwjCCAaqgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwFzEVMBMGA1UEAwwMdGVz\ndC1yb290LWNhMB4XDTIwMDkxMTIyMjczMFoXDTIxMDkxMTIyMjczMFowHzEdMBsG\nA1UEAwwUdGVzdC1pbnRlcm1lZGlhdGUtY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDoGijYmLa6P+2C2hcXV7DNBuZ0K+1x41lC8emin9d6wsxsWYJn\nUzthLg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TCN0q/4\nZF6dVoQOom/owREX4YEnISUgN4U5vpZkzkr3NOpiULAmimrROq52TcC2y52ijui9\nSf7QDmtVW7M4kUFjT+If/2yxX/g1dsbKxh+cuZimLWypD3TmhWehglgEZRiDnXJL\n7davAG0DOeO2scnglOY0JAOyM6po4WALmBf6OBxl2jiYpwWgkXMhgGf5u3ID6IDP\nJ2ZeYb9PZ2Z5jYGxUDLRVaaXr0a4a4UbvuECAwEAAaMQMA4wDAYDVR0TBAUwAwEB\n/zANBgkqhkiG9w0BAQsFAAOCAQEATqNEMvk7NUi6M9tv743CVGZa9JLdpdD9ZCbY\nvH6qEl5nVVAiUiKCRSnntDNtUkFd9tVQGk5Hgp2aMm1epq6kC3N0K4Dbsg1dWU4O\nYRG47CSv+sBI4VpDqRjtOS3+FlmMlm237ahs7YcwHNUqqGKbl9QZACxXZeCArYhZ\nt6xDqLb0gKON5gKlhnUqhYTT4+CcBan2nnr7sbdZhwtOmFgrowvs4OVh6WwdbI9m\nSdNKzy7AXAlcodkXAfjIoODeOQdEK6/Ine1K+W4sOk9e+oymoD0KnzhDLI3MDB3V\nGKIiVcct3DMHGI+y04/kcuasqUo4l6lrjt2wJF1pHbaxKIcyGQ==\n-----END CERTIFICATE-----"
13+
ca_bundle_name = "test-ca-bundle-${random_id.id.hex}"
14+
ca_bundle_ca_bundle_pem = "-----BEGIN CERTIFICATE-----\nMIICwjCCAaqgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwFzEVMBMGA1UEAwwMdGVz\ndC1yb290LWNhMB4XDTIwMDkxMTIyMjczMFoXDTIxMDkxMTIyMjczMFowHzEdMBsG\nA1UEAwwUdGVzdC1pbnRlcm1lZGlhdGUtY2EwggEiMA0GCSqGSIb3DQEBAQUAA4IB\nDwAwggEKAoIBAQDoGijYmLa6P+2C2hcXV7DNBuZ0K+1x41lC8emin9d6wsxsWYJn\nUzthLgJ28eol9CsDQlgRt+rGfYzKgfG7y7Wg7WYQXFHYZt1ANRB0OEVJYm7xurM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2y52ijui9\nSf7QDmtVW7M4kUFjT+If/2yxX/g1dsbKxh+cuZimLWypD3TmhWehglgEZRiDnXJL\n7davAG0DOeO2scnglOY0JAOyM6po4WALmBf6OBxl2jiYpwWgkXMhgGf5u3ID6IDP\nJ2ZeYb9PZ2Z5jYGxUDLRVaaXr0a4a4UbvuECAwEAAaMQMA4wDAYDVR0TBAUwAwEB\n/zANBgkqhkiG9w0BAQsFAAOCAQEATqNEMvk7NUi6M9tv743CVGZa9JLdpdD9ZCbY\nvH6qEl5nVVAiUiKCRSnntDNtUkFd9tVQGk5Hgp2aMm1epq6kC3N0K4Dbsg1dWU4O\nYRG47CSv+sBI4VpDqRjtOS3+FlmMlm237ahs7YcwHNUqqGKbl9QZACxXZeCArYhZ\nt6xDqLb0gKON5gKlhnUqhYTT4+CcBan2nnr7sbdZhwtOmFgrowvs4OVh6WwdbI9m\nSdNKzy7AXAlcodkXAfjIoODeOQdEK6/Ine1K+W4sOk9e+oymoD0KnzhDLI3MDB3V\nGKIiVcct3DMHGI+y04/kcuasqUo4l6lrjt2wJF1pHbaxKIcyGQ==\n-----END CERTIFICATE-----"
1115
}

examples/service_mesh/virtual_deployment.tf

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ resource "oci_service_mesh_virtual_deployment" "test_virtual_deployment" {
77
#Required
88
port = local.virtual_deployment_listeners_port
99
protocol = local.virtual_deployment_listeners_protocol
10+
#Optional
11+
request_timeout_in_ms = local.virtual_deployment_listeners_request_timeout_in_ms
12+
idle_timeout_in_ms = local.virtual_deployment_listeners_idle_timeout_in_ms
1013
}
1114
name = local.virtual_deployment_name
1215
service_discovery {
@@ -30,13 +33,16 @@ data "oci_service_mesh_virtual_deployment" "test_virtual_deployment" {
3033
}
3134

3235
locals {
33-
virtual_deployment_name = "test-virtual-deployment"
34-
virtual_deployment_description = "test virtual deployment description"
35-
virtual_deployment_listeners_port = "8080"
36-
virtual_deployment_listeners_protocol = "HTTP"
36+
virtual_deployment_name = "test-virtual-deployment"
37+
virtual_deployment_description = "test virtual deployment description"
38+
virtual_deployment_listeners_port = "8080"
39+
virtual_deployment_listeners_request_timeout_in_ms = 100
40+
virtual_deployment_listeners_idle_timeout_in_ms = 500
41+
virtual_deployment_listeners_protocol = "HTTP"
3742
// allowed values for above for above are ("HTTP", "TLS_PASSTHROUGH", "TCP", "HTTP2", "GRPC")
43+
3844
virtual_deployment_service_discovery_hostname = "test.com"
3945
virtual_deployment_service_discovery_type = "DNS"
4046
// Allowed values for above are ("DNS", "DISABLED"). Default is "DISABLED"
4147
virtual_deployment_access_logging_is_enabled = true
42-
}
48+
}

examples/service_mesh/virtual_service_route_table.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ resource "oci_service_mesh_virtual_service_route_table" "test_virtual_service_ro
1818
is_grpc = local.virtual_service_route_table_route_rules_is_grpc
1919
path = local.virtual_service_route_table_route_rules_path
2020
path_type = local.virtual_service_route_table_route_rules_path_type
21+
request_timeout_in_ms = local.virtual_service_route_table_route_rules_request_timeout_in_ms
2122
}
2223
virtual_service_id = oci_service_mesh_virtual_service.test_virtual_service.id
2324

@@ -40,8 +41,9 @@ locals {
4041
virtual_service_route_table_description = "test virtual service route table description"
4142
virtual_service_route_table_priority = 1
4243
// allowed values for above are between 1 and 1000, with 1 being highest priority.
43-
virtual_service_route_table_route_rules_destinations_port = "8080"
44-
virtual_service_route_table_route_rules_is_grpc = true
45-
virtual_service_route_table_route_rules_path = "/path"
46-
virtual_service_route_table_route_rules_path_type = "PREFIX"
47-
}
44+
virtual_service_route_table_route_rules_destinations_port = "8080"
45+
virtual_service_route_table_route_rules_is_grpc = true
46+
virtual_service_route_table_route_rules_path = "/path"
47+
virtual_service_route_table_route_rules_path_type = "PREFIX"
48+
virtual_service_route_table_route_rules_request_timeout_in_ms = 200
49+
}

internal/integrationtest/service_mesh_ingress_gateway_route_table_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ var (
6565
"is_path_rewrite_enabled": acctest.Representation{RepType: acctest.Optional, Update: `true`},
6666
"path": acctest.Representation{RepType: acctest.Optional, Update: `/path2`},
6767
"path_type": acctest.Representation{RepType: acctest.Optional, Update: `PREFIX`},
68+
"request_timeout_in_ms": acctest.Representation{RepType: acctest.Optional, Update: `11`},
6869
}
6970
ServiceMeshIngressGatewayRouteTableRouteRulesDestinationsRepresentation = map[string]interface{}{
7071
"virtual_service_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_service_mesh_virtual_service.virtual_service_1.id}`},
@@ -223,6 +224,7 @@ func TestServiceMeshIngressGatewayRouteTableResource_basic(t *testing.T) {
223224
"is_path_rewrite_enabled": "true",
224225
"path": "/path2",
225226
"path_type": "PREFIX",
227+
"request_timeout_in_ms": "11",
226228
"type": "HTTP",
227229
},
228230
[]string{}),
@@ -279,6 +281,7 @@ func TestServiceMeshIngressGatewayRouteTableResource_basic(t *testing.T) {
279281
"is_path_rewrite_enabled": "true",
280282
"path": "/path2",
281283
"path_type": "PREFIX",
284+
"request_timeout_in_ms": "11",
282285
"type": "HTTP",
283286
},
284287
[]string{}),

internal/integrationtest/service_mesh_virtual_deployment_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ var (
7272
}
7373

7474
ServiceMeshVirtualDeploymentListenersRepresentation = map[string]interface{}{
75-
"port": acctest.Representation{RepType: acctest.Required, Create: `8080`, Update: `8081`},
76-
"protocol": acctest.Representation{RepType: acctest.Required, Create: `HTTP`, Update: `TLS_PASSTHROUGH`},
75+
"idle_timeout_in_ms": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`},
76+
"request_timeout_in_ms": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`},
77+
"port": acctest.Representation{RepType: acctest.Required, Create: `8080`, Update: `8081`},
78+
"protocol": acctest.Representation{RepType: acctest.Required, Create: `HTTP`, Update: `GRPC`},
7779
}
7880
ServiceMeshVirtualDeploymentServiceDiscoveryRepresentation = map[string]interface{}{
7981
"type": acctest.Representation{RepType: acctest.Required, Create: `DNS`, Update: `DNS`},
@@ -172,8 +174,10 @@ func TestServiceMeshVirtualDeploymentResource_basic(t *testing.T) {
172174
resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
173175
resource.TestCheckResourceAttrSet(resourceName, "id"),
174176
resource.TestCheckResourceAttr(resourceName, "listeners.#", "1"),
177+
resource.TestCheckResourceAttr(resourceName, "listeners.0.idle_timeout_in_ms", "10"),
175178
resource.TestCheckResourceAttr(resourceName, "listeners.0.port", "8080"),
176179
resource.TestCheckResourceAttr(resourceName, "listeners.0.protocol", "HTTP"),
180+
resource.TestCheckResourceAttr(resourceName, "listeners.0.request_timeout_in_ms", "10"),
177181
resource.TestCheckResourceAttr(resourceName, "name", "name"),
178182
resource.TestCheckResourceAttr(resourceName, "service_discovery.#", "1"),
179183
resource.TestCheckResourceAttr(resourceName, "service_discovery.0.hostname", "hostname"),
@@ -210,8 +214,10 @@ func TestServiceMeshVirtualDeploymentResource_basic(t *testing.T) {
210214
resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
211215
resource.TestCheckResourceAttrSet(resourceName, "id"),
212216
resource.TestCheckResourceAttr(resourceName, "listeners.#", "1"),
217+
resource.TestCheckResourceAttr(resourceName, "listeners.0.idle_timeout_in_ms", "10"),
213218
resource.TestCheckResourceAttr(resourceName, "listeners.0.port", "8080"),
214219
resource.TestCheckResourceAttr(resourceName, "listeners.0.protocol", "HTTP"),
220+
resource.TestCheckResourceAttr(resourceName, "listeners.0.request_timeout_in_ms", "10"),
215221
resource.TestCheckResourceAttr(resourceName, "name", "name"),
216222
resource.TestCheckResourceAttr(resourceName, "service_discovery.#", "1"),
217223
resource.TestCheckResourceAttr(resourceName, "service_discovery.0.hostname", "hostname"),
@@ -243,8 +249,10 @@ func TestServiceMeshVirtualDeploymentResource_basic(t *testing.T) {
243249
resource.TestCheckResourceAttr(resourceName, "freeform_tags.%", "1"),
244250
resource.TestCheckResourceAttrSet(resourceName, "id"),
245251
resource.TestCheckResourceAttr(resourceName, "listeners.#", "1"),
252+
resource.TestCheckResourceAttr(resourceName, "listeners.0.idle_timeout_in_ms", "11"),
246253
resource.TestCheckResourceAttr(resourceName, "listeners.0.port", "8081"),
247-
resource.TestCheckResourceAttr(resourceName, "listeners.0.protocol", "TLS_PASSTHROUGH"),
254+
resource.TestCheckResourceAttr(resourceName, "listeners.0.protocol", "GRPC"),
255+
resource.TestCheckResourceAttr(resourceName, "listeners.0.request_timeout_in_ms", "11"),
248256
resource.TestCheckResourceAttr(resourceName, "name", "name"),
249257
resource.TestCheckResourceAttr(resourceName, "service_discovery.#", "1"),
250258
resource.TestCheckResourceAttr(resourceName, "service_discovery.0.hostname", "hostname2"),
@@ -295,7 +303,9 @@ func TestServiceMeshVirtualDeploymentResource_basic(t *testing.T) {
295303
resource.TestCheckResourceAttrSet(singularDatasourceName, "id"),
296304
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.#", "1"),
297305
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.0.port", "8081"),
298-
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.0.protocol", "TLS_PASSTHROUGH"),
306+
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.0.idle_timeout_in_ms", "11"),
307+
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.0.protocol", "GRPC"),
308+
resource.TestCheckResourceAttr(singularDatasourceName, "listeners.0.request_timeout_in_ms", "11"),
299309
resource.TestCheckResourceAttr(singularDatasourceName, "name", "name"),
300310
resource.TestCheckResourceAttr(singularDatasourceName, "service_discovery.#", "1"),
301311
resource.TestCheckResourceAttr(singularDatasourceName, "service_discovery.0.hostname", "hostname2"),

internal/integrationtest/service_mesh_virtual_service_route_table_test.go

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,12 @@ var (
5757
"priority": acctest.Representation{RepType: acctest.Optional, Create: `10`, Update: `11`},
5858
}
5959
ServiceMeshVirtualServiceRouteTableRouteRulesRepresentation = map[string]interface{}{
60-
"destinations": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshVirtualServiceRouteTableRouteRulesDestinationsRepresentation},
61-
"type": acctest.Representation{RepType: acctest.Required, Create: `TCP`, Update: `HTTP`},
62-
"is_grpc": acctest.Representation{RepType: acctest.Optional, Update: `true`},
63-
"path": acctest.Representation{RepType: acctest.Optional, Update: `/path2`},
64-
"path_type": acctest.Representation{RepType: acctest.Optional, Update: `PREFIX`},
60+
"destinations": acctest.RepresentationGroup{RepType: acctest.Required, Group: ServiceMeshVirtualServiceRouteTableRouteRulesDestinationsRepresentation},
61+
"type": acctest.Representation{RepType: acctest.Required, Create: `TCP`, Update: `HTTP`},
62+
"is_grpc": acctest.Representation{RepType: acctest.Optional, Update: `true`},
63+
"path": acctest.Representation{RepType: acctest.Optional, Update: `/path2`},
64+
"path_type": acctest.Representation{RepType: acctest.Optional, Update: `PREFIX`},
65+
"request_timeout_in_ms": acctest.Representation{RepType: acctest.Optional, Update: `11`},
6566
}
6667
ServiceMeshVirtualServiceRouteTableRouteRulesDestinationsRepresentation = map[string]interface{}{
6768
"virtual_deployment_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_service_mesh_virtual_deployment.virtual_deployment_1.id}`},
@@ -206,11 +207,12 @@ func TestServiceMeshVirtualServiceRouteTableResource_basic(t *testing.T) {
206207
resource.TestCheckResourceAttr(resourceName, "priority", "11"),
207208
resource.TestCheckResourceAttr(resourceName, "route_rules.#", "1"),
208209
acctest.CheckResourceSetContainsElementWithProperties(resourceName, "route_rules", map[string]string{
209-
"destinations.#": "1",
210-
"is_grpc": "true",
211-
"path": "/path2",
212-
"path_type": "PREFIX",
213-
"type": "HTTP",
210+
"destinations.#": "1",
211+
"is_grpc": "true",
212+
"path": "/path2",
213+
"path_type": "PREFIX",
214+
"request_timeout_in_ms": "11",
215+
"type": "HTTP",
214216
},
215217
[]string{}),
216218
resource.TestCheckResourceAttrSet(resourceName, "state"),
@@ -260,11 +262,12 @@ func TestServiceMeshVirtualServiceRouteTableResource_basic(t *testing.T) {
260262
resource.TestCheckResourceAttr(singularDatasourceName, "priority", "11"),
261263
resource.TestCheckResourceAttr(singularDatasourceName, "route_rules.#", "1"),
262264
acctest.CheckResourceSetContainsElementWithProperties(singularDatasourceName, "route_rules", map[string]string{
263-
"destinations.#": "1",
264-
"is_grpc": "true",
265-
"path": "/path2",
266-
"path_type": "PREFIX",
267-
"type": "HTTP",
265+
"destinations.#": "1",
266+
"is_grpc": "true",
267+
"path": "/path2",
268+
"path_type": "PREFIX",
269+
"request_timeout_in_ms": "11",
270+
"type": "HTTP",
268271
},
269272
[]string{}),
270273
resource.TestCheckResourceAttrSet(singularDatasourceName, "state"),

internal/service/service_mesh/service_mesh_common.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ func routeRulesHashCodeForSets(v interface{}) int {
3434
if pathType, ok := m["path_type"]; ok && pathType != "" {
3535
buf.WriteString(fmt.Sprintf("%v-", pathType))
3636
}
37+
if requestTimeoutInMs, ok := m["request_timeout_in_ms"]; ok {
38+
buf.WriteString(fmt.Sprintf("%v-", requestTimeoutInMs))
39+
}
3740
if type_, ok := m["type"]; ok && type_ != "" {
3841
buf.WriteString(fmt.Sprintf("%v-", type_))
3942
}

internal/service/service_mesh/service_mesh_ingress_gateway_route_table_resource.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"context"
88
"fmt"
99
"log"
10+
"strconv"
1011
"strings"
1112
"time"
1213

@@ -143,6 +144,13 @@ func ServiceMeshIngressGatewayRouteTableResource() *schema.Resource {
143144
Optional: true,
144145
Computed: true,
145146
},
147+
"request_timeout_in_ms": {
148+
Type: schema.TypeString,
149+
Optional: true,
150+
Computed: true,
151+
ValidateFunc: tfresource.ValidateInt64TypeString,
152+
DiffSuppressFunc: tfresource.Int64StringDiffSuppressFunction,
153+
},
146154

147155
// Computed
148156
},
@@ -737,6 +745,14 @@ func (s *ServiceMeshIngressGatewayRouteTableResourceCrud) mapToIngressGatewayTra
737745
if pathType, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "path_type")); ok {
738746
details.PathType = oci_service_mesh.HttpIngressGatewayTrafficRouteRuleDetailsPathTypeEnum(pathType.(string))
739747
}
748+
if requestTimeoutInMs, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "request_timeout_in_ms")); ok {
749+
tmp := requestTimeoutInMs.(string)
750+
tmpInt64, err := strconv.ParseInt(tmp, 10, 64)
751+
if err != nil {
752+
return details, fmt.Errorf("unable to convert requestTimeoutInMs string: %s to an int64 and encountered error: %v", tmp, err)
753+
}
754+
details.RequestTimeoutInMs = &tmpInt64
755+
}
740756
if destinations, ok := s.D.GetOkExists(fmt.Sprintf(fieldKeyFormat, "destinations")); ok {
741757
interfaces := destinations.([]interface{})
742758
tmp := make([]oci_service_mesh.VirtualServiceTrafficRuleTargetDetails, len(interfaces))
@@ -852,6 +868,10 @@ func IngressGatewayTrafficRouteRuleToMap(obj oci_service_mesh.IngressGatewayTraf
852868

853869
result["path_type"] = string(v.PathType)
854870

871+
if v.RequestTimeoutInMs != nil {
872+
result["request_timeout_in_ms"] = strconv.FormatInt(*v.RequestTimeoutInMs, 10)
873+
}
874+
855875
destinations := []interface{}{}
856876
for _, item := range v.Destinations {
857877
destinations = append(destinations, VirtualServiceTrafficRuleTargetToMap(item))

0 commit comments

Comments
 (0)