@@ -83,8 +83,21 @@ func resourceScalewayLbBackendBeta() *schema.Resource {
83
83
Description : "Enables PROXY protocol version 2" ,
84
84
Optional : true ,
85
85
Default : false ,
86
+ Deprecated : "Please use proxy_protocol instead" ,
87
+ },
88
+ "proxy_protocol" : {
89
+ Type : schema .TypeString ,
90
+ Description : "Type of PROXY protocol to enable" ,
91
+ Optional : true ,
92
+ Default : lb .ProxyProtocolProxyProtocolNone ,
93
+ ValidateFunc : validation .StringInSlice ([]string {
94
+ flattenLbProxyProtocol (lb .ProxyProtocolProxyProtocolNone ).(string ),
95
+ flattenLbProxyProtocol (lb .ProxyProtocolProxyProtocolV1 ).(string ),
96
+ flattenLbProxyProtocol (lb .ProxyProtocolProxyProtocolV2 ).(string ),
97
+ flattenLbProxyProtocol (lb .ProxyProtocolProxyProtocolV2Ssl ).(string ),
98
+ flattenLbProxyProtocol (lb .ProxyProtocolProxyProtocolV2SslCn ).(string ),
99
+ }, false ),
86
100
},
87
-
88
101
// Timeouts
89
102
"timeout_server" : {
90
103
Type : schema .TypeString ,
@@ -248,6 +261,7 @@ func resourceScalewayLbBackendBetaCreate(d *schema.ResourceData, m interface{})
248
261
},
249
262
ServerIP : expandStrings (d .Get ("server_ips" )),
250
263
SendProxyV2 : d .Get ("send_proxy_v2" ).(bool ),
264
+ ProxyProtocol : expandLbProxyProtocol (d .Get ("proxy_protocol" )),
251
265
TimeoutServer : expandDuration (d .Get ("timeout_server" )),
252
266
TimeoutConnect : expandDuration (d .Get ("timeout_connect" )),
253
267
TimeoutTunnel : expandDuration (d .Get ("timeout_tunnel" )),
@@ -292,6 +306,7 @@ func resourceScalewayLbBackendBetaRead(d *schema.ResourceData, m interface{}) er
292
306
_ = d .Set ("sticky_sessions_cookie_name" , res .StickySessionsCookieName )
293
307
_ = d .Set ("server_ips" , res .Pool )
294
308
_ = d .Set ("send_proxy_v2" , res .SendProxyV2 )
309
+ _ = d .Set ("proxy_protocol" , flattenLbProxyProtocol (res .ProxyProtocol ))
295
310
_ = d .Set ("timeout_server" , flattenDuration (res .TimeoutServer ))
296
311
_ = d .Set ("timeout_connect" , flattenDuration (res .TimeoutConnect ))
297
312
_ = d .Set ("timeout_tunnel" , flattenDuration (res .TimeoutTunnel ))
@@ -323,6 +338,7 @@ func resourceScalewayLbBackendBetaUpdate(d *schema.ResourceData, m interface{})
323
338
StickySessions : expandLbStickySessionsType (d .Get ("sticky_sessions" )),
324
339
StickySessionsCookieName : d .Get ("sticky_sessions_cookie_name" ).(string ),
325
340
SendProxyV2 : d .Get ("send_proxy_v2" ).(bool ),
341
+ ProxyProtocol : expandLbProxyProtocol (d .Get ("proxy_protocol" )),
326
342
TimeoutServer : expandDuration (d .Get ("timeout_server" )),
327
343
TimeoutConnect : expandDuration (d .Get ("timeout_connect" )),
328
344
TimeoutTunnel : expandDuration (d .Get ("timeout_tunnel" )),
0 commit comments