AWS Cost Explorer icon

AWS Cost Explorer

Get cost and usage data from AWS Cost Explorer

Actions2

  • Cost and Usage Actions
  • Dimension Values Actions

Overview

This node interacts with the AWS Cost Explorer service to retrieve cost-related data. Specifically, for the Dimension Values - Get operation, it fetches dimension values (such as services, linked accounts, instance types, or regions) within a specified date range. This is useful for users who want to analyze or filter their AWS cost and usage reports by specific dimensions.

Common scenarios:

  • Retrieving all AWS services used in a given period to understand which services incur costs.
  • Getting a list of linked accounts or regions contributing to the overall AWS bill.
  • Filtering cost reports based on instance types or other dimensions.

Practical example:
A finance team wants to generate a report showing all AWS services that generated costs between January 1, 2023, and January 31, 2023. Using this node, they can get the list of services (dimension values) for that period and then use those values to filter detailed cost reports.

Properties

Name Meaning
Start Date The start date of the time period to query, in YYYY-MM-DD format.
End Date The end date of the time period to query, in YYYY-MM-DD format.
Dimension The dimension to retrieve values for. Options are:
- Service
- Linked Account
- Instance Type
- Region

Output

The output is a JSON array where each item corresponds to the response from AWS Cost Explorer's GetDimensionValues API call. The structure includes:

  • A list of dimension values available for the specified dimension and time period.
  • Metadata about the request such as the time period and dimension queried.

Example snippet of the output JSON might look like:

{
  "DimensionValues": [
    {
      "Value": "AmazonEC2",
      "Attributes": {}
    },
    {
      "Value": "AmazonS3",
      "Attributes": {}
    }
  ],
  "TimePeriod": {
    "Start": "2023-01-01",
    "End": "2023-01-31"
  },
  "Dimension": "SERVICE"
}

No binary data is output by this operation.

Dependencies

  • Requires an AWS Cost Explorer API credential with appropriate permissions to access cost and usage data.
  • The node uses the official AWS SDK client for Cost Explorer (@aws-sdk/client-cost-explorer).
  • The AWS region must be specified in the credentials configuration.

Troubleshooting

  • Invalid date format: Ensure that the Start Date and End Date are provided in YYYY-MM-DD format. Incorrect formats will cause API errors.
  • Permission errors: The AWS credentials used must have permission to call GetDimensionValues. Lack of permissions will result in authorization errors.
  • Empty results: If no dimension values are returned, verify that the date range covers a period with usage and that the dimension selected is valid.
  • API rate limits: AWS Cost Explorer has API rate limits; excessive requests may lead to throttling errors. Implement retries or reduce request frequency if needed.

Links and References

Discussion