{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-ec2-auto-scaling/json-schema/amazon-ec2-auto-scaling-put-scaling-policy-type-schema.json",
  "title": "PutScalingPolicyType",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-ec2-auto-scaling-operations-api-openapi.yml#/components/schemas/PutScalingPolicyType",
  "type": "object",
  "properties": {
    "AutoScalingGroupName": {
      "type": "string",
      "description": "The name of the Auto Scaling group."
    },
    "PolicyName": {
      "type": "string",
      "description": "The name of the policy."
    },
    "PolicyType": {
      "type": "string",
      "description": "One of the following policy types: TargetTrackingScaling StepScaling SimpleScaling (default) PredictiveScaling"
    },
    "AdjustmentType": {
      "type": "string",
      "description": "Specifies how the scaling adjustment is interpreted (for example, an absolute number or a percentage). The valid values are ChangeInCapacity, ExactCapacity, and PercentChangeInCapacity. Required if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User Guide."
    },
    "MinAdjustmentStep": {
      "type": "integer",
      "description": "Available for backward compatibility. Use MinAdjustmentMagnitude instead."
    },
    "MinAdjustmentMagnitude": {
      "type": "integer",
      "description": "The minimum value to scale by when the adjustment type is PercentChangeInCapacity. For example, suppose that you create a step scaling policy to scale out an Auto Scaling group by 25 percent and you specify a MinAdjustmentMagnitude of 2. If the group has 4 instances and the scaling policy is performed, 25 percent of 4 is 1. However, because you specified a MinAdjustmentMagnitude of 2, Amazon EC2 Auto Scaling scales out the group by 2 instances. Valid only if the policy type is StepScaling or SimpleScaling. For more information, see Scaling adjustment types in the Amazon EC2 Auto Scaling User G"
    },
    "ScalingAdjustment": {
      "type": "integer",
      "description": "The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value. Required if the policy type is SimpleScaling. (Not used with any other policy type.)"
    },
    "Cooldown": {
      "type": "integer",
      "description": "A cooldown period, in seconds, that applies to a specific simple scaling policy. When a cooldown period is specified here, it overrides the default cooldown. Valid only if the policy type is SimpleScaling. For more information, see Scaling cooldowns for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide. Default: None"
    },
    "MetricAggregationType": {
      "type": "string",
      "description": "The aggregation type for the CloudWatch metrics. The valid values are Minimum, Maximum, and Average. If the aggregation type is null, the value is treated as Average. Valid only if the policy type is StepScaling."
    },
    "StepAdjustments": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/StepAdjustment"
      },
      "description": "A set of adjustments that enable you to scale based on the size of the alarm breach. Required if the policy type is StepScaling. (Not used with any other policy type.)"
    },
    "EstimatedInstanceWarmup": {
      "type": "integer",
      "description": "Not needed if the default instance warmup is defined for the group. The estimated time, in seconds, until a newly launched instance can contribute to the CloudWatch metrics. This warm-up period applies to instances launched due to a specific target tracking or step scaling policy. When a warm-up period is specified here, it overrides the default instance warmup. Valid only if the policy type is TargetTrackingScaling or StepScaling. The default is to use the value for the default instance warmup defined for the group. If default instance warmup is null, then EstimatedInstanceWarmup falls back t"
    },
    "TargetTrackingConfiguration": {
      "$ref": "#/$defs/TargetTrackingConfiguration"
    },
    "Enabled": {
      "type": "boolean",
      "description": "Indicates whether the scaling policy is enabled or disabled. The default is enabled. For more information, see Disable a scaling policy for an Auto Scaling group in the Amazon EC2 Auto Scaling User Guide."
    },
    "PredictiveScalingConfiguration": {
      "$ref": "#/$defs/PredictiveScalingConfiguration"
    }
  },
  "required": [
    "AutoScalingGroupName",
    "PolicyName"
  ],
  "$defs": {
    "CustomizedMetricSpecification": {
      "type": "object",
      "properties": {
        "MetricName": {
          "type": "string",
          "description": "The name of the metric. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics."
        },
        "Namespace": {
          "type": "string",
          "description": "The namespace of the metric."
        },
        "Dimensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricDimension"
          },
          "description": "The dimensions of the metric. Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy."
        },
        "Statistic": {
          "type": "string",
          "enum": [
            "Average",
            "Minimum",
            "Maximum",
            "SampleCount",
            "Sum"
          ],
          "description": "The statistic of the metric."
        },
        "Unit": {
          "type": "string",
          "description": "The unit of the metric. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference."
        },
        "Period": {
          "type": "integer",
          "description": "The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see Create a target tracking policy using high-resolution metrics for faster response."
        },
        "Metrics": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TargetTrackingMetricDataQuery"
          },
          "description": "The metrics to include in the target tracking scaling policy, as a metric data query. This can include both raw metric and metric math expressions."
        }
      }
    },
    "Metric": {
      "type": "object",
      "properties": {
        "Namespace": {
          "type": "string",
          "description": "The namespace of the metric. For more information, see the table in Amazon Web Services services that publish CloudWatch metrics in the Amazon CloudWatch User Guide."
        },
        "MetricName": {
          "type": "string",
          "description": "The name of the metric."
        },
        "Dimensions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricDimension"
          },
          "description": "The dimensions for the metric. For the list of available dimensions, see the Amazon Web Services documentation available from the table in Amazon Web Services services that publish CloudWatch metrics in the Amazon CloudWatch User Guide. Conditional: If you published your metric with dimensions, you must specify the same dimensions in your scaling policy."
        }
      },
      "required": [
        "Namespace",
        "MetricName"
      ]
    },
    "MetricDataQuery": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string",
          "description": "A short name that identifies the object's results in the response. This name must be unique among all MetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter."
        },
        "Expression": {
          "type": "string",
          "description": "The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat, but not both."
        },
        "MetricStat": {
          "$ref": "#/$defs/MetricStat"
        },
        "Label": {
          "type": "string",
          "description": "A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents."
        },
        "ReturnData": {
          "type": "boolean",
          "description": "Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification. If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData. This sets it to its default (true)."
        }
      },
      "required": [
        "Id"
      ]
    },
    "MetricDimension": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The name of the dimension."
        },
        "Value": {
          "type": "string",
          "description": "The value of the dimension."
        }
      },
      "required": [
        "Name",
        "Value"
      ]
    },
    "MetricStat": {
      "type": "object",
      "properties": {
        "Metric": {
          "$ref": "#/$defs/Metric"
        },
        "Stat": {
          "type": "string",
          "description": "The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide. The most commonly used metrics for predictive scaling are Average and Sum."
        },
        "Unit": {
          "type": "string",
          "description": "The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference."
        }
      },
      "required": [
        "Metric",
        "Stat"
      ]
    },
    "PredefinedMetricSpecification": {
      "type": "object",
      "properties": {
        "PredefinedMetricType": {
          "type": "string",
          "enum": [
            "ASGAverageCPUUtilization",
            "ASGAverageNetworkIn",
            "ASGAverageNetworkOut",
            "ALBRequestCountPerTarget"
          ],
          "description": "The metric type. The following predefined metrics are available: ASGAverageCPUUtilization - Average CPU utilization of the Auto Scaling group. ASGAverageNetworkIn - Average number of bytes received on all network interfaces by the Auto Scaling group. ASGAverageNetworkOut - Average number of bytes sent out on all network interfaces by the Auto Scaling group. ALBRequestCountPerTarget - Average Application Load Balancer request count per target for your Auto Scaling group."
        },
        "ResourceLabel": {
          "type": "string",
          "description": "A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is: app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff. Where: app// is the final portio"
        }
      },
      "required": [
        "PredefinedMetricType"
      ]
    },
    "PredictiveScalingConfiguration": {
      "type": "object",
      "properties": {
        "MetricSpecifications": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/PredictiveScalingMetricSpecification"
          },
          "description": "This structure includes the metrics and target utilization to use for predictive scaling. This is an array, but we currently only support a single metric specification. That is, you can specify a target value and a single metric pair, or a target value and one scaling metric and one load metric."
        },
        "Mode": {
          "type": "string",
          "enum": [
            "ForecastAndScale",
            "ForecastOnly"
          ],
          "description": "The predictive scaling mode. Defaults to ForecastOnly if not specified."
        },
        "SchedulingBufferTime": {
          "type": "integer",
          "description": "The amount of time, in seconds, by which the instance launch time can be advanced. For example, the forecast says to add capacity at 10:00 AM, and you choose to pre-launch instances by 5 minutes. In that case, the instances will be launched at 9:55 AM. The intention is to give resources time to be provisioned. It can take a few minutes to launch an EC2 instance. The actual amount of time required depends on several factors, such as the size of the instance and whether there are startup scripts to complete. The value must be less than the forecast interval duration of 3600 seconds (60 minutes)."
        },
        "MaxCapacityBreachBehavior": {
          "type": "string",
          "enum": [
            "HonorMaxCapacity",
            "IncreaseMaxCapacity"
          ],
          "description": "Defines the behavior that should be applied if the forecast capacity approaches or exceeds the maximum capacity of the Auto Scaling group. Defaults to HonorMaxCapacity if not specified. The following are possible values: HonorMaxCapacity - Amazon EC2 Auto Scaling can't increase the maximum capacity of the group when the forecast capacity is close to or exceeds the maximum capacity. IncreaseMaxCapacity - Amazon EC2 Auto Scaling can increase the maximum capacity of the group when the forecast capacity is close to or exceeds the maximum capacity. The upper limit is determined by the forecasted ca"
        },
        "MaxCapacityBuffer": {
          "type": "integer",
          "description": "The size of the capacity buffer to use when the forecast capacity is close to or exceeds the maximum capacity. The value is specified as a percentage relative to the forecast capacity. For example, if the buffer is 10, this means a 10 percent buffer, such that if the forecast capacity is 50, and the maximum capacity is 40, then the effective maximum capacity is 55. If set to 0, Amazon EC2 Auto Scaling may scale capacity higher than the maximum capacity to equal but not exceed forecast capacity. Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity, and cannot be used"
        }
      },
      "required": [
        "MetricSpecifications"
      ]
    },
    "PredictiveScalingCustomizedCapacityMetric": {
      "type": "object",
      "properties": {
        "MetricDataQueries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricDataQuery"
          },
          "description": "One or more metric data queries to provide the data points for a capacity metric. Use multiple metric data queries only if you are performing a math expression on returned data."
        }
      },
      "required": [
        "MetricDataQueries"
      ]
    },
    "PredictiveScalingCustomizedLoadMetric": {
      "type": "object",
      "properties": {
        "MetricDataQueries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricDataQuery"
          },
          "description": "One or more metric data queries to provide the data points for a load metric. Use multiple metric data queries only if you are performing a math expression on returned data."
        }
      },
      "required": [
        "MetricDataQueries"
      ]
    },
    "PredictiveScalingCustomizedScalingMetric": {
      "type": "object",
      "properties": {
        "MetricDataQueries": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetricDataQuery"
          },
          "description": "One or more metric data queries to provide the data points for a scaling metric. Use multiple metric data queries only if you are performing a math expression on returned data."
        }
      },
      "required": [
        "MetricDataQueries"
      ]
    },
    "PredictiveScalingMetricSpecification": {
      "type": "object",
      "properties": {
        "TargetValue": {
          "type": "number",
          "description": "Specifies the target utilization. Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval."
        },
        "PredefinedMetricPairSpecification": {
          "$ref": "#/$defs/PredictiveScalingPredefinedMetricPair"
        },
        "PredefinedScalingMetricSpecification": {
          "$ref": "#/$defs/PredictiveScalingPredefinedScalingMetric"
        },
        "PredefinedLoadMetricSpecification": {
          "$ref": "#/$defs/PredictiveScalingPredefinedLoadMetric"
        },
        "CustomizedScalingMetricSpecification": {
          "$ref": "#/$defs/PredictiveScalingCustomizedScalingMetric"
        },
        "CustomizedLoadMetricSpecification": {
          "$ref": "#/$defs/PredictiveScalingCustomizedLoadMetric"
        },
        "CustomizedCapacityMetricSpecification": {
          "$ref": "#/$defs/PredictiveScalingCustomizedCapacityMetric"
        }
      },
      "required": [
        "TargetValue"
      ]
    },
    "PredictiveScalingPredefinedLoadMetric": {
      "type": "object",
      "properties": {
        "PredefinedMetricType": {
          "type": "string",
          "enum": [
            "ASGTotalCPUUtilization",
            "ASGTotalNetworkIn",
            "ASGTotalNetworkOut",
            "ALBTargetGroupRequestCount"
          ],
          "description": "The metric type."
        },
        "ResourceLabel": {
          "type": "string",
          "description": "A label that uniquely identifies a specific Application Load Balancer target group from which to determine the request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is: app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff. Where: app// is the final portion of the"
        }
      },
      "required": [
        "PredefinedMetricType"
      ]
    },
    "PredictiveScalingPredefinedMetricPair": {
      "type": "object",
      "properties": {
        "PredefinedMetricType": {
          "type": "string",
          "enum": [
            "ASGCPUUtilization",
            "ASGNetworkIn",
            "ASGNetworkOut",
            "ALBRequestCount"
          ],
          "description": "Indicates which metrics to use. There are two different types of metrics for each metric type: one is a load metric and one is a scaling metric. For example, if the metric type is ASGCPUUtilization, the Auto Scaling group's total CPU metric is used as the load metric, and the average CPU metric is used for the scaling metric."
        },
        "ResourceLabel": {
          "type": "string",
          "description": "A label that uniquely identifies a specific Application Load Balancer target group from which to determine the total and average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is: app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff. Where: app// is the fi"
        }
      },
      "required": [
        "PredefinedMetricType"
      ]
    },
    "PredictiveScalingPredefinedScalingMetric": {
      "type": "object",
      "properties": {
        "PredefinedMetricType": {
          "type": "string",
          "enum": [
            "ASGAverageCPUUtilization",
            "ASGAverageNetworkIn",
            "ASGAverageNetworkOut",
            "ALBRequestCountPerTarget"
          ],
          "description": "The metric type."
        },
        "ResourceLabel": {
          "type": "string",
          "description": "A label that uniquely identifies a specific Application Load Balancer target group from which to determine the average request count served by your Auto Scaling group. You can't specify a resource label unless the target group is attached to the Auto Scaling group. You create the resource label by appending the final portion of the load balancer ARN and the final portion of the target group ARN into a single value, separated by a forward slash (/). The format of the resource label is: app/my-alb/778d41231b141a0f/targetgroup/my-alb-target-group/943f017f100becff. Where: app// is the final portio"
        }
      },
      "required": [
        "PredefinedMetricType"
      ]
    },
    "StepAdjustment": {
      "type": "object",
      "properties": {
        "MetricIntervalLowerBound": {
          "type": "number",
          "description": "The lower bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the lower bound is inclusive (the metric must be greater than or equal to the threshold plus the lower bound). Otherwise, it is exclusive (the metric must be greater than the threshold plus the lower bound). A null value indicates negative infinity."
        },
        "MetricIntervalUpperBound": {
          "type": "number",
          "description": "The upper bound for the difference between the alarm threshold and the CloudWatch metric. If the metric value is above the breach threshold, the upper bound is exclusive (the metric must be less than the threshold plus the upper bound). Otherwise, it is inclusive (the metric must be less than or equal to the threshold plus the upper bound). A null value indicates positive infinity. The upper bound must be greater than the lower bound."
        },
        "ScalingAdjustment": {
          "type": "integer",
          "description": "The amount by which to scale, based on the specified adjustment type. A positive value adds to the current capacity while a negative number removes from the current capacity. For exact capacity, you must specify a non-negative value."
        }
      },
      "required": [
        "ScalingAdjustment"
      ]
    },
    "TargetTrackingConfiguration": {
      "type": "object",
      "properties": {
        "PredefinedMetricSpecification": {
          "$ref": "#/$defs/PredefinedMetricSpecification"
        },
        "CustomizedMetricSpecification": {
          "$ref": "#/$defs/CustomizedMetricSpecification"
        },
        "TargetValue": {
          "type": "number",
          "description": "The target value for the metric. Some metrics are based on a count instead of a percentage, such as the request count for an Application Load Balancer or the number of messages in an SQS queue. If the scaling policy specifies one of these metrics, specify the target utilization as the optimal average request or message count per instance during any one-minute interval."
        },
        "DisableScaleIn": {
          "type": "boolean",
          "description": "Indicates whether scaling in by the target tracking scaling policy is disabled. If scaling in is disabled, the target tracking scaling policy doesn't remove instances from the Auto Scaling group. Otherwise, the target tracking scaling policy can remove instances from the Auto Scaling group. The default is false."
        }
      },
      "required": [
        "TargetValue"
      ]
    },
    "TargetTrackingMetricDataQuery": {
      "type": "object",
      "properties": {
        "Id": {
          "type": "string",
          "description": "A short name that identifies the object's results in the response. This name must be unique among all TargetTrackingMetricDataQuery objects specified for a single scaling policy. If you are performing math expressions on this set of data, this name represents that data and can serve as a variable in the mathematical expression. The valid characters are letters, numbers, and underscores. The first character must be a lowercase letter."
        },
        "Expression": {
          "type": "string",
          "description": "The math expression to perform on the returned data, if this object is performing a math expression. This expression can use the Id of the other metrics to refer to those metrics, and can also use the Id of other expressions to use the result of those expressions. Conditional: Within each TargetTrackingMetricDataQuery object, you must specify either Expression or MetricStat, but not both."
        },
        "MetricStat": {
          "$ref": "#/$defs/TargetTrackingMetricStat"
        },
        "Label": {
          "type": "string",
          "description": "A human-readable label for this metric or expression. This is especially useful if this is a math expression, so that you know what the value represents."
        },
        "Period": {
          "type": "integer",
          "description": "The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see Create a target tracking policy using high-resolution metrics for faster response."
        },
        "ReturnData": {
          "type": "boolean",
          "description": "Indicates whether to return the timestamps and raw data values of this metric. If you use any math expressions, specify true for this value for only the final math expression that the metric specification is based on. You must specify false for ReturnData for all the other metrics and expressions used in the metric specification. If you are only retrieving metrics and not performing any math expressions, do not specify anything for ReturnData. This sets it to its default (true)."
        }
      },
      "required": [
        "Id"
      ]
    },
    "TargetTrackingMetricStat": {
      "type": "object",
      "properties": {
        "Metric": {
          "$ref": "#/$defs/Metric"
        },
        "Stat": {
          "type": "string",
          "description": "The statistic to return. It can include any CloudWatch statistic or extended statistic. For a list of valid values, see the table in Statistics in the Amazon CloudWatch User Guide. The most commonly used metric for scaling is Average."
        },
        "Unit": {
          "type": "string",
          "description": "The unit to use for the returned data points. For a complete list of the units that CloudWatch supports, see the MetricDatum data type in the Amazon CloudWatch API Reference."
        },
        "Period": {
          "type": "integer",
          "description": "The period of the metric in seconds. The default value is 60. Accepted values are 10, 30, and 60. For high resolution metric, set the value to less than 60. For more information, see Create a target tracking policy using high-resolution metrics for faster response."
        }
      },
      "required": [
        "Metric",
        "Stat"
      ]
    }
  }
}