- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateForecastExportJobCommand
Exports a forecast created by the CreateForecast operation to your Amazon Simple Storage Service (Amazon S3) bucket. The forecast file name will match the following conventions:
where the
You must specify a DataDestination object that includes an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the Amazon S3 bucket. For more information, see aws-forecast-iam-roles.
For more information, see howitworks-forecast.
To get a list of all your forecast export jobs, use the ListForecastExportJobs operation.
The Status
of the forecast export job must be ACTIVE
before you can access the forecast in your Amazon S3 bucket. To get the status, use the DescribeForecastExportJob operation.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ForecastClient, CreateForecastExportJobCommand } from "@aws-sdk/client-forecast"; // ES Modules import
// const { ForecastClient, CreateForecastExportJobCommand } = require("@aws-sdk/client-forecast"); // CommonJS import
const client = new ForecastClient(config);
const input = { // CreateForecastExportJobRequest
ForecastExportJobName: "STRING_VALUE", // required
ForecastArn: "STRING_VALUE", // required
Destination: { // DataDestination
S3Config: { // S3Config
Path: "STRING_VALUE", // required
RoleArn: "STRING_VALUE", // required
KMSKeyArn: "STRING_VALUE",
},
},
Tags: [ // Tags
{ // Tag
Key: "STRING_VALUE", // required
Value: "STRING_VALUE", // required
},
],
Format: "STRING_VALUE",
};
const command = new CreateForecastExportJobCommand(input);
const response = await client.send(command);
// { // CreateForecastExportJobResponse
// ForecastExportJobArn: "STRING_VALUE",
// };
CreateForecastExportJobCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
Destination Required | DataDestination | undefined | The location where you want to save the forecast and an Identity and Access Management (IAM) role that Amazon Forecast can assume to access the location. The forecast must be exported to an Amazon S3 bucket. If encryption is used, |
ForecastArn Required | string | undefined | The Amazon Resource Name (ARN) of the forecast that you want to export. |
ForecastExportJobName Required | string | undefined | The name for the forecast export job. |
Format | string | undefined | The format of the exported data, CSV or PARQUET. The default value is CSV. |
Tags | Tag[] | undefined | The optional metadata that you apply to the forecast export job to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define. The following basic restrictions apply to tags:
|
CreateForecastExportJobCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ForecastExportJobArn | string | undefined | The Amazon Resource Name (ARN) of the export job. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InvalidInputException | client | We can't process the request because it includes an invalid value or a value that exceeds the valid range. |
LimitExceededException | client | The limit on the number of resources per account has been exceeded. |
ResourceAlreadyExistsException | client | There is already a resource with this name. Try again with a different name. |
ResourceInUseException | client | The specified resource is in use. |
ResourceNotFoundException | client | We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again. |
ForecastServiceException | Base exception class for all service exceptions from Forecast service. |