diff --git a/mmv1/products/compute/api.yaml b/mmv1/products/compute/api.yaml index cb59b7638737..bc7d9862063f 100644 --- a/mmv1/products/compute/api.yaml +++ b/mmv1/products/compute/api.yaml @@ -388,6 +388,16 @@ objects: scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + - !ruby/object:Api::Type::String + name: 'predictiveMethod' + min_version: beta + default_value: NONE + description: | + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + + - NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. + + - OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. - !ruby/object:Api::Type::Array name: 'customMetricUtilizations' description: | @@ -9661,6 +9671,16 @@ objects: scales up until it reaches the maximum number of instances you specified or until the average utilization reaches the target utilization. + - !ruby/object:Api::Type::String + name: 'predictiveMethod' + min_version: beta + default_value: NONE + description: | + Indicates whether predictive autoscaling based on CPU metric is enabled. Valid values are: + + - NONE (default). No predictive method is used. The autoscaler scales the group to meet current demand based on real-time metrics. + + - OPTIMIZE_AVAILABILITY. Predictive autoscaling improves availability by monitoring daily and weekly load patterns and scaling out ahead of anticipated demand. - !ruby/object:Api::Type::Array name: 'customMetricUtilizations' description: | diff --git a/mmv1/products/compute/terraform.yaml b/mmv1/products/compute/terraform.yaml index 5492d625078c..a7d370e8b0b5 100644 --- a/mmv1/products/compute/terraform.yaml +++ b/mmv1/products/compute/terraform.yaml @@ -121,6 +121,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides autoscalingPolicy.cpuUtilization.utilizationTarget: !ruby/object:Overrides::Terraform::PropertyOverride name: target required: true # See comment for minReplicas + autoscalingPolicy.cpuUtilization.predictiveMethod: !ruby/object:Overrides::Terraform::PropertyOverride + custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb' autoscalingPolicy.customMetricUtilizations: !ruby/object:Overrides::Terraform::PropertyOverride name: metric autoscalingPolicy.customMetricUtilizations.metric: !ruby/object:Overrides::Terraform::PropertyOverride @@ -1693,6 +1695,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides autoscalingPolicy.cpuUtilization.utilizationTarget: !ruby/object:Overrides::Terraform::PropertyOverride name: target required: true # See comment for minReplicas + autoscalingPolicy.cpuUtilization.predictiveMethod: !ruby/object:Overrides::Terraform::PropertyOverride + custom_flatten: 'templates/terraform/custom_flatten/default_if_empty.erb' autoscalingPolicy.customMetricUtilizations: !ruby/object:Overrides::Terraform::PropertyOverride name: metric autoscalingPolicy.customMetricUtilizations.metric: !ruby/object:Overrides::Terraform::PropertyOverride diff --git a/mmv1/third_party/terraform/tests/resource_compute_autoscaler_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_autoscaler_test.go.erb index 8bed87ce79a4..9d4ba4c165f6 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_autoscaler_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_autoscaler_test.go.erb @@ -307,6 +307,7 @@ resource "google_compute_autoscaler" "foobar" { cooldown_period = 60 cpu_utilization { target = 0.5 + predictive_method = "OPTIMIZE_AVAILABILITY" } scale_down_control { max_scaled_down_replicas { diff --git a/mmv1/third_party/terraform/tests/resource_compute_region_autoscaler_test.go.erb b/mmv1/third_party/terraform/tests/resource_compute_region_autoscaler_test.go.erb index 3bb4ee674aa1..e999b7e0106d 100644 --- a/mmv1/third_party/terraform/tests/resource_compute_region_autoscaler_test.go.erb +++ b/mmv1/third_party/terraform/tests/resource_compute_region_autoscaler_test.go.erb @@ -222,6 +222,7 @@ resource "google_compute_region_autoscaler" "foobar" { cooldown_period = 60 cpu_utilization { target = 0.5 + predictive_method = "OPTIMIZE_AVAILABILITY" } scale_down_control { max_scaled_down_replicas {