Skip to content

CreateWhatIfForecast

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,
},
},
],
});