Skip to content

aws.autoscaling.get_predictive_scaling_forecast

Example SQL Queries

SELECT * FROM
aws.autoscaling.get_predictive_scaling_forecast
WHERE
"auto_scaling_group_name" = 'VALUE'
AND "policy_name" = 'VALUE'
AND "start_time" = 'VALUE'
AND "end_time" = 'VALUE';

Description

Retrieves the forecast data for a predictive scaling policy.

Load forecasts are predictions of the hourly load values using historical load data from CloudWatch and an analysis of historical trends. Capacity forecasts are represented as predicted values for the minimum capacity that is needed on an hourly basis, based on the hourly load forecast.

A minimum of 24 hours of data is required to create the initial forecasts. However, having a full 14 days of historical data results in more accurate forecasts.

For more information, see Predictive scaling for Amazon EC2 Auto Scaling in the Amazon EC2 Auto Scaling User Guide.

Table Definition

Column NameColumn Data Type
auto_scaling_group_name Required Input Column

The name of the Auto Scaling group.

VARCHAR
end_time Required Input Column

The exclusive end time of the time range for the forecast data to get. The maximum time duration between the start and end time is 30 days.

Although this parameter can accept a date and time that is more than two days in the future, the availability of forecast data has limits. Amazon EC2 Auto Scaling only issues forecasts for periods of two days in advance.

TIMESTAMP_S
policy_name Required Input Column

The name of the policy.

VARCHAR
start_time Required Input Column

The inclusive start time of the time range for the forecast data to get. At most, the date and time can be one year before the current date and time.

TIMESTAMP_S
_aws_profile Input Column

The AWS profile defines the AWS identity used. It can be defined via credentials or by assuming a IAM role.

STRUCT(
"type" VARCHAR,
"name" VARCHAR,
"account_id" VARCHAR,
"via_profile_name" VARCHAR,
"assumed_role_arn" VARCHAR,
"organization" STRUCT(
"account_name" VARCHAR,
"id" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[],
"master_account" STRUCT(
"id" VARCHAR,
"email" VARCHAR
),
"parents" STRUCT(
"type" VARCHAR,
"id" VARCHAR,
"name" VARCHAR,
"tags" STRUCT(
"key" VARCHAR,
"value" VARCHAR
)[]
)[]
)
)
Show child fields
_aws_profile.account_id

The AWS account id

_aws_profile.assumed_role_arn

The ARN of the assumed role

_aws_profile.name

The unique name of the profile.

_aws_profile.organization

Information about this profile's membership in the AWS organization.

Show child fields
_aws_profile.organization.account_name

The name of account speciifed by the organization

_aws_profile.organization.id

The organization id

_aws_profile.organization.master_account
Show child fields
_aws_profile.organization.master_account.email

The organization master account email address

_aws_profile.organization.master_account.id

The organization master account id

_aws_profile.organization.parents[]
Show child fields
_aws_profile.organization.parents[].id

The id of the parent

_aws_profile.organization.parents[].name

The name of the parent

_aws_profile.organization.parents[].tags[]
Show child fields
_aws_profile.organization.parents[].tags[].key
_aws_profile.organization.parents[].tags[].value
_aws_profile.organization.parents[].type

The type of parent can be an organization unit or a root

_aws_profile.organization.tags[]
Show child fields
_aws_profile.organization.tags[].key
_aws_profile.organization.tags[].value
_aws_profile.type

The type of profile, either 'credentials' or 'assumed_role'

_aws_profile.via_profile_name

This IAM role for this profile is assumed by first utilizing another profile with this name to obtain credentials.

_aws_region Input Column

The AWS region to use.

VARCHAR
capacity_forecast

The capacity forecast.

STRUCT(
"timestamps" TIMESTAMP_S[],
"values" DOUBLE[]
)
Show child fields
capacity_forecast.timestamps[]
capacity_forecast.values[]
load_forecast

The load forecast.

