@@ -147,6 +147,57 @@ func LoadBalancerBackendSetResource() *schema.Resource {
147147 },
148148 },
149149 },
150+ "lb_cookie_session_persistence_configuration" : {
151+ Type : schema .TypeList ,
152+ Optional : true ,
153+ Computed : true ,
154+ MaxItems : 1 ,
155+ MinItems : 1 ,
156+ Elem : & schema.Resource {
157+ Schema : map [string ]* schema.Schema {
158+ // Required
159+
160+ // Optional
161+ "cookie_name" : {
162+ Type : schema .TypeString ,
163+ Optional : true ,
164+ Computed : true ,
165+ },
166+ "disable_fallback" : {
167+ Type : schema .TypeBool ,
168+ Optional : true ,
169+ Computed : true ,
170+ },
171+ "domain" : {
172+ Type : schema .TypeString ,
173+ Optional : true ,
174+ Computed : true ,
175+ },
176+ "is_http_only" : {
177+ Type : schema .TypeBool ,
178+ Optional : true ,
179+ Computed : true ,
180+ },
181+ "is_secure" : {
182+ Type : schema .TypeBool ,
183+ Optional : true ,
184+ Computed : true ,
185+ },
186+ "max_age_in_seconds" : {
187+ Type : schema .TypeInt ,
188+ Optional : true ,
189+ Computed : true ,
190+ },
191+ "path" : {
192+ Type : schema .TypeString ,
193+ Optional : true ,
194+ Computed : true ,
195+ },
196+
197+ // Computed
198+ },
199+ },
200+ },
150201 "session_persistence_configuration" : {
151202 Type : schema .TypeList ,
152203 Optional : true ,
@@ -313,6 +364,17 @@ func (s *LoadBalancerBackendSetResourceCrud) Create() error {
313364 }
314365 }
315366
367+ if lbCookieSessionPersistenceConfiguration , ok := s .D .GetOkExists ("lb_cookie_session_persistence_configuration" ); ok {
368+ if tmpList := lbCookieSessionPersistenceConfiguration .([]interface {}); len (tmpList ) > 0 {
369+ fieldKeyFormat := fmt .Sprintf ("%s.%d.%%s" , "lb_cookie_session_persistence_configuration" , 0 )
370+ tmp , err := s .mapToLBCookieSessionPersistenceConfigurationDetails (fieldKeyFormat )
371+ if err != nil {
372+ return err
373+ }
374+ request .LbCookieSessionPersistenceConfiguration = & tmp
375+ }
376+ }
377+
316378 if loadBalancerId , ok := s .D .GetOkExists ("load_balancer_id" ); ok {
317379 tmp := loadBalancerId .(string )
318380 request .LoadBalancerId = & tmp
@@ -459,6 +521,17 @@ func (s *LoadBalancerBackendSetResourceCrud) Update() error {
459521 }
460522 }
461523
524+ if lbCookieSessionPersistenceConfiguration , ok := s .D .GetOkExists ("lb_cookie_session_persistence_configuration" ); ok {
525+ if tmpList := lbCookieSessionPersistenceConfiguration .([]interface {}); len (tmpList ) > 0 {
526+ fieldKeyFormat := fmt .Sprintf ("%s.%d.%%s" , "lb_cookie_session_persistence_configuration" , 0 )
527+ tmp , err := s .mapToLBCookieSessionPersistenceConfigurationDetails (fieldKeyFormat )
528+ if err != nil {
529+ return err
530+ }
531+ request .LbCookieSessionPersistenceConfiguration = & tmp
532+ }
533+ }
534+
462535 if loadBalancerId , ok := s .D .GetOkExists ("load_balancer_id" ); ok {
463536 tmp := loadBalancerId .(string )
464537 request .LoadBalancerId = & tmp
@@ -576,6 +649,12 @@ func (s *LoadBalancerBackendSetResourceCrud) SetData() error {
576649 s .D .Set ("health_checker" , nil )
577650 }
578651
652+ if s .Res .LbCookieSessionPersistenceConfiguration != nil {
653+ s .D .Set ("lb_cookie_session_persistence_configuration" , []interface {}{LBCookieSessionPersistenceConfigurationDetailsToMap (s .Res .LbCookieSessionPersistenceConfiguration )})
654+ } else {
655+ s .D .Set ("lb_cookie_session_persistence_configuration" , nil )
656+ }
657+
579658 if s .Res .Name != nil {
580659 s .D .Set ("name" , * s .Res .Name )
581660 }
@@ -773,6 +852,81 @@ func HealthCheckerToMap(obj *oci_load_balancer.HealthChecker) map[string]interfa
773852 return result
774853}
775854
855+ func (s * LoadBalancerBackendSetResourceCrud ) mapToLBCookieSessionPersistenceConfigurationDetails (fieldKeyFormat string ) (oci_load_balancer.LbCookieSessionPersistenceConfigurationDetails , error ) {
856+ result := oci_load_balancer.LbCookieSessionPersistenceConfigurationDetails {}
857+
858+ if cookieName , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "cookie_name" )); ok {
859+ tmp := cookieName .(string )
860+ result .CookieName = & tmp
861+ }
862+
863+ if disableFallback , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "disable_fallback" )); ok {
864+ tmp := disableFallback .(bool )
865+ result .DisableFallback = & tmp
866+ }
867+
868+ if domain , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "domain" )); ok {
869+ tmp := domain .(string )
870+ result .Domain = & tmp
871+ }
872+
873+ if isHttpOnly , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "is_http_only" )); ok {
874+ tmp := isHttpOnly .(bool )
875+ result .IsHttpOnly = & tmp
876+ }
877+
878+ if isSecure , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "is_secure" )); ok {
879+ tmp := isSecure .(bool )
880+ result .IsSecure = & tmp
881+ }
882+
883+ if maxAgeInSeconds , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "max_age_in_seconds" )); ok {
884+ tmp := maxAgeInSeconds .(int )
885+ result .MaxAgeInSeconds = & tmp
886+ }
887+
888+ if path , ok := s .D .GetOkExists (fmt .Sprintf (fieldKeyFormat , "path" )); ok {
889+ tmp := path .(string )
890+ result .Path = & tmp
891+ }
892+
893+ return result , nil
894+ }
895+
896+ func LBCookieSessionPersistenceConfigurationDetailsToMap (obj * oci_load_balancer.LbCookieSessionPersistenceConfigurationDetails ) map [string ]interface {} {
897+ result := map [string ]interface {}{}
898+
899+ if obj .CookieName != nil {
900+ result ["cookie_name" ] = string (* obj .CookieName )
901+ }
902+
903+ if obj .DisableFallback != nil {
904+ result ["disable_fallback" ] = bool (* obj .DisableFallback )
905+ }
906+
907+ if obj .Domain != nil {
908+ result ["domain" ] = string (* obj .Domain )
909+ }
910+
911+ if obj .IsHttpOnly != nil {
912+ result ["is_http_only" ] = bool (* obj .IsHttpOnly )
913+ }
914+
915+ if obj .IsSecure != nil {
916+ result ["is_secure" ] = bool (* obj .IsSecure )
917+ }
918+
919+ if obj .MaxAgeInSeconds != nil {
920+ result ["max_age_in_seconds" ] = int (* obj .MaxAgeInSeconds )
921+ }
922+
923+ if obj .Path != nil {
924+ result ["path" ] = string (* obj .Path )
925+ }
926+
927+ return result
928+ }
929+
776930func (s * LoadBalancerBackendSetResourceCrud ) mapToSSLConfigurationDetails (fieldKeyFormat string ) (oci_load_balancer.SslConfigurationDetails , error ) {
777931 result := oci_load_balancer.SslConfigurationDetails {}
778932
0 commit comments