From d2c51afbe5daf6180a089e787398e6c80e069eff Mon Sep 17 00:00:00 2001 From: stackit-pipeline <142982727+stackit-pipeline@users.noreply.github.com> Date: Tue, 1 Jul 2025 10:47:07 +0200 Subject: [PATCH] fix(deps): update stackit sdk modules (#894) * fix(deps): update stackit sdk modules * Adjust opensearch regarding breaking change tls_protocol parameter is now a string array instead of a single string Signed-off-by: Alexander Dahmen --------- Signed-off-by: Alexander Dahmen Co-authored-by: Renovate Bot Co-authored-by: Alexander Dahmen --- docs/resources/opensearch_instance.md | 2 +- go.mod | 16 +++++----- go.sum | 32 +++++++++---------- .../services/opensearch/instance/resource.go | 13 +++++--- .../opensearch/instance/resource_test.go | 11 ++++--- 5 files changed, 41 insertions(+), 33 deletions(-) diff --git a/docs/resources/opensearch_instance.md b/docs/resources/opensearch_instance.md index 267f005b..14d2adb0 100644 --- a/docs/resources/opensearch_instance.md +++ b/docs/resources/opensearch_instance.md @@ -67,4 +67,4 @@ Optional: - `sgw_acl` (String) Comma separated list of IP networks in CIDR notation which are allowed to access this instance. - `syslog` (List of String) List of syslog servers to send logs to. - `tls_ciphers` (List of String) List of TLS ciphers to use. -- `tls_protocols` (String) The TLS protocol to use. +- `tls_protocols` (List of String) The TLS protocol to use. diff --git a/go.mod b/go.mod index abd3a9b5..9aa54d43 100644 --- a/go.mod +++ b/go.mod @@ -12,10 +12,10 @@ require ( github.com/hashicorp/terraform-plugin-log v0.9.0 github.com/hashicorp/terraform-plugin-testing v1.13.2 github.com/stackitcloud/stackit-sdk-go/core v0.17.2 - github.com/stackitcloud/stackit-sdk-go/services/cdn v1.2.1 - github.com/stackitcloud/stackit-sdk-go/services/dns v0.16.0 + github.com/stackitcloud/stackit-sdk-go/services/cdn v1.3.0 + github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.0 github.com/stackitcloud/stackit-sdk-go/services/git v0.6.0 - github.com/stackitcloud/stackit-sdk-go/services/iaas v0.25.0 + github.com/stackitcloud/stackit-sdk-go/services/iaas v0.26.0 github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.4.0 github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.0 github.com/stackitcloud/stackit-sdk-go/services/mariadb v0.25.0 @@ -23,10 +23,10 @@ require ( github.com/stackitcloud/stackit-sdk-go/services/mongodbflex v1.2.1 github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.3.0 github.com/stackitcloud/stackit-sdk-go/services/observability v0.8.0 - github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1 - github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0 - github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.24.1 - github.com/stackitcloud/stackit-sdk-go/services/redis v0.24.1 + github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.0 + github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.2.0 + github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.0 + github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.0 github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.17.0 github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.13.0 github.com/stackitcloud/stackit-sdk-go/services/serverbackup v1.3.0 @@ -34,7 +34,7 @@ require ( github.com/stackitcloud/stackit-sdk-go/services/serviceaccount v0.9.0 github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1 github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0 - github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.2.0 + github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0 github.com/teambition/rrule-go v1.8.2 golang.org/x/mod v0.25.0 ) diff --git a/go.sum b/go.sum index 35688970..f518c651 100644 --- a/go.sum +++ b/go.sum @@ -154,14 +154,14 @@ github.com/stackitcloud/stackit-sdk-go/core v0.17.2 h1:jPyn+i8rkp2hM80+hOg0B/1EV github.com/stackitcloud/stackit-sdk-go/core v0.17.2/go.mod h1:8KIw3czdNJ9sdil9QQimxjR6vHjeINFrRv0iZ67wfn0= github.com/stackitcloud/stackit-sdk-go/services/authorization v0.8.0 h1:KXMiTBV4KcOEQRFddtOUFspL+KRvjDQNDIs73bdiey0= github.com/stackitcloud/stackit-sdk-go/services/authorization v0.8.0/go.mod h1:+2mx2MclJFMQ4Y6b20jspYAnIeFJP3/yvO6Gfvcvf6Q= -github.com/stackitcloud/stackit-sdk-go/services/cdn v1.2.1 h1:u1cLLpnuReJb+bRc6FONX0rMJiPpAT66HjpqxvNfjGU= -github.com/stackitcloud/stackit-sdk-go/services/cdn v1.2.1/go.mod h1:yTZjDrpVbEuDMRcCK7PpXR1yz+O6NcNFAgxydT6eBYc= -github.com/stackitcloud/stackit-sdk-go/services/dns v0.16.0 h1:86F0qHx2YOzxoGkcFX1tT20+Yz1mwaPPS2aFODxuMpY= -github.com/stackitcloud/stackit-sdk-go/services/dns v0.16.0/go.mod h1:xhAdw016dY/hVsLerlExSMocqCc872+S0y1CdV3jAjU= +github.com/stackitcloud/stackit-sdk-go/services/cdn v1.3.0 h1:MaHdLZNI8LqHZPzHgBTf5gqgaDiN7em2QultgG9GGWg= +github.com/stackitcloud/stackit-sdk-go/services/cdn v1.3.0/go.mod h1:yTZjDrpVbEuDMRcCK7PpXR1yz+O6NcNFAgxydT6eBYc= +github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.0 h1:x5mx/C2bdtpOH974RofXD0Y8YOyJtYXwIyaCyWOXMwU= +github.com/stackitcloud/stackit-sdk-go/services/dns v0.17.0/go.mod h1:xhAdw016dY/hVsLerlExSMocqCc872+S0y1CdV3jAjU= github.com/stackitcloud/stackit-sdk-go/services/git v0.6.0 h1:C+8z3MdvnTngcH9L72VHLXRKNWHHYp+7FO/F6imKmB4= github.com/stackitcloud/stackit-sdk-go/services/git v0.6.0/go.mod h1:agI7SONeLR/IZL3TOgn1tDzfS63O2rWKQE8+huRjEzU= -github.com/stackitcloud/stackit-sdk-go/services/iaas v0.25.0 h1:K9RjMPlEK1XQegZBMIrI/KHAorzRdOt5YpftsT7pMEk= -github.com/stackitcloud/stackit-sdk-go/services/iaas v0.25.0/go.mod h1:lUGkcbyMkd4nRBDFmKohIwlgtOZqQo4Ek5S5ajw90Xg= +github.com/stackitcloud/stackit-sdk-go/services/iaas v0.26.0 h1:7qm/Tft79wFlHomPdgjUJ9uJU8kEk+k9ficMGRoHtf0= +github.com/stackitcloud/stackit-sdk-go/services/iaas v0.26.0/go.mod h1:lUGkcbyMkd4nRBDFmKohIwlgtOZqQo4Ek5S5ajw90Xg= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.4.0 h1:Ef4SyTBjIkfwaws4mssa6AoK+OokHFtr7ZIflUpoXVE= github.com/stackitcloud/stackit-sdk-go/services/loadbalancer v1.4.0/go.mod h1:FiVhDlw9+yuTiUmnyGLn2qpsLW26w9OC4TS1y78czvg= github.com/stackitcloud/stackit-sdk-go/services/logme v0.25.0 h1:QKOfaB7EcuJmBCxpFXN2K7g2ih0gQM6cyZ1VhTmtQfI= @@ -176,14 +176,14 @@ github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.3.0 h1:bK5FDpSG github.com/stackitcloud/stackit-sdk-go/services/objectstorage v1.3.0/go.mod h1:Q2SJXlZTksvNAb1QnpGNfDSw/OMPN9uopaKuptUGhO8= github.com/stackitcloud/stackit-sdk-go/services/observability v0.8.0 h1:8v9Iupkc3meXcVPMpteXDz07YzY2M5jud50vEtAvbs8= github.com/stackitcloud/stackit-sdk-go/services/observability v0.8.0/go.mod h1:+eNo7SEeVRuW7hgujSabSketScSUKGuC88UznPS+UTE= -github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1 h1:E6vCqPn1NiPHnbnvqLNQNz6a/cmeyRb5iA9cDUPtP58= -github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.23.1/go.mod h1:ifKKKCWL1U435fXGQ375SPX+burtfg1I7EGZ58COzRA= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0 h1:r29a9GoBLVw2VZSzdPftlIsE5t7shdxobwoT6NVUIjU= -github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.1.0/go.mod h1:4g/L5PHfz1xk3udEhvPy2nXiH4UgRO5Cj6iwUa7k5VQ= -github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.24.1 h1:2rDFwJtZOFYFUiJqJ9uIwM+mu+BbtuVaUHARRJtrZPU= -github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.24.1/go.mod h1:YL0l9l9xzJy2BmV+U9XkcXlQaHbE2KyA37GpGvBXIJ4= -github.com/stackitcloud/stackit-sdk-go/services/redis v0.24.1 h1:4H+GL4eLEO116Vlh0pe+udGGYnMohA8YhLW9KYGdEOc= -github.com/stackitcloud/stackit-sdk-go/services/redis v0.24.1/go.mod h1:PAQH8+1DDGc6uibvC3nDtfRLu8uxutIr25mPJvrCOy8= +github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.0 h1:+qFjzDDv/0ZHGdVuW2HzAphRBmlc1+abw7k1RaAqmQo= +github.com/stackitcloud/stackit-sdk-go/services/opensearch v0.24.0/go.mod h1:ifKKKCWL1U435fXGQ375SPX+burtfg1I7EGZ58COzRA= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.2.0 h1:DGgKKCh3AmUBqDG0DrsWVcclxSaG82TVEf18A29w+J0= +github.com/stackitcloud/stackit-sdk-go/services/postgresflex v1.2.0/go.mod h1:I67K+QjPAIMrW/r/0GOdX2WSmA8J72LNzpe8rElfxFI= +github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.0 h1:Xhgo0Di6NDjkg0Bf3f6LHlQ09u0Dj/3WdDb0xd47vEU= +github.com/stackitcloud/stackit-sdk-go/services/rabbitmq v0.25.0/go.mod h1:YL0l9l9xzJy2BmV+U9XkcXlQaHbE2KyA37GpGvBXIJ4= +github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.0 h1:wdQoQ9RUkpX80twtG9xUghW9Xn1ka9zOjIxJDLbtwSo= +github.com/stackitcloud/stackit-sdk-go/services/redis v0.25.0/go.mod h1:PAQH8+1DDGc6uibvC3nDtfRLu8uxutIr25mPJvrCOy8= github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.17.0 h1:lxI0LnHcTpnF8g0tHTCQ1UIVLlNHk1W1WAclp3Ut0fw= github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.17.0/go.mod h1:TBvZpbCju0Zmq8GoS4CEtUg2MqtdqWrGeEAOXwkJNQo= github.com/stackitcloud/stackit-sdk-go/services/secretsmanager v0.13.0 h1:CtCaG8nycfviq/QgNM7OoBWs/Ap9IQvOmvI0tZhYdPI= @@ -198,8 +198,8 @@ github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1 h1:h1Ts github.com/stackitcloud/stackit-sdk-go/services/serviceenablement v1.2.1/go.mod h1:M4xZ2BnmROvLV2MrAP6A8o9BnyT0CkvpEcP8lBOfRs8= github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0 h1:bwLmLXvtCl1XkPRP+YrXwfz+lBMaGWH/crlNbYtxeqE= github.com/stackitcloud/stackit-sdk-go/services/ske v0.27.0/go.mod h1:V09NmPahuUiuZEogVPgxuVqqti0th5B7TVAjuiM09mE= -github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.2.0 h1:WvPLO1c7oT/MWmCRTt7jRyxus2g3DIluIW5iAsUpSFM= -github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.2.0/go.mod h1:CyYJqR0tZWs2r5bGz69j4bmvhxdsd4QLCm1Uf+LouB0= +github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0 h1:pUl/981oAXPnZd7++69NfEWv6JwW9UpxER16XxQUdOk= +github.com/stackitcloud/stackit-sdk-go/services/sqlserverflex v1.3.0/go.mod h1:S04/QsQrB2EgYGjl62BO+9QUswrlRBoBosigrhdmccM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= diff --git a/stackit/internal/services/opensearch/instance/resource.go b/stackit/internal/services/opensearch/instance/resource.go index da46647b..68999e68 100644 --- a/stackit/internal/services/opensearch/instance/resource.go +++ b/stackit/internal/services/opensearch/instance/resource.go @@ -69,7 +69,7 @@ type parametersModel struct { Plugins types.List `tfsdk:"plugins"` Syslog types.List `tfsdk:"syslog"` TlsCiphers types.List `tfsdk:"tls_ciphers"` - TlsProtocols types.String `tfsdk:"tls_protocols"` + TlsProtocols types.List `tfsdk:"tls_protocols"` } // Types corresponding to parametersModel @@ -87,7 +87,7 @@ var parametersTypes = map[string]attr.Type{ "plugins": basetypes.ListType{ElemType: types.StringType}, "syslog": basetypes.ListType{ElemType: types.StringType}, "tls_ciphers": basetypes.ListType{ElemType: types.StringType}, - "tls_protocols": basetypes.StringType{}, + "tls_protocols": basetypes.ListType{ElemType: types.StringType}, } // NewInstanceResource is a helper function to simplify the provider implementation. @@ -278,7 +278,8 @@ func (r *instanceResource) Schema(_ context.Context, _ resource.SchemaRequest, r Optional: true, Computed: true, }, - "tls_protocols": schema.StringAttribute{ + "tls_protocols": schema.ListAttribute{ + ElementType: types.StringType, Description: parametersDescriptions["tls_protocols"], Optional: true, Computed: true, @@ -733,7 +734,6 @@ func toInstanceParams(parameters *parametersModel) (*opensearch.InstanceParamete payloadParams.MetricsFrequency = conversion.Int64ValueToPointer(parameters.MetricsFrequency) payloadParams.MetricsPrefix = conversion.StringValueToPointer(parameters.MetricsPrefix) payloadParams.MonitoringInstanceId = conversion.StringValueToPointer(parameters.MonitoringInstanceId) - payloadParams.TlsProtocols = opensearch.InstanceParametersGetTlsProtocolsAttributeType(conversion.StringValueToPointer(parameters.TlsProtocols)) var err error payloadParams.Plugins, err = conversion.StringListToPointer(parameters.Plugins) @@ -751,6 +751,11 @@ func toInstanceParams(parameters *parametersModel) (*opensearch.InstanceParamete return nil, fmt.Errorf("convert tls_ciphers: %w", err) } + payloadParams.TlsProtocols, err = conversion.StringListToPointer(parameters.TlsProtocols) + if err != nil { + return nil, fmt.Errorf("convert tls_protocols: %w", err) + } + return payloadParams, nil } diff --git a/stackit/internal/services/opensearch/instance/resource_test.go b/stackit/internal/services/opensearch/instance/resource_test.go index d77887c0..82dd9b4d 100644 --- a/stackit/internal/services/opensearch/instance/resource_test.go +++ b/stackit/internal/services/opensearch/instance/resource_test.go @@ -35,7 +35,10 @@ var fixtureModelParameters = types.ObjectValueMust(parametersTypes, map[string]a types.StringValue("cipher"), types.StringValue("cipher2"), }), - "tls_protocols": types.StringValue(string(opensearch.INSTANCEPARAMETERSTLS_PROTOCOLS__2)), + "tls_protocols": types.ListValueMust(types.StringType, []attr.Value{ + types.StringValue("TLSv1.2"), + types.StringValue("TLSv1.3"), + }), }) var fixtureNullModelParameters = types.ObjectValueMust(parametersTypes, map[string]attr.Value{ @@ -52,7 +55,7 @@ var fixtureNullModelParameters = types.ObjectValueMust(parametersTypes, map[stri "plugins": types.ListNull(types.StringType), "syslog": types.ListNull(types.StringType), "tls_ciphers": types.ListNull(types.StringType), - "tls_protocols": types.StringNull(), + "tls_protocols": types.ListNull(types.StringType), }) var fixtureInstanceParameters = opensearch.InstanceParameters{ @@ -69,7 +72,7 @@ var fixtureInstanceParameters = opensearch.InstanceParameters{ Plugins: &[]string{"plugin", "plugin2"}, Syslog: &[]string{"syslog", "syslog2"}, TlsCiphers: &[]string{"cipher", "cipher2"}, - TlsProtocols: opensearch.INSTANCEPARAMETERSTLS_PROTOCOLS__2.Ptr(), + TlsProtocols: &[]string{"TLSv1.2", "TLSv1.3"}, } func TestMapFields(t *testing.T) { @@ -123,7 +126,7 @@ func TestMapFields(t *testing.T) { "plugins": []string{"plugin", "plugin2"}, "syslog": []string{"syslog", "syslog2"}, "tls-ciphers": []string{"cipher", "cipher2"}, - "tls-protocols": string(opensearch.INSTANCEPARAMETERSTLS_PROTOCOLS__2), + "tls-protocols": []string{"TLSv1.2", "TLSv1.3"}, }, }, Model{