what_if_forecasts
Creates, updates, deletes, gets or lists a what_if_forecasts resource.
Overview
| Name | what_if_forecasts |
| Type | Resource |
| Id | aws.forecast.what_if_forecasts |
Fields
The following fields are returned by SELECT queries:
- describe_what_if_forecast
- list_what_if_forecasts
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | When the what-if forecast was created. |
estimated_time_remaining_in_minutes | integer (int64) | The approximate time remaining to complete the what-if forecast, in minutes. |
forecast_types | array | The quantiles at which probabilistic forecasts are generated. You can specify up to five quantiles per what-if forecast in the CreateWhatIfForecast operation. If you didn't specify quantiles, the default values are ["0.1", "0.5", "0.9"]. |
last_modification_time | string (date-time) | The last time the resource was modified. The timestamp depends on the status of the job: CREATE_PENDING - The CreationTime. CREATE_IN_PROGRESS - The current timestamp. CREATE_STOPPING - The current timestamp. CREATE_STOPPED - When the job stopped. ACTIVE or CREATE_FAILED - When the job finished or failed. |
message | string | If an error occurred, an informational message about the error. |
status | string | The status of the what-if forecast. States include: ACTIVE CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_FAILED CREATE_STOPPING, CREATE_STOPPED DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED The Status of the what-if forecast must be ACTIVE before you can access the forecast. (pattern: <code>^[a-zA-Z0-9_]+$</code>) |
time_series_replacements_data_source | object | An array of S3Config, Schema, and Format elements that describe the replacement time series. |
time_series_transformations | array | An array of Action and TimeSeriesConditions elements that describe what transformations were applied to which time series. |
what_if_analysis_arn | string | The Amazon Resource Name (ARN) of the what-if analysis that contains this forecast. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
what_if_forecast_arn | string | The Amazon Resource Name (ARN) of the what-if forecast. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
what_if_forecast_name | string | The name of the what-if forecast. (pattern: <code>^[a-zA-Z][a-zA-Z0-9_]*</code>) |
| Name | Datatype | Description |
|---|---|---|
creation_time | string (date-time) | When the what-if forecast was created. |
last_modification_time | string (date-time) | The last time the resource was modified. The timestamp depends on the status of the job: CREATE_PENDING - The CreationTime. CREATE_IN_PROGRESS - The current timestamp. CREATE_STOPPING - The current timestamp. CREATE_STOPPED - When the job stopped. ACTIVE or CREATE_FAILED - When the job finished or failed. |
message | string | If an error occurred, an informational message about the error. |
status | string | The status of the what-if forecast. States include: ACTIVE CREATE_PENDING, CREATE_IN_PROGRESS, CREATE_FAILED CREATE_STOPPING, CREATE_STOPPED DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED The Status of the what-if analysis must be ACTIVE before you can access the analysis. |
what_if_analysis_arn | string | The Amazon Resource Name (ARN) of the what-if analysis that contains this what-if forecast. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
what_if_forecast_arn | string | The Amazon Resource Name (ARN) of the what-if forecast. (pattern: <code>arn:([a-z\d-]+):forecast:.:.:.+</code>) |
what_if_forecast_name | string | The name of the what-if forecast. (pattern: <code>^[a-zA-Z][a-zA-Z0-9_]*</code>) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_what_if_forecast | select | region | Describes the what-if forecast created using the CreateWhatIfForecast operation. In addition to listing the properties provided in the CreateWhatIfForecast request, this operation lists the following properties: CreationTime LastModificationTime Message - If an error occurred, information about the error. Status | |
list_what_if_forecasts | select | region | Returns a list of what-if forecasts created using the CreateWhatIfForecast operation. For each what-if forecast, this operation returns a summary of its properties, including its Amazon Resource Name (ARN). You can retrieve the complete set of properties by using the what-if forecast ARN with the DescribeWhatIfForecast operation. | |
create_what_if_forecast | insert | region, WhatIfForecastName, WhatIfAnalysisArn | A what-if forecast is a forecast that is created from a modified version of the baseline forecast. Each what-if forecast incorporates either a replacement dataset or a set of transformations to the original dataset. | |
delete_what_if_forecast | delete | region | Deletes a what-if forecast created using the CreateWhatIfForecast operation. You can delete only what-if forecasts that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfForecast operation. You can't delete a what-if forecast while it is being exported. After a what-if forecast is deleted, you can no longer query the what-if analysis. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_what_if_forecast
- list_what_if_forecasts
Describes the what-if forecast created using the CreateWhatIfForecast operation. In addition to listing the properties provided in the CreateWhatIfForecast request, this operation lists the following properties: CreationTime LastModificationTime Message - If an error occurred, information about the error. Status
SELECT
creation_time,
estimated_time_remaining_in_minutes,
forecast_types,
last_modification_time,
message,
status,
time_series_replacements_data_source,
time_series_transformations,
what_if_analysis_arn,
what_if_forecast_arn,
what_if_forecast_name
FROM aws.forecast.what_if_forecasts
WHERE region = '{{ region }}' -- required
;
Returns a list of what-if forecasts created using the CreateWhatIfForecast operation. For each what-if forecast, this operation returns a summary of its properties, including its Amazon Resource Name (ARN). You can retrieve the complete set of properties by using the what-if forecast ARN with the DescribeWhatIfForecast operation.
SELECT
creation_time,
last_modification_time,
message,
status,
what_if_analysis_arn,
what_if_forecast_arn,
what_if_forecast_name
FROM aws.forecast.what_if_forecasts
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_what_if_forecast
- Manifest
A what-if forecast is a forecast that is created from a modified version of the baseline forecast. Each what-if forecast incorporates either a replacement dataset or a set of transformations to the original dataset.
INSERT INTO aws.forecast.what_if_forecasts (
WhatIfForecastName,
WhatIfAnalysisArn,
TimeSeriesTransformations,
TimeSeriesReplacementsDataSource,
Tags,
region
)
SELECT
'{{ WhatIfForecastName }}' /* required */,
'{{ WhatIfAnalysisArn }}' /* required */,
'{{ TimeSeriesTransformations }}',
'{{ TimeSeriesReplacementsDataSource }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
what_if_forecast_arn
;
# Description fields are for documentation purposes
- name: what_if_forecasts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the what_if_forecasts resource.
- name: WhatIfForecastName
value: "{{ WhatIfForecastName }}"
description: |
The name of the what-if forecast. Names must be unique within each what-if analysis.
- name: WhatIfAnalysisArn
value: "{{ WhatIfAnalysisArn }}"
description: |
The Amazon Resource Name (ARN) of the what-if analysis.
- name: TimeSeriesTransformations
description: |
The transformations that are applied to the baseline time series. Each transformation contains an action and a set of conditions. An action is applied only when all conditions are met. If no conditions are provided, the action is applied to all items.
value:
- Action:
AttributeName: "{{ AttributeName }}"
Operation: "{{ Operation }}"
Value: {{ Value }}
TimeSeriesConditions: "{{ TimeSeriesConditions }}"
- name: TimeSeriesReplacementsDataSource
description: |
The replacement time series dataset, which contains the rows that you want to change in the related time series dataset. A replacement time series does not need to contain all rows that are in the baseline related time series. Include only the rows (measure-dimension combinations) that you want to include in the what-if forecast. This dataset is merged with the original time series to create a transformed dataset that is used for the what-if analysis. This dataset should contain the items to modify (such as item_id or workforce_type), any relevant dimensions, the timestamp column, and at least one of the related time series columns. This file should not contain duplicate timestamps for the same time series. Timestamps and item_ids not included in this dataset are not included in the what-if analysis.
value:
S3Config:
Path: "{{ Path }}"
RoleArn: "{{ RoleArn }}"
KMSKeyArn: "{{ KMSKeyArn }}"
Schema:
Attributes:
- AttributeName: "{{ AttributeName }}"
AttributeType: "{{ AttributeType }}"
Format: "{{ Format }}"
TimestampFormat: "{{ TimestampFormat }}"
- name: Tags
description: |
A list of tags to apply to the what if forecast.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
DELETE examples
- delete_what_if_forecast
Deletes a what-if forecast created using the CreateWhatIfForecast operation. You can delete only what-if forecasts that have a status of ACTIVE or CREATE_FAILED. To get the status, use the DescribeWhatIfForecast operation. You can't delete a what-if forecast while it is being exported. After a what-if forecast is deleted, you can no longer query the what-if analysis.
DELETE FROM aws.forecast.what_if_forecasts
WHERE region = '{{ region }}' --required
;