---
title: Amazon AWS Billing and Cost Management
slug: connectors/amazon-aws-billing-and-cost-management
docTags: 
createdAt: 2026-06-09T16:29:59.619Z
---

The AWS Billing and Cost Management connector integrates with Swimlane Turbine. AWS Cost Explorer is a tool that enables you to view and analyze your costs and usage.

## Asset Setup

This integration authenticates with AWS Billing and Cost Management Connector using the following input values:

- AWS Access Key ID: A long-term AWS access key ID with access to Security Hub.
- AWS Secret Key ID: A long-term secret access key associated with the above AccessKey ID.
- Region Name: The AWS region.
- Role ARN: An ARN of an AWS IAM Role to assume.

## Capabilities

This connector provides the following capabilities:

- Get Cost and Usage

### Obtaining AWS Credentials

To use this integration, you will need to have an AWS account and obtain the necessary AWS credentials. You can obtain these credentials by following the steps below:

- Log in to your AWS account and navigate to the IAM console.
- In the left navigation pane, click on the "Users" tab and select the user for which you want to create credentials.
- Click on the "Security credentials" tab, and then click on the "Create access key".
- Make sure to save the access key ID and secret access key in a secure location, as you will not be able to see the secret access key again after this step.

## Tasks Setup

### Get Cost and Usage

### Filter

There are two patterns:

- **Simple dimension values**
  - There are three types of simple dimension values: CostCategories, Tags, and Dimensions.
    - Specify the CostCategories field to define a filter that acts on Cost Categories.
    - Specify the Tags field to define a filter that acts on Cost Allocation Tags.
    - Specify the Dimensions field to define a filter that acts on the DimensionValues.
  - For each filter type, you can set the dimension name and values for the filters that you plan to use.
    - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1. For GetRightsizingRecommendation, the Region is a full name (for example, REGION==US East (N. Virginia).
    - The corresponding Expression for this example is as follows:
    - Lists of dimension values are combined with OR when applying the filter.

### Example

```javascript
  {
    "Dimensions": {
      "Key": "LINKED_ACCOUNT_NAME",
      "MatchOptions": [
        "STARTS_WITH"
      ],
      "Values": [
        "a"
      ]
    }
  }
```

- You can also set different match options to further control how the filter behaves. Not all APIs support match options. Refer to the documentation for each specific API to see what is supported.
  - For example, you can filter for linked account names that start with "a".
  - The corresponding Expression for this example is as follows:

### Example

```javascript
  {
    "Dimensions": {
      "Key": "LINKED_ACCOUNT_NAME",
      "MatchOptions": [
        "STARTS_WITH"
      ],
      "Values": [
        "a"
      ]
    }
  }
```

- **Compound Expression** types with logical operations.
  - You can use multiple Expression types and the logical operators AND/OR/NOT to create a list of one or more Expression objects. By doing this, you can filter by more advanced options.
  - For example, you can filter by ((REGION == us-east-1 OR REGION == us-west-1) OR (TAG.Type == Type1)) AND (USAGE\_TYPE != DataTransfer).
  - The corresponding Expression for this example is as follows:

### Example

```javascript
  {
    "And": [
      {
        "Or": [
          {
            "Dimensions": {
              "Key": "REGION",
              "Values": [
                "us-east-1",
                "us-west-1"
              ]
            }
          },
          {
            "Tags": {
              "Key": "TagName",
              "Values": [
                "Value1"
              ]
            }
          }
        ]
      },
      {
        "Not": {
          "Dimensions": {
            "Key": "USAGE_TYPE",
            "Values": [
              "DataTransfer"
            ]
          }
        }
      }
    ]
  }
```

[For more information about Filter, Click here!](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html)

## Notes

- [AWS Account and Access Keys](https://docs.aws.amazon.com/powershell/latest/userguide/pstools-appendix-sign-up.html)
- [Boto3 AWS Billing and Cost Management Documentation](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ce/client/get_cost_and_usage.html#CostExplorer.Client.get_cost_and_usage)
- [For more information about AWS Billing and Cost Management, Click here!](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetCostAndUsage.html)

# Configurations

## AWS Billing and Cost Management Authentication

Authenticates using AWS credentials

### Configuration Parameters

| **Parameter**            | **Description**                                         | **Type** | **Required** |
| ------------------------ | ------------------------------------------------------- | -------- | ------------ |
| aws\_access\_key\_id     | A specific long-term AWS access key ID                  | string   | Required     |
| aws\_secret\_access\_key | A specific long-term AWS secret access key              | string   | Required     |
| region\_name             | The AWS Region where you want to create new connections | string   | Required     |
| role\_arn                | Role ARN                                                | string   | Required     |

# Actions

## Get Cost and Usage

Retrieves cost and usage metrics for your account. You can specify which cost and usage-related metric that you want the request to return.

### Input

| **Argument Name**                    | **Type** | **Required** | **Description**                                                                                                                                                                                                               |
| ------------------------------------ | -------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TimePeriod`                         | object   | Required     | Sets the start date and end date for retrieving Amazon Web Services costs. The start date is inclusive, but the end date is exclusive.                                                                                        |
| `TimePeriod.Start`                   | string   | Required     | Sets the start date and end date for retrieving Amazon Web Services costs.                                                                                                                                                    |
| `TimePeriod.End`                     | string   | Required     | The end of the time period. The end date is exclusive.                                                                                                                                                                        |
| `Granularity`                        | string   | Required     | Sets the Amazon Web Services cost granularity to MONTHLY or DAILY, or HOURLY. If Granularity isn’t set, the response object doesn’t include the Granularity, either MONTHLY or DAILY, or HOURLY.                              |
| `Filter`                             | object   | Optional     | Filters Amazon Web Services costs by different dimensions.                                                                                                                                                                    |
| `Filter.And`                         | array    | Optional     | Return results that match both Dimension objects.                                                                                                                                                                             |
| `Filter.Or`                          | array    | Optional     | Return results that match either Dimension object.                                                                                                                                                                            |
| `Filter.Not`                         | object   | Optional     | Return results that don’t match a Dimension object.                                                                                                                                                                           |
| `Filter.Dimensions`                  | object   | Optional     | The specific Dimension to use for Expression.                                                                                                                                                                                 |
| `Filter.Dimensions.Key`              | string   | Optional     | The names of the metadata types that you can use to filter and group your results.                                                                                                                                            |
| `Filter.Dimensions.MatchOptions`     | array    | Optional     | The match options that you can use to filter your results. MatchOptions is only applicable for actions related to Cost Category and Anomaly Subscriptions. The default values for MatchOptions is EQUALS and CASE\_SENSITIVE. |
| `Filter.Dimensions.Values`           | array    | Optional     | The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.                                                                                                |
| `Filter.CostCategories`              | object   | Optional     | The filter that’s based on CostCategory values.                                                                                                                                                                               |
| `Filter.CostCategories.Key`          | string   | Optional     | The unique name of the Cost Category.                                                                                                                                                                                         |
| `Filter.CostCategories.MatchOptions` | array    | Optional     | The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for MatchOptions is EQUALS and CASE\_SENSITIVE.                           |
| `Filter.CostCategories.Values`       | array    | Optional     | The specific value of the Cost Category.                                                                                                                                                                                      |
| `Filter.Tags`                        | object   | Optional     | The specific Tag to use for Expression.                                                                                                                                                                                       |
| `Filter.Tags.Key`                    | string   | Optional     | The key for the tag.                                                                                                                                                                                                          |
| `Filter.Tags.MatchOptions`           | array    | Optional     | The match options that you can use to filter your results. MatchOptions is only applicable for actions related to Cost Category. The default values for MatchOptions are EQUALS and CASE\_SENSITIVE.                          |
| `Filter.Tags.Values`                 | array    | Optional     | Value for the parameter                                                                                                                                                                                                       |
| `Metrics`                            | array    | Required     | Which metrics are returned in the query.                                                                                                                                                                                      |
| `GroupBy`                            | array    | Optional     | You can group Amazon Web Services costs using up to two different groups, either dimensions, tag keys, cost categories, or any two group by types.                                                                            |
| `GroupBy.Type`                       | string   | Optional     | It represents the type of group.                                                                                                                                                                                              |
| `GroupBy.Key`                        | string   | Optional     | It represents a key for a specified group.                                                                                                                                                                                    |
| `NextPageToken`                      | string   | Optional     | he token to retrieve the next set of results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.                                                      |

### Input Example

`{"TimePeriod":{"Start":"2017-01-01","End":"2017-05-01"},"Granularity":"DAILY","Filter":{"And":[{}],"Or":[{}],"Not":{},"Dimensions":{"Key":"string","MatchOptions":["string"],"Values":["string"]},"CostCategories":{"Key":"string","MatchOptions":["string"],"Values":["string"]},"Tags":{"Key":"string","MatchOptions":["string"],"Values":["string"]}},"Metrics":["AmortizedCost"],"GroupBy":[{"Type":"DIMENSION","Key":"string"}],"NextPageToken":"string"}`

### Output

| **Parameter**                                | **Type** | **Description**                    |
| -------------------------------------------- | -------- | ---------------------------------- |
| `NextPageToken`                              | string   | Output field: NextPageToken        |
| `GroupDefinitions`                           | array    | Output field: GroupDefinitions     |
| `GroupDefinitions.Type`                      | string   | Type of the resource               |
| `GroupDefinitions.Key`                       | string   | Output field: GroupDefinitions.Key |
| `ResultsByTime`                              | array    | Result of the operation            |
| `ResultsByTime.TimePeriod`                   | object   | Result of the operation            |
| `ResultsByTime.TimePeriod.Start`             | string   | Result of the operation            |
| `ResultsByTime.TimePeriod.End`               | string   | Result of the operation            |
| `ResultsByTime.Total`                        | object   | Result of the operation            |
| `ResultsByTime.Total.string`                 | object   | Result of the operation            |
| `ResultsByTime.Total.string.Amount`          | string   | Result of the operation            |
| `ResultsByTime.Total.string.Unit`            | string   | Result of the operation            |
| `ResultsByTime.Groups`                       | array    | Result of the operation            |
| `ResultsByTime.Groups.Keys`                  | array    | Result of the operation            |
| `ResultsByTime.Groups.Metrics`               | object   | Result of the operation            |
| `ResultsByTime.Groups.Metrics.string`        | object   | Result of the operation            |
| `ResultsByTime.Groups.Metrics.string.Amount` | string   | Result of the operation            |
| `ResultsByTime.Groups.Metrics.string.Unit`   | string   | Result of the operation            |
| `ResultsByTime.Estimated`                    | string   | Result of the operation            |
| `DimensionValueAttributes`                   | array    | Value for the parameter            |
| `DimensionValueAttributes.Value`             | string   | Value for the parameter            |
| `DimensionValueAttributes.Attributes`        | object   | Value for the parameter            |
| `DimensionValueAttributes.Attributes.string` | string   | Value for the parameter            |

### Output Example

`{"NextPageToken":"string","GroupDefinitions":[{"Type":"DIMENSION|TAG|COST_CATEGORY","Key":"string"}],"ResultsByTime":[{"TimePeriod":{},"Total":{},"Groups":[],"Estimated":"True|False"}],"DimensionValueAttributes":[{"Value":"string","Attributes":{}}]}`

# Response Headers

| **Header**   | **Description**                                       | **Example**                   |
| ------------ | ----------------------------------------------------- | ----------------------------- |
| Content-Type | The media type of the resource                        | application/json              |
| Date         | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |
