Skip to content

AWS.Forecast reference

Source: src/AWS/Forecast/CreateAutoPredictor.ts

Runtime binding for forecast:CreateAutoPredictor — kick off (re)training of an AutoPredictor from a dataset group, the scheduled-retraining step of a grandfathered Forecast deployment. Also grants iam:PassRole (conditioned to forecast.amazonaws.com) for the KMS-encryption role an EncryptionConfig passes to the service.

Predictor ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateAutoPredictor on *. Provide the implementation with Effect.provide(AWS.Forecast.CreateAutoPredictorHttp).

// init
const createAutoPredictor = yield* AWS.Forecast.CreateAutoPredictor();
// runtime
const predictor = yield* createAutoPredictor({
PredictorName: "demand_2026_07",
ForecastHorizon: 14,
ForecastFrequency: "D",
DataConfig: { DatasetGroupArn: group.datasetGroupArn },
});

Source: src/AWS/Forecast/CreateDatasetImportJob.ts

Runtime binding for forecast:CreateDatasetImportJob — start an asynchronous import of training data from S3 into a Forecast dataset, the standard scheduled-ingest step of a grandfathered Forecast deployment. Also grants iam:PassRole (conditioned to forecast.amazonaws.com) for the S3 data-access role the import assumes.

The import job’s ARN is created at runtime, so the binding takes no arguments and grants forecast:CreateDatasetImportJob on *. Provide the implementation with Effect.provide(AWS.Forecast.CreateDatasetImportJobHttp).

// init
const createDatasetImportJob = yield* AWS.Forecast.CreateDatasetImportJob();
// runtime
const job = yield* createDatasetImportJob({
DatasetImportJobName: "daily_2026_07_14",
DatasetArn: dataset.datasetArn,
DataSource: {
S3Config: {
Path: "s3://my-bucket/demand.csv",
RoleArn: dataAccessRole.roleArn,
},
},
TimestampFormat: "yyyy-MM-dd",
});

Source: src/AWS/Forecast/CreateForecast.ts

Runtime binding for forecast:CreateForecast — generate a fresh forecast from a trained predictor, the scheduled step that keeps the queryable forecast current after each retraining or data import.

Forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateForecast on *. Provide the implementation with Effect.provide(AWS.Forecast.CreateForecastHttp).

// init
const createForecast = yield* AWS.Forecast.CreateForecast();
// runtime
const generated = yield* createForecast({
ForecastName: "demand_2026_07_14",
PredictorArn: predictorArn,
});

Source: src/AWS/Forecast/CreateForecastExportJob.ts

Runtime binding for forecast:CreateForecastExportJob — export a complete forecast to S3 as CSV/Parquet, the bulk-consumption path that complements per-item lookups via QueryForecast.

Export job ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateForecastExportJob on *, plus iam:PassRole (conditioned to forecast.amazonaws.com) for the export destination role. Provide the implementation with Effect.provide(AWS.Forecast.CreateForecastExportJobHttp).

CreateForecastExportJob: Exporting Forecasts

Section titled “CreateForecastExportJob: Exporting Forecasts”
// init
const createForecastExportJob = yield* AWS.Forecast.CreateForecastExportJob();
// runtime
const job = yield* createForecastExportJob({
ForecastExportJobName: "demand_2026_07_14_export",
ForecastArn: forecastArn,
Destination: {
S3Config: { Path: "s3://my-bucket/forecasts/", RoleArn: exportRoleArn },
},
});

Source: src/AWS/Forecast/CreateWhatIfAnalysis.ts

Runtime binding for forecast:CreateWhatIfAnalysis — start a what-if analysis on a baseline forecast, the container under which scenario forecasts (price changes, promotions) are created and later compared via QueryWhatIfForecast.

What-if analysis ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateWhatIfAnalysis on *. Provide the implementation with Effect.provide(AWS.Forecast.CreateWhatIfAnalysisHttp).

