Overview
This node integrates with Amazon Web Services (AWS) Cost Explorer to retrieve cost-related data. Specifically, the "Get Cost Forecast" operation fetches a forecast of your AWS spending over a specified future time period based on historical costs. This is useful for budgeting, financial planning, and monitoring expected cloud expenses.
Practical examples include:
- Predicting monthly AWS costs to adjust budgets proactively.
- Analyzing hourly or daily forecasts to identify potential spikes in usage.
- Integrating cost forecasts into automated reports or dashboards.
Properties
| Name | Meaning |
|---|---|
| Time Start | The start date for retrieving AWS cost forecast data. Data for this date is included. |
| Time End | The end date for retrieving AWS cost forecast data. Data for this date is excluded. |
| Granularity | The level of detail for the forecast breakdown. Options: DAILY, MONTHLY, HOURLY. |
| Metrics | One or more cost metrics to include in the output. You specify these as strings representing metric names. |
Output
The node outputs JSON data containing the forecast results returned by AWS Cost Explorer. This includes predicted costs broken down according to the specified granularity and metric.
The exact structure depends on AWS's response but typically includes fields such as:
- Forecasted amounts per time interval.
- Metadata about the forecast period and metric used.
No binary data output is produced by this node.
Dependencies
- Requires valid AWS credentials with permissions to access AWS Cost Explorer.
- AWS SDK for JavaScript (
aws-sdk) is used internally. - The node expects AWS credentials configured in n8n with access key ID, secret access key, and region.
Troubleshooting
- Invalid or missing AWS credentials: Ensure that the API key credential provided has correct permissions and is active.
- Incorrect date formats: The
Time StartandTime Endmust be valid ISO date strings; otherwise, AWS will reject the request. - Unsupported operation error: If an unsupported operation name is set, the node throws an error indicating the operation is not supported.
- Empty or invalid metrics: At least one valid metric string must be provided; otherwise, the AWS API call may fail.
- API rate limits or service errors: AWS Cost Explorer may throttle requests; consider adding retry logic or reducing request frequency.