STRUCT(
"timestamps" TIMESTAMP_S[],
"values" DOUBLE[],
"metric_specification" STRUCT(
"target_value" DOUBLE,
"predefined_metric_pair_specification" STRUCT(
"predefined_metric_type" VARCHAR,
"resource_label" VARCHAR
),
"predefined_scaling_metric_specification" STRUCT(
"predefined_metric_type" VARCHAR,
"resource_label" VARCHAR
),
"predefined_load_metric_specification" STRUCT(
"predefined_metric_type" VARCHAR,
"resource_label" VARCHAR
),
"customized_scaling_metric_specification" STRUCT(
"metric_data_queries" STRUCT(
"id" VARCHAR,
"expression" VARCHAR,
"metric_stat" STRUCT(
"metric" STRUCT(
"namespace" VARCHAR,
"metric_name" VARCHAR,
"dimensions" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
),
"stat" VARCHAR,
"unit" VARCHAR
),
"label" VARCHAR,
"return_data" BOOLEAN
)[]
),
"customized_load_metric_specification" STRUCT(
"metric_data_queries" STRUCT(
"id" VARCHAR,
"expression" VARCHAR,
"metric_stat" STRUCT(
"metric" STRUCT(
"namespace" VARCHAR,
"metric_name" VARCHAR,
"dimensions" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
),
"stat" VARCHAR,
"unit" VARCHAR
),
"label" VARCHAR,
"return_data" BOOLEAN
)[]
),
"customized_capacity_metric_specification" STRUCT(
"metric_data_queries" STRUCT(
"id" VARCHAR,
"expression" VARCHAR,
"metric_stat" STRUCT(
"metric" STRUCT(
"namespace" VARCHAR,
"metric_name" VARCHAR,
"dimensions" STRUCT(
"name" VARCHAR,
"value" VARCHAR
)[]
),
"stat" VARCHAR,
"unit" VARCHAR
),
"label" VARCHAR,
"return_data" BOOLEAN
)[]
)
)
)[]
Show child fields
load_forecast[]
Show child fields
load_forecast[].metric_specification

The metric specification for the load forecast.

Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification

The customized capacity metric specification.

Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[]
Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].expression

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].id

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].label

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat, but not both.

Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric

The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.

Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[]
Show child fields
load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].name

The name of the dimension.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].value

The value of the dimension.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric.metric_name

The name of the metric.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.metric.namespace

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.stat

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].metric_stat.unit

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.

load_forecast[].metric_specification.customized_capacity_metric_specification.metric_data_queries[].return_data

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).

load_forecast[].metric_specification.customized_load_metric_specification

The customized load metric specification.

Show child fields
load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[]
Show child fields
load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].expression

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].id

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].label

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat, but not both.

Show child fields
load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric

The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.

Show child fields
load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[]
Show child fields
load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].name

The name of the dimension.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].value

The value of the dimension.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric.metric_name

The name of the metric.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.metric.namespace

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.stat

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].metric_stat.unit

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.

load_forecast[].metric_specification.customized_load_metric_specification.metric_data_queries[].return_data

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).

load_forecast[].metric_specification.customized_scaling_metric_specification

The customized scaling metric specification.

Show child fields
load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[]
Show child fields
load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].expression

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].id

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].label

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat

Information about the metric data to return.

Conditional: Within each MetricDataQuery object, you must specify either Expression or MetricStat, but not both.

Show child fields
load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric

The CloudWatch metric to return, including the metric name, namespace, and dimensions. To get the exact metric name, namespace, and dimensions, inspect the Metric object that is returned by a call to ListMetrics.

Show child fields
load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[]
Show child fields
load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].name

The name of the dimension.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric.dimensions[].value

The value of the dimension.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric.metric_name

The name of the metric.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.metric.namespace

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.stat

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].metric_stat.unit

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.

load_forecast[].metric_specification.customized_scaling_metric_specification.metric_data_queries[].return_data

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).

load_forecast[].metric_specification.predefined_load_metric_specification

The predefined load metric specification.

Show child fields
load_forecast[].metric_specification.predefined_load_metric_specification.predefined_metric_type

The metric type.

load_forecast[].metric_specification.predefined_load_metric_specification.resource_label

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/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN

  • targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.

To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.

load_forecast[].metric_specification.predefined_metric_pair_specification

The predefined metric pair specification from which Amazon EC2 Auto Scaling determines the appropriate scaling metric and load metric to use.

Show child fields
load_forecast[].metric_specification.predefined_metric_pair_specification.predefined_metric_type

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.

load_forecast[].metric_specification.predefined_metric_pair_specification.resource_label

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/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN

  • targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.

To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.

load_forecast[].metric_specification.predefined_scaling_metric_specification

The predefined scaling metric specification.

Show child fields
load_forecast[].metric_specification.predefined_scaling_metric_specification.predefined_metric_type

The metric type.

load_forecast[].metric_specification.predefined_scaling_metric_specification.resource_label

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/<load-balancer-name>/<load-balancer-id> is the final portion of the load balancer ARN

  • targetgroup/<target-group-name>/<target-group-id> is the final portion of the target group ARN.

To find the ARN for an Application Load Balancer, use the DescribeLoadBalancers API operation. To find the ARN for the target group, use the DescribeTargetGroups API operation.

load_forecast[].metric_specification.target_value

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.

load_forecast[].timestamps[]
load_forecast[].values[]
update_time

The time the forecast was made.

TIMESTAMP_S