// init
const createWhatIfAnalysis = yield* AWS.Forecast.CreateWhatIfAnalysis();
// runtime
const analysis = yield* createWhatIfAnalysis({
WhatIfAnalysisName: "promo_scenarios",
ForecastArn: forecastArn,
});

Source: src/AWS/Forecast/CreateWhatIfForecast.ts

Runtime binding for forecast:CreateWhatIfForecast — create a scenario forecast under a what-if analysis, transforming the baseline time series (or replacing it from S3) so the outcome can be compared with QueryWhatIfForecast.

What-if forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateWhatIfForecast on *, plus iam:PassRole (conditioned to forecast.amazonaws.com) for the replacement-data-source role. Provide the implementation with Effect.provide(AWS.Forecast.CreateWhatIfForecastHttp).

// init
const createWhatIfForecast = yield* AWS.Forecast.CreateWhatIfForecast();
// runtime
const scenario = yield* createWhatIfForecast({
WhatIfForecastName: "price_drop_10pct",
WhatIfAnalysisArn: analysisArn,
TimeSeriesTransformations: [
{
Action: {
AttributeName: "price",
Operation: "MULTIPLY",
Value: 0.9,
},
},
],
});

Source: src/AWS/Forecast/CreateWhatIfForecastExport.ts

Runtime binding for forecast:CreateWhatIfForecastExport — export one or more scenario forecasts to S3 as CSV/Parquet so they can be compared offline or fed into downstream analytics.

What-if forecast export ARNs are created at runtime, so the binding takes no arguments and grants forecast:CreateWhatIfForecastExport on *, plus iam:PassRole (conditioned to forecast.amazonaws.com) for the export destination role. Provide the implementation with Effect.provide(AWS.Forecast.CreateWhatIfForecastExportHttp).

CreateWhatIfForecastExport: Exporting Forecasts

Section titled “CreateWhatIfForecastExport: Exporting Forecasts”
// init
const createWhatIfForecastExport =
yield* AWS.Forecast.CreateWhatIfForecastExport();
// runtime
const job = yield* createWhatIfForecastExport({
WhatIfForecastExportName: "promo_scenarios_export",
WhatIfForecastArns: [scenarioArn],
Destination: {
S3Config: { Path: "s3://my-bucket/whatif/", RoleArn: exportRoleArn },
},
});

Source: src/AWS/Forecast/Dataset.ts

An Amazon Forecast dataset — a typed, domain-scoped collection of time-series (or metadata) records described by a schema. Creating the dataset is a cheap metadata operation; bulk imports and training happen through separate import jobs and predictors.

const dataset = yield* Forecast.Dataset("Demand", {
domain: "CUSTOM",
datasetType: "TARGET_TIME_SERIES",
dataFrequency: "D",
schema: {
attributes: [
{ attributeName: "item_id", attributeType: "string" },
{ attributeName: "timestamp", attributeType: "timestamp" },
{ attributeName: "target_value", attributeType: "float" },
],
},
});

Source: src/AWS/Forecast/DatasetGroup.ts

An Amazon Forecast dataset group — a domain-scoped container that groups the datasets used to train predictors. Creating the group is cheap; the expensive training work lives in predictors and forecasts provisioned separately.

Custom Dataset Group

const group = yield* Forecast.DatasetGroup("Sales", {
domain: "CUSTOM",
});

Dataset Group with Attached Datasets

const group = yield* Forecast.DatasetGroup("Sales", {
domain: "RETAIL",
datasetArns: [dataset.datasetArn],
tags: { team: "planning" },
});

Source: src/AWS/Forecast/DeleteResourceTree.ts

Runtime binding for forecast:DeleteResourceTree — delete an entire tree of runtime-created Forecast resources (a predictor and its forecasts and exports, or a dataset’s import jobs) in a single call, the cost-hygiene counterpart to the Create* bindings.

The target ARNs are created at runtime, so the binding takes no arguments and grants forecast:DeleteResourceTree on *. Provide the implementation with Effect.provide(AWS.Forecast.DeleteResourceTreeHttp).

// init
const deleteResourceTree = yield* AWS.Forecast.DeleteResourceTree();
// runtime
yield* deleteResourceTree({ ResourceArn: predictorArn });

Source: src/AWS/Forecast/DescribeAutoPredictor.ts

Runtime binding for forecast:DescribeAutoPredictor — poll a training run started by CreateAutoPredictor until its Status reaches ACTIVE (or CREATE_FAILED) and read its estimated time remaining.

Predictor ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeAutoPredictor on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeAutoPredictorHttp).

DescribeAutoPredictor: Training Predictors

Section titled “DescribeAutoPredictor: Training Predictors”
// init
const describeAutoPredictor = yield* AWS.Forecast.DescribeAutoPredictor();
// runtime
const detail = yield* describeAutoPredictor({
PredictorArn: predictor.PredictorArn!,
});
yield* Effect.log(`training ${detail.Status}`);

Source: src/AWS/Forecast/DescribeDatasetImportJob.ts

Runtime binding for forecast:DescribeDatasetImportJob — poll an import job started by CreateDatasetImportJob until its Status reaches ACTIVE (or CREATE_FAILED), and read its field statistics.

Import-job ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeDatasetImportJob on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeDatasetImportJobHttp).

// init
const describeDatasetImportJob = yield* AWS.Forecast.DescribeDatasetImportJob();
// runtime
const detail = yield* describeDatasetImportJob({
DatasetImportJobArn: job.DatasetImportJobArn!,
});
if (detail.Status === "CREATE_FAILED") {
yield* Effect.logError(`import failed: ${detail.Message}`);
}

Source: src/AWS/Forecast/DescribeForecast.ts

Runtime binding for forecast:DescribeForecast — poll a forecast generation started by CreateForecast until its Status reaches ACTIVE and it becomes queryable.

Forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeForecast on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeForecastHttp).

// init
const describeForecast = yield* AWS.Forecast.DescribeForecast();
// runtime
const detail = yield* describeForecast({
ForecastArn: generated.ForecastArn!,
});
yield* Effect.log(`forecast ${detail.Status}`);

Source: src/AWS/Forecast/DescribeForecastExportJob.ts

Runtime binding for forecast:DescribeForecastExportJob — poll the status of a forecast export started with CreateForecastExportJob until the files land in S3.

Export job ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeForecastExportJob on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeForecastExportJobHttp).

DescribeForecastExportJob: Exporting Forecasts

Section titled “DescribeForecastExportJob: Exporting Forecasts”
// init
const describeForecastExportJob =
yield* AWS.Forecast.DescribeForecastExportJob();
// runtime
const { Status } = yield* describeForecastExportJob({
ForecastExportJobArn: exportJobArn,
});

Source: src/AWS/Forecast/DescribeWhatIfAnalysis.ts

Runtime binding for forecast:DescribeWhatIfAnalysis — poll the status of a what-if analysis created with CreateWhatIfAnalysis until it is ACTIVE and scenario forecasts can be created under it.

What-if analysis ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeWhatIfAnalysis on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeWhatIfAnalysisHttp).

// init
const describeWhatIfAnalysis = yield* AWS.Forecast.DescribeWhatIfAnalysis();
// runtime
const { Status } = yield* describeWhatIfAnalysis({
WhatIfAnalysisArn: analysisArn,
});

Source: src/AWS/Forecast/DescribeWhatIfForecast.ts

Runtime binding for forecast:DescribeWhatIfForecast — poll the status of a scenario forecast created with CreateWhatIfForecast until it is ACTIVE and queryable via QueryWhatIfForecast.

What-if forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeWhatIfForecast on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeWhatIfForecastHttp).

// init
const describeWhatIfForecast = yield* AWS.Forecast.DescribeWhatIfForecast();
// runtime
const { Status } = yield* describeWhatIfForecast({
WhatIfForecastArn: scenarioArn,
});

Source: src/AWS/Forecast/DescribeWhatIfForecastExport.ts

Runtime binding for forecast:DescribeWhatIfForecastExport — poll the status of a scenario-forecast export started with CreateWhatIfForecastExport until the files land in S3.

Export ARNs are created at runtime, so the binding takes no arguments and grants forecast:DescribeWhatIfForecastExport on *. Provide the implementation with Effect.provide(AWS.Forecast.DescribeWhatIfForecastExportHttp).

DescribeWhatIfForecastExport: Exporting Forecasts

Section titled “DescribeWhatIfForecastExport: Exporting Forecasts”
// init
const describeWhatIfForecastExport =
yield* AWS.Forecast.DescribeWhatIfForecastExport();
// runtime
const { Status } = yield* describeWhatIfForecastExport({
WhatIfForecastExportArn: exportArn,
});

Source: src/AWS/Forecast/GetAccuracyMetrics.ts

Runtime binding for forecast:GetAccuracyMetrics — read a trained (legacy) predictor’s backtest accuracy metrics (wQL, RMSE, MAPE, WAPE) so an ops function can gate promotion of a retrained model on its accuracy.

Predictor ARNs are created at runtime, so the binding takes no arguments and grants forecast:GetAccuracyMetrics on *. Provide the implementation with Effect.provide(AWS.Forecast.GetAccuracyMetricsHttp).

// init
const getAccuracyMetrics = yield* AWS.Forecast.GetAccuracyMetrics();
// runtime
const metrics = yield* getAccuracyMetrics({
PredictorArn: predictorArn,
});

Source: src/AWS/Forecast/QueryForecast.ts

Runtime binding for forecast:QueryForecast — the Forecast Query data plane. Retrieves the predicted time series for a single item from a generated forecast, the call an API or personalization function makes to serve predictions.

Forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:QueryForecast on *. Provide the implementation with Effect.provide(AWS.Forecast.QueryForecastHttp).

// init
const queryForecast = yield* AWS.Forecast.QueryForecast();
// runtime
const { Forecast } = yield* queryForecast({
ForecastArn: forecastArn,
Filters: { item_id: "sku_1234" },
});
const p50 = Forecast?.Predictions?.p50 ?? [];

Source: src/AWS/Forecast/QueryWhatIfForecast.ts

Runtime binding for forecast:QueryWhatIfForecast — retrieve the predicted time series for a single item from a what-if forecast, so an application can compare a scenario (price change, promotion) against the baseline served by QueryForecast.

What-if forecast ARNs are created at runtime, so the binding takes no arguments and grants forecast:QueryWhatIfForecast on *. Provide the implementation with Effect.provide(AWS.Forecast.QueryWhatIfForecastHttp).

// init
const queryWhatIfForecast = yield* AWS.Forecast.QueryWhatIfForecast();
// runtime
const { Forecast } = yield* queryWhatIfForecast({
WhatIfForecastArn: whatIfForecastArn,
Filters: { item_id: "sku_1234" },
});

Source: src/AWS/Forecast/ResumeResource.ts

Runtime binding for forecast:ResumeResource — resume a stopped Forecast monitor so it continues evaluating a deployed predictor’s drift.

Monitor ARNs are created at runtime, so the binding takes no arguments and grants forecast:ResumeResource on *. Provide the implementation with Effect.provide(AWS.Forecast.ResumeResourceHttp).

// init
const resumeResource = yield* AWS.Forecast.ResumeResource();
// runtime
yield* resumeResource({ ResourceArn: monitorArn });

Source: src/AWS/Forecast/StopResource.ts

Runtime binding for forecast:StopResource — halt an in-progress Forecast job (dataset import, predictor training, forecast generation, or any of their export jobs), the cost-control lever for a runaway training run. A stopped job cannot be resumed.

Job ARNs are created at runtime, so the binding takes no arguments and grants forecast:StopResource on *. Provide the implementation with Effect.provide(AWS.Forecast.StopResourceHttp).

// init
const stopResource = yield* AWS.Forecast.StopResource();
// runtime
yield* stopResource({ ResourceArn: predictorArn });