@@ -325,13 +325,56 @@ There must be at least one IP address available in the subnet's primary range. T
325325 MaxItems : 1 ,
326326 Elem : & schema.Resource {
327327 Schema : map [string ]* schema.Schema {
328+ "autoscaling_config" : {
329+ Type : schema .TypeList ,
330+ Optional : true ,
331+ Description : `Represents the autoscaling configuration of a metastore service.` ,
332+ MaxItems : 1 ,
333+ Elem : & schema.Resource {
334+ Schema : map [string ]* schema.Schema {
335+ "autoscaling_enabled" : {
336+ Type : schema .TypeBool ,
337+ Optional : true ,
338+ Description : `Defines whether autoscaling is enabled. The default value is false.` ,
339+ },
340+ "limit_config" : {
341+ Type : schema .TypeList ,
342+ Computed : true ,
343+ Optional : true ,
344+ Description : `Represents the limit configuration of a metastore service.` ,
345+ MaxItems : 1 ,
346+ Elem : & schema.Resource {
347+ Schema : map [string ]* schema.Schema {
348+ "max_scaling_factor" : {
349+ Type : schema .TypeFloat ,
350+ Computed : true ,
351+ Optional : true ,
352+ Description : `The maximum scaling factor that the service will autoscale to. The default value is 6.0.` ,
353+ },
354+ "min_scaling_factor" : {
355+ Type : schema .TypeFloat ,
356+ Computed : true ,
357+ Optional : true ,
358+ Description : `The minimum scaling factor that the service will autoscale to. The default value is 0.1.` ,
359+ },
360+ },
361+ },
362+ },
363+ "autoscaling_factor" : {
364+ Type : schema .TypeFloat ,
365+ Computed : true ,
366+ Description : `Output only. The scaling factor of a service with autoscaling enabled.` ,
367+ },
368+ },
369+ },
370+ },
328371 "instance_size" : {
329372 Type : schema .TypeString ,
330373 Optional : true ,
331374 ValidateFunc : verify .ValidateEnum ([]string {"EXTRA_SMALL" , "SMALL" , "MEDIUM" , "LARGE" , "EXTRA_LARGE" , "" }),
332375 Description : `Metastore instance sizes. Possible values: ["EXTRA_SMALL", "SMALL", "MEDIUM", "LARGE", "EXTRA_LARGE"]` ,
333376 ConflictsWith : []string {"tier" },
334- ExactlyOneOf : []string {"scaling_config.0.instance_size" , "scaling_config.0.scaling_factor" },
377+ ExactlyOneOf : []string {"scaling_config.0.instance_size" , "scaling_config.0.scaling_factor" , "scaling_config.0.autoscaling_config" },
335378 },
336379 "scaling_factor" : {
337380 Type : schema .TypeFloat ,
@@ -1074,6 +1117,8 @@ func flattenDataprocMetastoreServiceScalingConfig(v interface{}, d *schema.Resou
10741117 flattenDataprocMetastoreServiceScalingConfigInstanceSize (original ["instanceSize" ], d , config )
10751118 transformed ["scaling_factor" ] =
10761119 flattenDataprocMetastoreServiceScalingConfigScalingFactor (original ["scalingFactor" ], d , config )
1120+ transformed ["autoscaling_config" ] =
1121+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfig (original ["autoscalingConfig" ], d , config )
10771122 return []interface {}{transformed }
10781123}
10791124func flattenDataprocMetastoreServiceScalingConfigInstanceSize (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
@@ -1084,6 +1129,54 @@ func flattenDataprocMetastoreServiceScalingConfigScalingFactor(v interface{}, d
10841129 return v
10851130}
10861131
1132+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1133+ if v == nil {
1134+ return nil
1135+ }
1136+ original := v .(map [string ]interface {})
1137+ if len (original ) == 0 {
1138+ return nil
1139+ }
1140+ transformed := make (map [string ]interface {})
1141+ transformed ["autoscaling_enabled" ] =
1142+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingEnabled (original ["autoscalingEnabled" ], d , config )
1143+ transformed ["autoscaling_factor" ] =
1144+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingFactor (original ["autoscalingFactor" ], d , config )
1145+ transformed ["limit_config" ] =
1146+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfig (original ["limitConfig" ], d , config )
1147+ return []interface {}{transformed }
1148+ }
1149+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingEnabled (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1150+ return v
1151+ }
1152+
1153+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingFactor (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1154+ return v
1155+ }
1156+
1157+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfig (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1158+ if v == nil {
1159+ return nil
1160+ }
1161+ original := v .(map [string ]interface {})
1162+ if len (original ) == 0 {
1163+ return nil
1164+ }
1165+ transformed := make (map [string ]interface {})
1166+ transformed ["min_scaling_factor" ] =
1167+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMinScalingFactor (original ["minScalingFactor" ], d , config )
1168+ transformed ["max_scaling_factor" ] =
1169+ flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMaxScalingFactor (original ["maxScalingFactor" ], d , config )
1170+ return []interface {}{transformed }
1171+ }
1172+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMinScalingFactor (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1173+ return v
1174+ }
1175+
1176+ func flattenDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMaxScalingFactor (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
1177+ return v
1178+ }
1179+
10871180func flattenDataprocMetastoreServiceScheduledBackup (v interface {}, d * schema.ResourceData , config * transport_tpg.Config ) interface {} {
10881181 if v == nil {
10891182 return nil
@@ -1428,6 +1521,13 @@ func expandDataprocMetastoreServiceScalingConfig(v interface{}, d tpgresource.Te
14281521 transformed ["scalingFactor" ] = transformedScalingFactor
14291522 }
14301523
1524+ transformedAutoscalingConfig , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfig (original ["autoscaling_config" ], d , config )
1525+ if err != nil {
1526+ return nil , err
1527+ } else if val := reflect .ValueOf (transformedAutoscalingConfig ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1528+ transformed ["autoscalingConfig" ] = transformedAutoscalingConfig
1529+ }
1530+
14311531 return transformed , nil
14321532}
14331533
@@ -1439,6 +1539,81 @@ func expandDataprocMetastoreServiceScalingConfigScalingFactor(v interface{}, d t
14391539 return v , nil
14401540}
14411541
1542+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1543+ l := v .([]interface {})
1544+ if len (l ) == 0 || l [0 ] == nil {
1545+ return nil , nil
1546+ }
1547+ raw := l [0 ]
1548+ original := raw .(map [string ]interface {})
1549+ transformed := make (map [string ]interface {})
1550+
1551+ transformedAutoscalingEnabled , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingEnabled (original ["autoscaling_enabled" ], d , config )
1552+ if err != nil {
1553+ return nil , err
1554+ } else if val := reflect .ValueOf (transformedAutoscalingEnabled ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1555+ transformed ["autoscalingEnabled" ] = transformedAutoscalingEnabled
1556+ }
1557+
1558+ transformedAutoscalingFactor , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingFactor (original ["autoscaling_factor" ], d , config )
1559+ if err != nil {
1560+ return nil , err
1561+ } else if val := reflect .ValueOf (transformedAutoscalingFactor ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1562+ transformed ["autoscalingFactor" ] = transformedAutoscalingFactor
1563+ }
1564+
1565+ transformedLimitConfig , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfig (original ["limit_config" ], d , config )
1566+ if err != nil {
1567+ return nil , err
1568+ } else if val := reflect .ValueOf (transformedLimitConfig ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1569+ transformed ["limitConfig" ] = transformedLimitConfig
1570+ }
1571+
1572+ return transformed , nil
1573+ }
1574+
1575+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingEnabled (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1576+ return v , nil
1577+ }
1578+
1579+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfigAutoscalingFactor (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1580+ return v , nil
1581+ }
1582+
1583+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfig (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1584+ l := v .([]interface {})
1585+ if len (l ) == 0 || l [0 ] == nil {
1586+ return nil , nil
1587+ }
1588+ raw := l [0 ]
1589+ original := raw .(map [string ]interface {})
1590+ transformed := make (map [string ]interface {})
1591+
1592+ transformedMinScalingFactor , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMinScalingFactor (original ["min_scaling_factor" ], d , config )
1593+ if err != nil {
1594+ return nil , err
1595+ } else if val := reflect .ValueOf (transformedMinScalingFactor ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1596+ transformed ["minScalingFactor" ] = transformedMinScalingFactor
1597+ }
1598+
1599+ transformedMaxScalingFactor , err := expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMaxScalingFactor (original ["max_scaling_factor" ], d , config )
1600+ if err != nil {
1601+ return nil , err
1602+ } else if val := reflect .ValueOf (transformedMaxScalingFactor ); val .IsValid () && ! tpgresource .IsEmptyValue (val ) {
1603+ transformed ["maxScalingFactor" ] = transformedMaxScalingFactor
1604+ }
1605+
1606+ return transformed , nil
1607+ }
1608+
1609+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMinScalingFactor (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1610+ return v , nil
1611+ }
1612+
1613+ func expandDataprocMetastoreServiceScalingConfigAutoscalingConfigLimitConfigMaxScalingFactor (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
1614+ return v , nil
1615+ }
1616+
14421617func expandDataprocMetastoreServiceScheduledBackup (v interface {}, d tpgresource.TerraformResourceData , config * transport_tpg.Config ) (interface {}, error ) {
14431618 l := v .([]interface {})
14441619 if len (l ) == 0 || l [0 ] == nil {
0 commit comments