@@ -12,6 +12,7 @@ import (
1212 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality"
1313 "github.com/scaleway/terraform-provider-scaleway/v2/internal/locality/regional"
1414 "github.com/scaleway/terraform-provider-scaleway/v2/internal/types"
15+ "github.com/scaleway/terraform-provider-scaleway/v2/internal/verify"
1516)
1617
1718const (
@@ -106,14 +107,11 @@ func ResourceContainer() *schema.Resource {
106107 Description : "The maximum amount of time in seconds during which your container can process a request before we stop it. Defaults to 300s." ,
107108 },
108109 "privacy" : {
109- Type : schema .TypeString ,
110- Optional : true ,
111- Description : "The privacy type define the way to authenticate to your container" ,
112- Default : container .ContainerPrivacyPublic ,
113- ValidateFunc : validation .StringInSlice ([]string {
114- container .ContainerPrivacyPublic .String (),
115- container .ContainerPrivacyPrivate .String (),
116- }, false ),
110+ Type : schema .TypeString ,
111+ Optional : true ,
112+ Description : "The privacy type define the way to authenticate to your container" ,
113+ Default : container .ContainerPrivacyPublic ,
114+ ValidateDiagFunc : verify .ValidateEnum [container.ContainerPrivacy ](),
117115 },
118116 "registry_image" : {
119117 Type : schema .TypeString ,
@@ -140,14 +138,11 @@ func ResourceContainer() *schema.Resource {
140138 Description : "The native container domain name." ,
141139 },
142140 "protocol" : {
143- Type : schema .TypeString ,
144- Optional : true ,
145- Description : "The communication protocol http1 or h2c. Defaults to http1." ,
146- Default : container .ContainerProtocolHTTP1 .String (),
147- ValidateFunc : validation .StringInSlice ([]string {
148- container .ContainerProtocolH2c .String (),
149- container .ContainerProtocolHTTP1 .String (),
150- }, false ),
141+ Type : schema .TypeString ,
142+ Optional : true ,
143+ Description : "The communication protocol http1 or h2c. Defaults to http1." ,
144+ Default : container .ContainerProtocolHTTP1 .String (),
145+ ValidateDiagFunc : verify .ValidateEnum [container.ContainerProtocol ](),
151146 },
152147 "port" : {
153148 Type : schema .TypeInt ,
@@ -162,14 +157,11 @@ func ResourceContainer() *schema.Resource {
162157 Default : false ,
163158 },
164159 "http_option" : {
165- Type : schema .TypeString ,
166- Optional : true ,
167- Description : "HTTP traffic configuration" ,
168- Default : container .ContainerHTTPOptionEnabled .String (),
169- ValidateFunc : validation .StringInSlice ([]string {
170- container .ContainerHTTPOptionEnabled .String (),
171- container .ContainerHTTPOptionRedirected .String (),
172- }, false ),
160+ Type : schema .TypeString ,
161+ Optional : true ,
162+ Description : "HTTP traffic configuration" ,
163+ Default : container .ContainerHTTPOptionEnabled .String (),
164+ ValidateDiagFunc : verify .ValidateEnum [container.ContainerHTTPOption ](),
173165 },
174166 // computed
175167 "status" : {
0 commit comments