{
 "additionalProperties": false,
 "createOnlyProperties": [
  "/properties/PolicyName",
  "/properties/ServiceNamespace",
  "/properties/ResourceId",
  "/properties/ScalableDimension",
  "/properties/ScalingTargetId"
 ],
 "definitions": {
  "CustomizedMetricSpecification": {
   "additionalProperties": false,
   "properties": {
    "Dimensions": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/MetricDimension"
     },
     "type": "array",
     "uniqueItems": false
    },
    "MetricName": {
     "type": "string"
    },
    "Metrics": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/TargetTrackingMetricDataQuery"
     },
     "type": "array",
     "uniqueItems": false
    },
    "Namespace": {
     "type": "string"
    },
    "Statistic": {
     "enum": [
      "Average",
      "Maximum",
      "Minimum",
      "SampleCount",
      "Sum"
     ],
     "type": "string"
    },
    "Unit": {
     "type": "string"
    }
   },
   "type": "object"
  },
  "MetricDimension": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "type": "string"
    },
    "Value": {
     "type": "string"
    }
   },
   "required": [
    "Value",
    "Name"
   ],
   "type": "object"
  },
  "PredefinedMetricSpecification": {
   "additionalProperties": false,
   "properties": {
    "PredefinedMetricType": {
     "enum": [
      "ALBRequestCountPerTarget",
      "AppStreamAverageCapacityUtilization",
      "CassandraReadCapacityUtilization",
      "CassandraWriteCapacityUtilization",
      "ComprehendInferenceUtilization",
      "DynamoDBReadCapacityUtilization",
      "DynamoDBWriteCapacityUtilization",
      "EC2SpotFleetRequestAverageCPUUtilization",
      "EC2SpotFleetRequestAverageNetworkIn",
      "EC2SpotFleetRequestAverageNetworkOut",
      "ECSServiceAverageCPUUtilization",
      "ECSServiceAverageMemoryUtilization",
      "ElastiCacheDatabaseCapacityUsageCountedForEvictPercentage",
      "ElastiCacheDatabaseMemoryUsageCountedForEvictPercentage",
      "ElastiCacheDatabaseMemoryUsagePercentage",
      "ElastiCacheEngineCPUUtilization",
      "ElastiCachePrimaryEngineCPUUtilization",
      "ElastiCacheReplicaEngineCPUUtilization",
      "KafkaBrokerStorageUtilization",
      "LambdaProvisionedConcurrencyUtilization",
      "NeptuneReaderAverageCPUUtilization",
      "RDSReaderAverageCPUUtilization",
      "RDSReaderAverageDatabaseConnections",
      "SageMakerInferenceComponentConcurrentRequestsPerCopyHighResolution",
      "SageMakerInferenceComponentInvocationsPerCopy",
      "SageMakerVariantConcurrentRequestsPerModelHighResolution",
      "SageMakerVariantInvocationsPerInstance",
      "SageMakerVariantProvisionedConcurrencyUtilization",
      "WorkSpacesAverageUserSessionsCapacityUtilization"
     ],
     "type": "string"
    },
    "ResourceLabel": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "PredefinedMetricType"
   ],
   "type": "object"
  },
  "PredictiveScalingCustomizedCapacityMetric": {
   "additionalProperties": false,
   "properties": {
    "MetricDataQueries": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/PredictiveScalingMetricDataQuery"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "MetricDataQueries"
   ],
   "type": "object"
  },
  "PredictiveScalingCustomizedLoadMetric": {
   "additionalProperties": false,
   "properties": {
    "MetricDataQueries": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/PredictiveScalingMetricDataQuery"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "MetricDataQueries"
   ],
   "type": "object"
  },
  "PredictiveScalingCustomizedScalingMetric": {
   "additionalProperties": false,
   "properties": {
    "MetricDataQueries": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/PredictiveScalingMetricDataQuery"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "required": [
    "MetricDataQueries"
   ],
   "type": "object"
  },
  "PredictiveScalingMetric": {
   "additionalProperties": false,
   "properties": {
    "Dimensions": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/PredictiveScalingMetricDimension"
     },
     "type": "array",
     "uniqueItems": false
    },
    "MetricName": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Namespace": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "PredictiveScalingMetricDataQuery": {
   "additionalProperties": false,
   "properties": {
    "Expression": {
     "maxLength": 2048,
     "minLength": 1,
     "type": "string"
    },
    "Id": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Label": {
     "type": "string"
    },
    "MetricStat": {
     "$ref": "#/definitions/PredictiveScalingMetricStat"
    },
    "ReturnData": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "PredictiveScalingMetricDimension": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "PredictiveScalingMetricSpecification": {
   "additionalProperties": false,
   "properties": {
    "CustomizedCapacityMetricSpecification": {
     "$ref": "#/definitions/PredictiveScalingCustomizedCapacityMetric"
    },
    "CustomizedLoadMetricSpecification": {
     "$ref": "#/definitions/PredictiveScalingCustomizedLoadMetric"
    },
    "CustomizedScalingMetricSpecification": {
     "$ref": "#/definitions/PredictiveScalingCustomizedScalingMetric"
    },
    "PredefinedLoadMetricSpecification": {
     "$ref": "#/definitions/PredictiveScalingPredefinedLoadMetric"
    },
    "PredefinedMetricPairSpecification": {
     "$ref": "#/definitions/PredictiveScalingPredefinedMetricPair"
    },
    "PredefinedScalingMetricSpecification": {
     "$ref": "#/definitions/PredictiveScalingPredefinedScalingMetric"
    },
    "TargetValue": {
     "type": "number"
    }
   },
   "required": [
    "TargetValue"
   ],
   "type": "object"
  },
  "PredictiveScalingMetricStat": {
   "additionalProperties": false,
   "properties": {
    "Metric": {
     "$ref": "#/definitions/PredictiveScalingMetric"
    },
    "Stat": {
     "type": "string"
    },
    "Unit": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "PredictiveScalingPolicyConfiguration": {
   "additionalProperties": false,
   "properties": {
    "MaxCapacityBreachBehavior": {
     "enum": [
      "HonorMaxCapacity",
      "IncreaseMaxCapacity"
     ],
     "type": "string"
    },
    "MaxCapacityBuffer": {
     "maximum": 100,
     "minimum": 0,
     "type": "integer"
    },
    "MetricSpecifications": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/PredictiveScalingMetricSpecification"
     },
     "type": "array",
     "uniqueItems": true
    },
    "Mode": {
     "enum": [
      "ForecastAndScale",
      "ForecastOnly"
     ],
     "type": "string"
    },
    "SchedulingBufferTime": {
     "maximum": 3600,
     "minimum": 0,
     "type": "integer"
    }
   },
   "required": [
    "MetricSpecifications"
   ],
   "type": "object"
  },
  "PredictiveScalingPredefinedLoadMetric": {
   "additionalProperties": false,
   "properties": {
    "PredefinedMetricType": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "ResourceLabel": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "PredefinedMetricType"
   ],
   "type": "object"
  },
  "PredictiveScalingPredefinedMetricPair": {
   "additionalProperties": false,
   "properties": {
    "PredefinedMetricType": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "ResourceLabel": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "PredefinedMetricType"
   ],
   "type": "object"
  },
  "PredictiveScalingPredefinedScalingMetric": {
   "additionalProperties": false,
   "properties": {
    "PredefinedMetricType": {
     "maxLength": 128,
     "minLength": 1,
     "type": "string"
    },
    "ResourceLabel": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "required": [
    "PredefinedMetricType"
   ],
   "type": "object"
  },
  "StepAdjustment": {
   "additionalProperties": false,
   "properties": {
    "MetricIntervalLowerBound": {
     "type": "number"
    },
    "MetricIntervalUpperBound": {
     "type": "number"
    },
    "ScalingAdjustment": {
     "type": "integer"
    }
   },
   "required": [
    "ScalingAdjustment"
   ],
   "type": "object"
  },
  "StepScalingPolicyConfiguration": {
   "additionalProperties": false,
   "properties": {
    "AdjustmentType": {
     "enum": [
      "ChangeInCapacity",
      "ExactCapacity",
      "PercentChangeInCapacity"
     ],
     "type": "string"
    },
    "Cooldown": {
     "type": "integer"
    },
    "MetricAggregationType": {
     "enum": [
      "Average",
      "Maximum",
      "Minimum"
     ],
     "type": "string"
    },
    "MinAdjustmentMagnitude": {
     "type": "integer"
    },
    "StepAdjustments": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/StepAdjustment"
     },
     "type": "array",
     "uniqueItems": true
    }
   },
   "type": "object"
  },
  "TargetTrackingMetric": {
   "additionalProperties": false,
   "properties": {
    "Dimensions": {
     "insertionOrder": false,
     "items": {
      "$ref": "#/definitions/TargetTrackingMetricDimension"
     },
     "type": "array",
     "uniqueItems": false
    },
    "MetricName": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Namespace": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "TargetTrackingMetricDataQuery": {
   "additionalProperties": false,
   "properties": {
    "Expression": {
     "maxLength": 2048,
     "minLength": 1,
     "type": "string"
    },
    "Id": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Label": {
     "type": "string"
    },
    "MetricStat": {
     "$ref": "#/definitions/TargetTrackingMetricStat"
    },
    "ReturnData": {
     "type": "boolean"
    }
   },
   "type": "object"
  },
  "TargetTrackingMetricDimension": {
   "additionalProperties": false,
   "properties": {
    "Name": {
     "maxLength": 255,
     "minLength": 1,
     "type": "string"
    },
    "Value": {
     "maxLength": 1024,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "TargetTrackingMetricStat": {
   "additionalProperties": false,
   "properties": {
    "Metric": {
     "$ref": "#/definitions/TargetTrackingMetric"
    },
    "Stat": {
     "type": "string"
    },
    "Unit": {
     "maxLength": 1023,
     "minLength": 1,
     "type": "string"
    }
   },
   "type": "object"
  },
  "TargetTrackingScalingPolicyConfiguration": {
   "additionalProperties": false,
   "properties": {
    "CustomizedMetricSpecification": {
     "$ref": "#/definitions/CustomizedMetricSpecification"
    },
    "DisableScaleIn": {
     "type": "boolean"
    },
    "PredefinedMetricSpecification": {
     "$ref": "#/definitions/PredefinedMetricSpecification"
    },
    "ScaleInCooldown": {
     "type": "integer"
    },
    "ScaleOutCooldown": {
     "type": "integer"
    },
    "TargetValue": {
     "type": "number"
    }
   },
   "required": [
    "TargetValue"
   ],
   "type": "object"
  }
 },
 "dependentRequired": {
  "ResourceId": [
   "ScalableDimension",
   "ServiceNamespace"
  ]
 },
 "primaryIdentifier": [
  "/properties/Arn",
  "/properties/ScalableDimension"
 ],
 "properties": {
  "Arn": {
   "type": "string"
  },
  "PolicyName": {
   "maxLength": 256,
   "minLength": 1,
   "pattern": "^\\p{Print}+$",
   "type": "string"
  },
  "PolicyType": {
   "enum": [
    "PredictiveScaling",
    "StepScaling",
    "TargetTrackingScaling"
   ],
   "type": "string"
  },
  "PredictiveScalingPolicyConfiguration": {
   "$ref": "#/definitions/PredictiveScalingPolicyConfiguration"
  },
  "ResourceId": {
   "maxLength": 1600,
   "minLength": 1,
   "type": "string"
  },
  "ScalableDimension": {
   "enum": [
    "appstream:fleet:DesiredCapacity",
    "cassandra:table:ReadCapacityUnits",
    "cassandra:table:WriteCapacityUnits",
    "comprehend:document-classifier-endpoint:DesiredInferenceUnits",
    "comprehend:entity-recognizer-endpoint:DesiredInferenceUnits",
    "custom-resource:ResourceType:Property",
    "dynamodb:index:ReadCapacityUnits",
    "dynamodb:index:WriteCapacityUnits",
    "dynamodb:table:ReadCapacityUnits",
    "dynamodb:table:WriteCapacityUnits",
    "ec2:spot-fleet-request:TargetCapacity",
    "ecs:service:DesiredCount",
    "elasticache:cache-cluster:Nodes",
    "elasticache:replication-group:NodeGroups",
    "elasticache:replication-group:Replicas",
    "elasticmapreduce:instancegroup:InstanceCount",
    "kafka:broker-storage:VolumeSize",
    "lambda:function:ProvisionedConcurrency",
    "neptune:cluster:ReadReplicaCount",
    "rds:cluster:ReadReplicaCount",
    "sagemaker:inference-component:DesiredCopyCount",
    "sagemaker:variant:DesiredInstanceCount",
    "sagemaker:variant:DesiredProvisionedConcurrency",
    "workspaces:workspacespool:DesiredUserSessions"
   ],
   "type": "string"
  },
  "ScalingTargetId": {
   "type": "string"
  },
  "ServiceNamespace": {
   "enum": [
    "appstream",
    "cassandra",
    "comprehend",
    "custom-resource",
    "dynamodb",
    "ec2",
    "ecs",
    "elasticache",
    "elasticmapreduce",
    "kafka",
    "lambda",
    "neptune",
    "rds",
    "sagemaker",
    "workspaces"
   ],
   "type": "string"
  },
  "StepScalingPolicyConfiguration": {
   "$ref": "#/definitions/StepScalingPolicyConfiguration"
  },
  "TargetTrackingScalingPolicyConfiguration": {
   "$ref": "#/definitions/TargetTrackingScalingPolicyConfiguration"
  }
 },
 "readOnlyProperties": [
  "/properties/Arn"
 ],
 "required": [
  "PolicyName",
  "PolicyType"
 ],
 "requiredXor": [
  "ScalingTargetId",
  "ResourceId"
 ],
 "sourceUrl": "https://github.com/aws-cloudformation/aws-cloudformation-rpdk.git",
 "tagging": {
  "cloudFormationSystemTags": false,
  "tagOnCreate": false,
  "tagUpdatable": false,
  "taggable": false
 },
 "typeName": "AWS::ApplicationAutoScaling::ScalingPolicy",
 "writeOnlyProperties": [
  "/properties/TargetTrackingScalingPolicyConfiguration/PredefinedMetricSpecification/ResourceLabel",
  "/properties/ScalingTargetId"
 ]
}
