@@ -90,6 +90,16 @@ func resourceFortiadcLoadbalanceVirtualServer() *schema.Resource {
9090 Type : schema .TypeString ,
9191 Required : true ,
9292 },
93+ "client_ssl_profile" : & schema.Schema {
94+ Type : schema .TypeString ,
95+ Optional : true ,
96+ Default : "" ,
97+ },
98+ "http_to_https" : & schema.Schema {
99+ Type : schema .TypeBool ,
100+ Optional : true ,
101+ Default : false ,
102+ },
93103 },
94104 }
95105}
@@ -106,6 +116,11 @@ func resourceFortiadcLoadbalanceVirtualServerCreate(d *schema.ResourceData, m in
106116 return errors .New ("nat_source_pool cannot be defined when packet_forward_method is not FullNAT" )
107117 }
108118
119+ http2https := "disable"
120+ if d .Get ("http_to_https" ).(bool ) {
121+ http2https = "enable"
122+ }
123+
109124 req := gofortiadc.LoadbalanceVirtualServerReq {
110125 Status : d .Get ("status" ).(string ),
111126 Type : d .Get ("type" ).(string ),
@@ -122,13 +137,15 @@ func resourceFortiadcLoadbalanceVirtualServerCreate(d *schema.ResourceData, m in
122137 Warmup : "0" ,
123138 Warmrate : "10" ,
124139 ConnectionRateLimit : fmt .Sprintf ("%d" , d .Get ("connection_rate_limit" ).(int )),
125- Log : "enable " ,
140+ Log : "disable " ,
126141 Alone : "enable" ,
127142 Mkey : d .Get ("name" ).(string ),
128143 Interface : d .Get ("interface" ).(string ),
129144 Profile : d .Get ("profile" ).(string ),
130145 Method : d .Get ("method" ).(string ),
131146 Pool : d .Get ("pool" ).(string ),
147+ ClientSSLProfile : d .Get ("client_ssl_profile" ).(string ),
148+ HTTP2HTTPS : http2https ,
132149 }
133150
134151 err := client .LoadbalanceCreateVirtualServer (req )
@@ -154,6 +171,11 @@ func resourceFortiadcLoadbalanceVirtualServerRead(d *schema.ResourceData, m inte
154171 contentRouting = true
155172 }
156173
174+ http2https := false
175+ if rs .HTTP2HTTPS == "enable" {
176+ http2https = true
177+ }
178+
157179 d .Set ("status" , rs .Status )
158180 d .Set ("type" , rs .Type )
159181 d .Set ("address_type" , rs .AddrType )
@@ -165,6 +187,8 @@ func resourceFortiadcLoadbalanceVirtualServerRead(d *schema.ResourceData, m inte
165187 d .Set ("profile" , rs .Profile )
166188 d .Set ("method" , rs .Method )
167189 d .Set ("pool" , rs .Pool )
190+ d .Set ("client_ssl_profile" , rs .ClientSSLProfile )
191+ d .Set ("http_to_https" , http2https )
168192
169193 port , err := strconv .ParseInt (strings .TrimSpace (rs .Port ), 10 , 64 )
170194 if err != nil {
@@ -199,6 +223,11 @@ func resourceFortiadcLoadbalanceVirtualServerUpdate(d *schema.ResourceData, m in
199223 return errors .New ("nat_source_pool cannot be defined when packet_forward_method is not FullNAT" )
200224 }
201225
226+ http2https := "disable"
227+ if d .Get ("http_to_https" ).(bool ) {
228+ http2https = "enable"
229+ }
230+
202231 req := gofortiadc.LoadbalanceVirtualServerReq {
203232 Status : d .Get ("status" ).(string ),
204233 Type : d .Get ("type" ).(string ),
@@ -222,6 +251,8 @@ func resourceFortiadcLoadbalanceVirtualServerUpdate(d *schema.ResourceData, m in
222251 Profile : d .Get ("profile" ).(string ),
223252 Method : d .Get ("method" ).(string ),
224253 Pool : d .Get ("pool" ).(string ),
254+ ClientSSLProfile : d .Get ("client_ssl_profile" ).(string ),
255+ HTTP2HTTPS : http2https ,
225256 }
226257
227258 err := client .LoadbalanceUpdateVirtualServer (req )
0 commit comments