AWS Cost Explorer icon

AWS Cost Explorer

Retrieves cost and usage information from AWS

Overview

This node integrates with Amazon Web Services (AWS) Cost Explorer to retrieve cost and usage data for an AWS account. It is useful for monitoring and analyzing cloud spending over specific time periods, helping users track their AWS costs and usage patterns.

Common scenarios include:

  • Generating daily, monthly, or hourly reports of AWS costs.
  • Extracting specific cost metrics such as unblended costs, amortized costs, or usage quantities.
  • Integrating AWS cost data into workflows for budgeting, alerting, or financial analysis.

For example, a user can configure the node to fetch monthly AWS cost data between two dates, specifying which cost metrics to retrieve, and then use this data downstream in n8n for reporting or notifications.

Properties

Name Meaning
Time Start The start date for retrieving AWS costs. Data for this date is included.
Time End The end date for retrieving AWS costs. Data for this date is excluded.
Granularity The level of detail for cost breakdown. Options: DAILY (by day), MONTHLY (by month), HOURLY (by hour).
Metrics One or more cost or usage metrics to include in the output. Users specify metric names as strings.

Output

The node outputs JSON data containing the response from the AWS Cost Explorer API for the requested operation.

For the "Get Cost and Usage" operation, the JSON includes detailed cost and usage information structured according to AWS's API response format, typically including:

  • Time period covered.
  • Granularity of data.
  • Metrics values broken down by time intervals.

No binary data is output by this node.

Dependencies

  • Requires valid AWS credentials with permissions to access the AWS Cost Explorer service.
  • 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 Credentials: If AWS credentials are incorrect or lack necessary permissions, the node will fail to authenticate. Ensure the API key and secret have Cost Explorer access.
  • Date Format Issues: The Time Start and Time End must be valid date strings in the format expected by AWS (typically ISO 8601, e.g., "YYYY-MM-DD"). Incorrect formats may cause errors.
  • Unsupported Operation: Only "Get Cost and Usage" and "Get Cost Forecast" operations are supported. Selecting any other operation will throw an error.
  • Empty Metrics: The node requires at least one metric specified. Omitting metrics or providing empty values will result in errors.
  • API Limits: AWS Cost Explorer has API rate limits; excessive requests may lead to throttling errors.

Links and References

Discussion