What is forecasted usage in AWS?

GetUsageForecast

Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage.

Request Syntax

{
   "Filter": { 
      "And": [ 
         "Expression"
      ],
      "CostCategories": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Dimensions": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      },
      "Not": "Expression",
      "Or": [ 
         "Expression"
      ],
      "Tags": { 
         "Key": "string",
         "MatchOptions": [ "string" ],
         "Values": [ "string" ]
      }
   },
   "Granularity": "string",
   "Metric": "string",
   "PredictionIntervalLevel": number,
   "TimePeriod": { 
      "End": "string",
      "Start": "string"
   }
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Filter

The filters that you want to use to filter your forecast. The GetUsageForecast API supports filtering by the following dimensions:

  • AZ

  • INSTANCE_TYPE

  • LINKED_ACCOUNT

  • LINKED_ACCOUNT_NAME

  • OPERATION

  • PURCHASE_TYPE

  • REGION

  • SERVICE

  • USAGE_TYPE

  • USAGE_TYPE_GROUP

  • RECORD_TYPE

  • OPERATING_SYSTEM

  • TENANCY

  • SCOPE

  • PLATFORM

  • SUBSCRIPTION_ID

  • LEGAL_ENTITY_NAME

  • DEPLOYMENT_OPTION

  • DATABASE_ENGINE

  • INSTANCE_TYPE_FAMILY

  • BILLING_ENTITY

  • RESERVATION_ID

  • SAVINGS_PLAN_ARN

Type: Expression object

Required: No

Granularity

How granular you want the forecast to be. You can get 3 months of DAILY forecasts or 12 months of MONTHLY forecasts.

The GetUsageForecast operation supports only DAILY and MONTHLY granularities.

Type: String

Valid Values: DAILY | MONTHLY | HOURLY

Required: Yes

Metric

Which metric Cost Explorer uses to create your forecast.

Valid values for a GetUsageForecast call are the following:

  • USAGE_QUANTITY

  • NORMALIZED_USAGE_AMOUNT

Type: String

Valid Values: BLENDED_COST | UNBLENDED_COST | AMORTIZED_COST | NET_UNBLENDED_COST | NET_AMORTIZED_COST | USAGE_QUANTITY | NORMALIZED_USAGE_AMOUNT

Required: Yes

PredictionIntervalLevel

AWS Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals.

Type: Integer

Valid Range: Minimum value of 51. Maximum value of 99.

Required: No

TimePeriod

The start and end dates of the period that you want to retrieve usage forecast for. The start date is included in the period, but the end date isn't included in the period. For example, if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01. The start date must be equal to or later than the current date to avoid a validation error.

Type: DateInterval object

Required: Yes

Response Syntax

{
   "ForecastResultsByTime": [ 
      { 
         "MeanValue": "string",
         "PredictionIntervalLowerBound": "string",
         "PredictionIntervalUpperBound": "string",
         "TimePeriod": { 
            "End": "string",
            "Start": "string"
         }
      }
   ],
   "Total": { 
      "Amount": "string",
      "Unit": "string"
   }
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ForecastResultsByTime

The forecasts for your query, in order. For DAILY forecasts, this is a list of days. For MONTHLY forecasts, this is a list of months.

Type: Array of ForecastResult objects

Total

How much you're forecasted to use over the forecast period.

Type: MetricValue object

Errors

For information about the errors that are common to all actions, see Common Errors.

DataUnavailableException

The requested data is unavailable.

HTTP Status Code: 400

LimitExceededException

You made too many calls in a short period of time. Try again later.

HTTP Status Code: 400

UnresolvableUsageUnitException

Cost Explorer was unable to identify the usage unit. Provide UsageType/UsageTypeGroup filter selections that contain matching units, for example: hours.

HTTP Status Code: 400

Examples

Example

The following example shows how to retrieve a forecast using the GetUsageForecast operation.

Sample Request

POST / HTTP/1.1
Host: ce.us-east-1.amazonaws.com
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid,Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: AWSInsightsIndexService.GetUsageForecast
{
  "TimePeriod": {
    "Start":"2018-10-25",
    "End": "2018-10-27"
  },
  "Granularity": "DAILY",
  "Filter": {      
    "Dimensions": {
      "Key": "SERVICE",
      "Values": [
        "Amazon Simple Storage Service"
      ]
    }
  },
  "Metric":"USAGE_QUANTITY",
  "PredictionIntervalLevel":85
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: <RequestId>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Date: <Date>
{
  "ForecastResultsByTime": [
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2019-10-26", 
        "Start": "2019-10-25"
      }
    }, 
    {
      "MeanValue": "37.0786663399", 
      "PredictionIntervalLowerBound": "34.9970026341", 
      "PredictionIntervalUpperBound": "39.1603300457", 
      "TimePeriod": {
        "End": "2019-10-27", 
        "Start": "2019-10-26"
      }
    }
  ], 
  "Total": {
      "Amount": "74.1573326798", 
      "Unit": "Hrs"
  }
}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

  • AWS Command Line Interface

  • AWS SDK for .NET

  • AWS SDK for C++

  • AWS SDK for Go

  • AWS SDK for Java V2

  • AWS SDK for JavaScript

  • AWS SDK for PHP V3

  • AWS SDK for Python

  • AWS SDK for Ruby V3

How does Amazon forecast work?

Amazon Forecast is a fully managed service that uses machine learning to deliver highly accurate forecasts. Based on the same technology used at Amazon.com, Amazon Forecast uses machine learning to combine time series data with additional variables to build forecasts.

What tool is best for forecasting your AWS spending?

AWS Cost Explorer enables you to view and analyze your AWS Cost and Usage Reports (AWS CUR). You can also predict your overall cost associated with AWS services in the future by creating a forecast of AWS Cost Explorer, but you can't view historical data beyond 12 months.

What is usage type in AWS?

Usage types are the units that each service uses to measure the usage of a specific type of resource. For example, the BoxUsage:t2. micro(Hrs) usage type filters by the running hours of Amazon EC2 t2.

What forecasting model does Amazon use?

Amazon Forecast CNN-QR, Convolutional Neural Network - Quantile Regression, is a proprietary machine learning algorithm for forecasting time series using causal convolutional neural networks (CNNs). CNN-QR works best with large datasets containing hundreds of time series.