[ aws . ce ]

get-dimension-values

Description

Retrieves all available filter values for a specified filter over a period of time. You can search the dimension values for an arbitrary string.

See also: AWS API Documentation

Synopsis

  get-dimension-values
[--search-string <value>]
--time-period <value>
--dimension <value>
[--dimension-key <value>]
[--context <value>]
[--filter <value>]
[--sort-by <value>]
[--billing-view-arn <value>]
[--max-results <value>]
[--next-page-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]

Options

--search-string (string)

The value that you want to search the filter values for.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

--time-period (structure) [required]

The start date and end date for retrieving the dimension values. The start date is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01 , then the cost and usage data is retrieved from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01 .

Start -> (string) [required]

The beginning of the time period. The start date is inclusive. For example, if start is 2017-01-01 , Amazon Web Services retrieves cost and usage data starting at 2017-01-01 up to the end date. The start date must be equal to or no later than the current date to avoid a validation error.

Constraints:

  • min: 0
  • max: 40
  • pattern: (\d{4}-\d{2}-\d{2})(T\d{2}:\d{2}:\d{2}Z)?

End -> (string) [required]

The end of the time period. The end date is exclusive. For example, if end is 2017-05-01 , Amazon Web Services retrieves cost and usage data from the start date up to, but not including, 2017-05-01 .

Constraints:

  • min: 0
  • max: 40
  • pattern: (\d{4}-\d{2}-\d{2})(T\d{2}:\d{2}:\d{2}Z)?

Shorthand Syntax:

Start=string,End=string

JSON Syntax:

{
  "Start": "string",
  "End": "string"
}

--dimension (string) [required]

The name of the dimension. Each Dimension is available for a different Context . For more information, see Context . LINK_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule .

PRODUCT_ATTRIBUTE returns the product attribute keys that are available for your costs of supported services, or the values of the key that you specify in DimensionKey . PRODUCT_ATTRIBUTE is supported only in the COST_AND_USAGE context.

IAM_PRINCIPAL , IDENTITY_CENTER_GROUP , and IDENTITY_CENTER_USER return values from your artificial intelligence (AI) usage only.

Possible values:

  • AZ
  • INSTANCE_TYPE
  • LINKED_ACCOUNT
  • PAYER_ACCOUNT
  • LINKED_ACCOUNT_NAME
  • OPERATION
  • PURCHASE_TYPE
  • REGION
  • SERVICE
  • SERVICE_CODE
  • USAGE_TYPE
  • USAGE_TYPE_GROUP
  • RECORD_TYPE
  • OPERATING_SYSTEM
  • TENANCY
  • SCOPE
  • PLATFORM
  • SUBSCRIPTION_ID
  • LEGAL_ENTITY_NAME
  • DEPLOYMENT_OPTION
  • DATABASE_ENGINE
  • CACHE_ENGINE
  • INSTANCE_TYPE_FAMILY
  • BILLING_ENTITY
  • RESERVATION_ID
  • RESOURCE_ID
  • RIGHTSIZING_TYPE
  • SAVINGS_PLANS_TYPE
  • SAVINGS_PLAN_ARN
  • PAYMENT_OPTION
  • AGREEMENT_END_DATE_TIME_AFTER
  • AGREEMENT_END_DATE_TIME_BEFORE
  • INVOICING_ENTITY
  • ANOMALY_TOTAL_IMPACT_ABSOLUTE
  • ANOMALY_TOTAL_IMPACT_PERCENTAGE
  • PRODUCT_ATTRIBUTE
  • IDENTITY_CENTER_USER
  • IAM_PRINCIPAL
  • IDENTITY_CENTER_GROUP

--dimension-key (string)

The product attribute key to return values for, such as model . If you omit DimensionKey or set it to an empty string, the response lists the product attribute keys that are available for your costs of supported services instead. For the supported services, see ProductAttributeValues .

If you specify a key, the response lists the values of that key. If some of your costs have no value for the key, the response includes an empty-string value. Keys are case-sensitive, and a key that doesn’t exist returns no values other than an empty string.

You can specify DimensionKey only when Dimension is PRODUCT_ATTRIBUTE . If you also specify SortBy , DimensionKey is required. As a result, you can’t list product attribute keys when you use SortBy .

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

--context (string)

The context for the call to GetDimensionValues . This can be COST_AND_USAGE , RESERVATIONS , or SAVINGS_PLANS . The default value is COST_AND_USAGE . If the context is set to RESERVATIONS , the resulting dimension values can be used in the GetReservationUtilization operation. GetReservationCoverage filters match cost and usage data, so use COST_AND_USAGE values for them. If the context is set to SAVINGS_PLANS , the resulting dimension values can be used in the GetSavingsPlansUtilization and GetSavingsPlansUtilizationDetails operations. If the context is set to COST_AND_USAGE , the resulting dimension values can be used in the GetCostAndUsage operation.

If you set the context to COST_AND_USAGE , you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a .
  • BILLING_ENTITY - The Amazon Web Services seller that your account is with. Possible values are the following: - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web Services services. - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that’s an acting reseller for Amazon Web Services services in India. - Amazon Web Services Marketplace: The entity that supports the sale of solutions that are built on Amazon Web Services by third-party software providers.
  • CACHE_ENGINE - The Amazon ElastiCache engine. Examples are Redis , Valkey , and Memcached .
  • DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Examples are Single-AZ and Multi-AZ .
  • DATABASE_ENGINE - The Amazon Relational Database Service database engine. Examples are Aurora MySQL , Aurora PostgreSQL , and MySQL .
  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge .
  • INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit different use cases. The value is the family code, such as m5 or c6g for Amazon EC2. The casing of the code follows each service’s product catalog, for example R6G for Amazon Relational Database Service.
  • INVOICING_ENTITY - The name of the entity that issues the Amazon Web Services invoice.
  • LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
  • OPERATING_SYSTEM - The operating system. Examples are Linux/UNIX , Windows (Amazon VPC) , and Red Hat Enterprise Linux .
  • OPERATION - The action performed. Examples include RunInstance and CreateBucket .
  • PLATFORM - The operating system or platform of the usage. Examples are Linux/UNIX , Windows (Amazon VPC) , and Red Hat Enterprise Linux .
  • PRODUCT_ATTRIBUTE - The product attributes of supported services, such as the model provider or the model for Amazon Bedrock.
  • PURCHASE_TYPE - The reservation type of the purchase that this usage is related to. Examples include On Demand Instances , Standard Reserved Instances , Spot Instances , and Savings Plans .
  • RESERVATION_ID - The unique identifier for an Amazon Web Services Reservation Instance.
  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
  • SAVINGS_PLANS_TYPE - Type of Savings Plans. Examples are ComputeSavingsPlans and EC2InstanceSavingsPlans .
  • SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
  • TENANCY - The tenancy of a resource. Examples are Shared , Dedicated , and Host .
  • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.
  • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
  • REGION - The Amazon Web Services Region.
  • RECORD_TYPE - The different types of charges such as Reserved Instance (RI) fees, usage costs, tax refunds, and credits. Examples include Usage , Credit , Tax , Recurring , Upfront , and Support .
  • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature that is available for the last 14 days, for the services that you opt in to in Cost Management Console preferences.
  • IAM_PRINCIPAL – The IAM principal that made your AI requests. Cost Explorer removes the session name from an assumed role, and keeps it for an IAM Identity Center session.
  • IDENTITY_CENTER_GROUP – The IAM Identity Center group ID on your AI usage. Your usage counts under every group that its IAM Identity Center user belongs to.
  • IDENTITY_CENTER_USER – The IAM Identity Center user ID on your AI usage.

Dimension values are case-sensitive and must match exactly when you use them in a filter. Use GetDimensionValues to list the values that are available for your account.

If you set the context to RESERVATIONS , you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a .
  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge .
  • INSTANCE_TYPE_FAMILY - The family of the instance type. An example is m5 .
  • LINKED_ACCOUNT - The Amazon Web Services ID of the member account. The name attribute contains the full name of the member account.
  • PLATFORM - The platform of the reservation. For Amazon EC2, examples are Linux/UNIX , Windows , and Red Hat Enterprise Linux . For Amazon Relational Database Service and Amazon ElastiCache, the value is the engine, such as MySQL or Redis . These values can differ from the COST_AND_USAGE values, for example Windows instead of Windows (Amazon VPC) .
  • REGION - The Amazon Web Services Region.
  • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are Region and Availability Zone .
  • SERVICE - The Amazon Web Services service of the reservation, such as Amazon Relational Database Service.
  • TENANCY - The tenancy of the reservation. Values are Shared and Dedicated .

If you set the context to SAVINGS_PLANS , you can use the following dimensions for searching:

  • SAVINGS_PLANS_TYPE - Type of Savings Plans. Examples are ComputeSavingsPlans , EC2InstanceSavingsPlans , SageMakerSavingsPlans , and DatabaseSavingsPlans .
  • PAYMENT_OPTION - The payment option for the given Savings Plans (for example, All Upfront)
  • REGION - The Amazon Web Services Region.
  • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5 )
  • LINKED_ACCOUNT - The Amazon Web Services ID of the member account. The name attribute contains the full name of the member account.
  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.

Possible values:

  • COST_AND_USAGE
  • RESERVATIONS
  • SAVINGS_PLANS

--filter (structure)

To filter your results, use an Expression object.

The supported filter shapes depend on Context and on whether you specify SortBy :

  • COST_AND_USAGE without SortBy : a single Dimensions , Tags , or CostCategories expression, or one And of such expressions. Or , Not , and an And inside another And aren’t supported.
  • COST_AND_USAGE with SortBy : And , Or , and Not are supported, nested up to four levels.
  • RESERVATIONS and SAVINGS_PLANS : a single Dimensions expression, a Not expression that contains one Dimensions expression, or one And of such expressions. Each dimension can appear only once. Or , Tags , CostCategories , and an And inside another And aren’t supported. For RESERVATIONS , don’t specify MatchOptions . For SAVINGS_PLANS , MatchOptions can be only EQUALS , or EQUALS and CASE_SENSITIVE . SortBy isn’t supported in these contexts.

Or -> (list)

Return results that match either Dimension object.

(structure)

Use Expression to filter in various Cost Explorer APIs.

Not all Expression types are supported in each API. Refer to the documentation for each specific API to see what is supported.

There are two patterns:

  • Simple dimension values.
    • There are four types of simple dimension values: CostCategories , Tags , Dimensions , and ProductAttributes .
    • 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: { "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }
      • As shown in the previous example, lists of dimension values are combined with OR when applying the filter.
    • 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: { "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: { "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] }

Note

Because each Expression can have only one operator, the service returns an error if more than one is specified. The following example shows an Expression object that creates an error: { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } }

The following is an example of the corresponding error message: "Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"

Note

For the GetRightsizingRecommendation action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited to LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE .

For the GetReservationPurchaseRecommendation action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited to LINKED_ACCOUNT .

Or -> (list)

Return results that match either Dimension object.

( … recursive … )

And -> (list)

Return results that match both Dimension objects.

( … recursive … )

( … recursive … )Dimensions -> (structure)

The specific Dimension to use for Expression .

Key -> (string)

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule .

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions .

Use PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues . To filter or group by product attributes, use the ProductAttributes field of Expression or the PRODUCT_ATTRIBUTE group type.

Possible values:

  • AZ
  • INSTANCE_TYPE
  • LINKED_ACCOUNT
  • PAYER_ACCOUNT
  • LINKED_ACCOUNT_NAME
  • OPERATION
  • PURCHASE_TYPE
  • REGION
  • SERVICE
  • SERVICE_CODE
  • USAGE_TYPE
  • USAGE_TYPE_GROUP
  • RECORD_TYPE
  • OPERATING_SYSTEM
  • TENANCY
  • SCOPE
  • PLATFORM
  • SUBSCRIPTION_ID
  • LEGAL_ENTITY_NAME
  • DEPLOYMENT_OPTION
  • DATABASE_ENGINE
  • CACHE_ENGINE
  • INSTANCE_TYPE_FAMILY
  • BILLING_ENTITY
  • RESERVATION_ID
  • RESOURCE_ID
  • RIGHTSIZING_TYPE
  • SAVINGS_PLANS_TYPE
  • SAVINGS_PLAN_ARN
  • PAYMENT_OPTION
  • AGREEMENT_END_DATE_TIME_AFTER
  • AGREEMENT_END_DATE_TIME_BEFORE
  • INVOICING_ENTITY
  • ANOMALY_TOTAL_IMPACT_ABSOLUTE
  • ANOMALY_TOTAL_IMPACT_PERCENTAGE
  • PRODUCT_ATTRIBUTE
  • IDENTITY_CENTER_USER
  • IAM_PRINCIPAL
  • IDENTITY_CENTER_GROUP

Values -> (list)

The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results.

The supported MatchOptions values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, for Dimensions filters, GetCostAndUsage supports only EQUALS and CASE_SENSITIVE . Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Tags -> (structure)

The specific Tag to use for Expression .

Key -> (string)

The key for the tag.

Specify user-defined tag keys without the user: prefix. For example, use team , not user:team . Tag keys that Amazon Web Services generates keep their aws: prefix.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

Values -> (list)

The specific value of the tag.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

CostCategories -> (structure)

The filter that’s based on CostCategory values.

Key -> (string)

The unique name of the cost category.

Constraints:

  • min: 1
  • max: 50
  • pattern: ^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$

Values -> (list)

The specific value of the cost category.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

ProductAttributes -> (structure)

The filter that’s based on ProductAttributeValues . Use it to filter the costs of supported services, such as Amazon Bedrock, by product attributes. The following operations support this filter: GetCostAndUsage , GetCostAndUsageWithResources , GetDimensionValues (in the COST_AND_USAGE context), GetTags , and GetCostCategories . For the supported services and keys, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Key -> (string) [required]

The name of the product attribute, such as model . The keys that are available depend on the service. For the keys of each supported service, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Keys are case-sensitive. A key that doesn’t exist doesn’t return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services.

Constraints:

  • min: 0
  • max: 1024
  • pattern: ^([a-zA-Z][a-zA-Z0-9]*)?$

Values -> (list)

The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE and DimensionKey set to the key.

To match costs that have no value for the key, set MatchOptions to ABSENT and omit Values . Otherwise, Values is required.

Constraints:

  • min: 1
  • max: 6000

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. Valid values:

  • EQUALS - Matches the values that you specify.
  • ABSENT - Matches costs that have no value for the key. Omit Values .
  • CASE_SENSITIVE - Use only with EQUALS . Values are always matched case-sensitively.

Default values are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

And -> (list)

Return results that match both Dimension objects.

(structure)

Use Expression to filter in various Cost Explorer APIs.

Not all Expression types are supported in each API. Refer to the documentation for each specific API to see what is supported.

There are two patterns:

  • Simple dimension values.
    • There are four types of simple dimension values: CostCategories , Tags , Dimensions , and ProductAttributes .
    • 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: { "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } }
      • As shown in the previous example, lists of dimension values are combined with OR when applying the filter.
    • 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: { "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: { "And": [ {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] }

Note

Because each Expression can have only one operator, the service returns an error if more than one is specified. The following example shows an Expression object that creates an error: { "And": [ ... ], "Dimensions": { "Key": "USAGE_TYPE", "Values": [ "DataTransfer" ] } }

The following is an example of the corresponding error message: "Expression has more than one roots. Only one root operator is allowed for each expression: And, Or, Not, Dimensions, Tags, CostCategories"

Note

For the GetRightsizingRecommendation action, a combination of OR and NOT isn’t supported. OR isn’t supported between different dimensions, or dimensions and tags. NOT operators aren’t supported. Dimensions are also limited to LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE .

For the GetReservationPurchaseRecommendation action, only NOT is supported. AND and OR aren’t supported. Dimensions are limited to LINKED_ACCOUNT .

Or -> (list)

Return results that match either Dimension object.

( … recursive … )

And -> (list)

Return results that match both Dimension objects.

( … recursive … )

( … recursive … )Dimensions -> (structure)

The specific Dimension to use for Expression .

Key -> (string)

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule .

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions .

Use PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues . To filter or group by product attributes, use the ProductAttributes field of Expression or the PRODUCT_ATTRIBUTE group type.

Possible values:

  • AZ
  • INSTANCE_TYPE
  • LINKED_ACCOUNT
  • PAYER_ACCOUNT
  • LINKED_ACCOUNT_NAME
  • OPERATION
  • PURCHASE_TYPE
  • REGION
  • SERVICE
  • SERVICE_CODE
  • USAGE_TYPE
  • USAGE_TYPE_GROUP
  • RECORD_TYPE
  • OPERATING_SYSTEM
  • TENANCY
  • SCOPE
  • PLATFORM
  • SUBSCRIPTION_ID
  • LEGAL_ENTITY_NAME
  • DEPLOYMENT_OPTION
  • DATABASE_ENGINE
  • CACHE_ENGINE
  • INSTANCE_TYPE_FAMILY
  • BILLING_ENTITY
  • RESERVATION_ID
  • RESOURCE_ID
  • RIGHTSIZING_TYPE
  • SAVINGS_PLANS_TYPE
  • SAVINGS_PLAN_ARN
  • PAYMENT_OPTION
  • AGREEMENT_END_DATE_TIME_AFTER
  • AGREEMENT_END_DATE_TIME_BEFORE
  • INVOICING_ENTITY
  • ANOMALY_TOTAL_IMPACT_ABSOLUTE
  • ANOMALY_TOTAL_IMPACT_PERCENTAGE
  • PRODUCT_ATTRIBUTE
  • IDENTITY_CENTER_USER
  • IAM_PRINCIPAL
  • IDENTITY_CENTER_GROUP

Values -> (list)

The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results.

The supported MatchOptions values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, for Dimensions filters, GetCostAndUsage supports only EQUALS and CASE_SENSITIVE . Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Tags -> (structure)

The specific Tag to use for Expression .

Key -> (string)

The key for the tag.

Specify user-defined tag keys without the user: prefix. For example, use team , not user:team . Tag keys that Amazon Web Services generates keep their aws: prefix.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

Values -> (list)

The specific value of the tag.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

CostCategories -> (structure)

The filter that’s based on CostCategory values.

Key -> (string)

The unique name of the cost category.

Constraints:

  • min: 1
  • max: 50
  • pattern: ^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$

Values -> (list)

The specific value of the cost category.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

ProductAttributes -> (structure)

The filter that’s based on ProductAttributeValues . Use it to filter the costs of supported services, such as Amazon Bedrock, by product attributes. The following operations support this filter: GetCostAndUsage , GetCostAndUsageWithResources , GetDimensionValues (in the COST_AND_USAGE context), GetTags , and GetCostCategories . For the supported services and keys, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Key -> (string) [required]

The name of the product attribute, such as model . The keys that are available depend on the service. For the keys of each supported service, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Keys are case-sensitive. A key that doesn’t exist doesn’t return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services.

Constraints:

  • min: 0
  • max: 1024
  • pattern: ^([a-zA-Z][a-zA-Z0-9]*)?$

Values -> (list)

The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE and DimensionKey set to the key.

To match costs that have no value for the key, set MatchOptions to ABSENT and omit Values . Otherwise, Values is required.

Constraints:

  • min: 1
  • max: 6000

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. Valid values:

  • EQUALS - Matches the values that you specify.
  • ABSENT - Matches costs that have no value for the key. Omit Values .
  • CASE_SENSITIVE - Use only with EQUALS . Values are always matched case-sensitively.

Default values are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Not -> (structure)

Return results that don’t match a Dimension object.

Or -> (list)

Return results that match either Dimension object.

( … recursive … )

And -> (list)

Return results that match both Dimension objects.

( … recursive … )

( … recursive … )Dimensions -> (structure)

The specific Dimension to use for Expression .

Key -> (string)

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule .

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions .

Use PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues . To filter or group by product attributes, use the ProductAttributes field of Expression or the PRODUCT_ATTRIBUTE group type.

Possible values:

  • AZ
  • INSTANCE_TYPE
  • LINKED_ACCOUNT
  • PAYER_ACCOUNT
  • LINKED_ACCOUNT_NAME
  • OPERATION
  • PURCHASE_TYPE
  • REGION
  • SERVICE
  • SERVICE_CODE
  • USAGE_TYPE
  • USAGE_TYPE_GROUP
  • RECORD_TYPE
  • OPERATING_SYSTEM
  • TENANCY
  • SCOPE
  • PLATFORM
  • SUBSCRIPTION_ID
  • LEGAL_ENTITY_NAME
  • DEPLOYMENT_OPTION
  • DATABASE_ENGINE
  • CACHE_ENGINE
  • INSTANCE_TYPE_FAMILY
  • BILLING_ENTITY
  • RESERVATION_ID
  • RESOURCE_ID
  • RIGHTSIZING_TYPE
  • SAVINGS_PLANS_TYPE
  • SAVINGS_PLAN_ARN
  • PAYMENT_OPTION
  • AGREEMENT_END_DATE_TIME_AFTER
  • AGREEMENT_END_DATE_TIME_BEFORE
  • INVOICING_ENTITY
  • ANOMALY_TOTAL_IMPACT_ABSOLUTE
  • ANOMALY_TOTAL_IMPACT_PERCENTAGE
  • PRODUCT_ATTRIBUTE
  • IDENTITY_CENTER_USER
  • IAM_PRINCIPAL
  • IDENTITY_CENTER_GROUP

Values -> (list)

The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results.

The supported MatchOptions values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, for Dimensions filters, GetCostAndUsage supports only EQUALS and CASE_SENSITIVE . Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Tags -> (structure)

The specific Tag to use for Expression .

Key -> (string)

The key for the tag.

Specify user-defined tag keys without the user: prefix. For example, use team , not user:team . Tag keys that Amazon Web Services generates keep their aws: prefix.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

Values -> (list)

The specific value of the tag.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

CostCategories -> (structure)

The filter that’s based on CostCategory values.

Key -> (string)

The unique name of the cost category.

Constraints:

  • min: 1
  • max: 50
  • pattern: ^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$

Values -> (list)

The specific value of the cost category.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

ProductAttributes -> (structure)

The filter that’s based on ProductAttributeValues . Use it to filter the costs of supported services, such as Amazon Bedrock, by product attributes. The following operations support this filter: GetCostAndUsage , GetCostAndUsageWithResources , GetDimensionValues (in the COST_AND_USAGE context), GetTags , and GetCostCategories . For the supported services and keys, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Key -> (string) [required]

The name of the product attribute, such as model . The keys that are available depend on the service. For the keys of each supported service, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Keys are case-sensitive. A key that doesn’t exist doesn’t return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services.

Constraints:

  • min: 0
  • max: 1024
  • pattern: ^([a-zA-Z][a-zA-Z0-9]*)?$

Values -> (list)

The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE and DimensionKey set to the key.

To match costs that have no value for the key, set MatchOptions to ABSENT and omit Values . Otherwise, Values is required.

Constraints:

  • min: 1
  • max: 6000

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. Valid values:

  • EQUALS - Matches the values that you specify.
  • ABSENT - Matches costs that have no value for the key. Omit Values .
  • CASE_SENSITIVE - Use only with EQUALS . Values are always matched case-sensitively.

Default values are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Dimensions -> (structure)

The specific Dimension to use for Expression .

Key -> (string)

The names of the metadata types that you can use to filter and group your results. For example, AZ returns a list of Availability Zones.

Not all dimensions are supported in each API. Refer to the documentation for each specific API to see what is supported.

LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in CostCategoryRule .

ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be used in AnomalySubscriptions .

Use PRODUCT_ATTRIBUTE only as the Dimension in GetDimensionValues . To filter or group by product attributes, use the ProductAttributes field of Expression or the PRODUCT_ATTRIBUTE group type.

Possible values:

  • AZ
  • INSTANCE_TYPE
  • LINKED_ACCOUNT
  • PAYER_ACCOUNT
  • LINKED_ACCOUNT_NAME
  • OPERATION
  • PURCHASE_TYPE
  • REGION
  • SERVICE
  • SERVICE_CODE
  • USAGE_TYPE
  • USAGE_TYPE_GROUP
  • RECORD_TYPE
  • OPERATING_SYSTEM
  • TENANCY
  • SCOPE
  • PLATFORM
  • SUBSCRIPTION_ID
  • LEGAL_ENTITY_NAME
  • DEPLOYMENT_OPTION
  • DATABASE_ENGINE
  • CACHE_ENGINE
  • INSTANCE_TYPE_FAMILY
  • BILLING_ENTITY
  • RESERVATION_ID
  • RESOURCE_ID
  • RIGHTSIZING_TYPE
  • SAVINGS_PLANS_TYPE
  • SAVINGS_PLAN_ARN
  • PAYMENT_OPTION
  • AGREEMENT_END_DATE_TIME_AFTER
  • AGREEMENT_END_DATE_TIME_BEFORE
  • INVOICING_ENTITY
  • ANOMALY_TOTAL_IMPACT_ABSOLUTE
  • ANOMALY_TOTAL_IMPACT_PERCENTAGE
  • PRODUCT_ATTRIBUTE
  • IDENTITY_CENTER_USER
  • IAM_PRINCIPAL
  • IDENTITY_CENTER_GROUP

Values -> (list)

The metadata values that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results.

The supported MatchOptions values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, for Dimensions filters, GetCostAndUsage supports only EQUALS and CASE_SENSITIVE . Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

Tags -> (structure)

The specific Tag to use for Expression .

Key -> (string)

The key for the tag.

Specify user-defined tag keys without the user: prefix. For example, use team , not user:team . Tag keys that Amazon Web Services generates keep their aws: prefix.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

Values -> (list)

The specific value of the tag.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

CostCategories -> (structure)

The filter that’s based on CostCategory values.

Key -> (string)

The unique name of the cost category.

Constraints:

  • min: 1
  • max: 50
  • pattern: ^(?! )[\p{L}\p{N}\p{Z}-_]*(?<! )$

Values -> (list)

The specific value of the cost category.

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. The supported values depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, GetCostAndUsage supports the following values:

  • EQUALS - Matches values exactly.
  • ABSENT - Matches costs that don’t have a value for the key.
  • CASE_SENSITIVE - Matches values with case sensitivity.

The default values for MatchOptions are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

ProductAttributes -> (structure)

The filter that’s based on ProductAttributeValues . Use it to filter the costs of supported services, such as Amazon Bedrock, by product attributes. The following operations support this filter: GetCostAndUsage , GetCostAndUsageWithResources , GetDimensionValues (in the COST_AND_USAGE context), GetTags , and GetCostCategories . For the supported services and keys, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Key -> (string) [required]

The name of the product attribute, such as model . The keys that are available depend on the service. For the keys of each supported service, see ` ProductAttributeValues https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .

Keys are case-sensitive. A key that doesn’t exist doesn’t return an error: EQUALS matches no costs, and ABSENT matches all costs of supported services.

Constraints:

  • min: 0
  • max: 1024
  • pattern: ^([a-zA-Z][a-zA-Z0-9]*)?$

Values -> (list)

The specific values of the product attribute, such as Claude Sonnet 5 for the model key. Values are matched exactly, including case. To list the values of a key, use GetDimensionValues with Dimension set to PRODUCT_ATTRIBUTE and DimensionKey set to the key.

To match costs that have no value for the key, set MatchOptions to ABSENT and omit Values . Otherwise, Values is required.

Constraints:

  • min: 1
  • max: 6000

(string)

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

MatchOptions -> (list)

The match options that you can use to filter your results. Valid values:

  • EQUALS - Matches the values that you specify.
  • ABSENT - Matches costs that have no value for the key. Omit Values .
  • CASE_SENSITIVE - Use only with EQUALS . Values are always matched case-sensitively.

Default values are EQUALS and CASE_SENSITIVE .

(string)

Possible values:

  • EQUALS
  • ABSENT
  • STARTS_WITH
  • ENDS_WITH
  • CONTAINS
  • CASE_SENSITIVE
  • CASE_INSENSITIVE
  • GREATER_THAN_OR_EQUAL

JSON Syntax:

{
  "Or": [
    {
      "Or": [
        { ... recursive ... }
        ...
      ],
      "And": [
        { ... recursive ... }
        ...
      ],
      "Not": { ... recursive ... },
      "Dimensions": {
        "Key": "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"PAYER_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE"|"PRODUCT_ATTRIBUTE"|"IDENTITY_CENTER_USER"|"IAM_PRINCIPAL"|"IDENTITY_CENTER_GROUP",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "Tags": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "CostCategories": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "ProductAttributes": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      }
    }
    ...
  ],
  "And": [
    {
      "Or": [
        { ... recursive ... }
        ...
      ],
      "And": [
        { ... recursive ... }
        ...
      ],
      "Not": { ... recursive ... },
      "Dimensions": {
        "Key": "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"PAYER_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE"|"PRODUCT_ATTRIBUTE"|"IDENTITY_CENTER_USER"|"IAM_PRINCIPAL"|"IDENTITY_CENTER_GROUP",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "Tags": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "CostCategories": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      },
      "ProductAttributes": {
        "Key": "string",
        "Values": ["string", ...],
        "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
      }
    }
    ...
  ],
  "Not": {
    "Or": [
      { ... recursive ... }
      ...
    ],
    "And": [
      { ... recursive ... }
      ...
    ],
    "Not": { ... recursive ... },
    "Dimensions": {
      "Key": "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"PAYER_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE"|"PRODUCT_ATTRIBUTE"|"IDENTITY_CENTER_USER"|"IAM_PRINCIPAL"|"IDENTITY_CENTER_GROUP",
      "Values": ["string", ...],
      "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
    },
    "Tags": {
      "Key": "string",
      "Values": ["string", ...],
      "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
    },
    "CostCategories": {
      "Key": "string",
      "Values": ["string", ...],
      "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
    },
    "ProductAttributes": {
      "Key": "string",
      "Values": ["string", ...],
      "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
    }
  },
  "Dimensions": {
    "Key": "AZ"|"INSTANCE_TYPE"|"LINKED_ACCOUNT"|"PAYER_ACCOUNT"|"LINKED_ACCOUNT_NAME"|"OPERATION"|"PURCHASE_TYPE"|"REGION"|"SERVICE"|"SERVICE_CODE"|"USAGE_TYPE"|"USAGE_TYPE_GROUP"|"RECORD_TYPE"|"OPERATING_SYSTEM"|"TENANCY"|"SCOPE"|"PLATFORM"|"SUBSCRIPTION_ID"|"LEGAL_ENTITY_NAME"|"DEPLOYMENT_OPTION"|"DATABASE_ENGINE"|"CACHE_ENGINE"|"INSTANCE_TYPE_FAMILY"|"BILLING_ENTITY"|"RESERVATION_ID"|"RESOURCE_ID"|"RIGHTSIZING_TYPE"|"SAVINGS_PLANS_TYPE"|"SAVINGS_PLAN_ARN"|"PAYMENT_OPTION"|"AGREEMENT_END_DATE_TIME_AFTER"|"AGREEMENT_END_DATE_TIME_BEFORE"|"INVOICING_ENTITY"|"ANOMALY_TOTAL_IMPACT_ABSOLUTE"|"ANOMALY_TOTAL_IMPACT_PERCENTAGE"|"PRODUCT_ATTRIBUTE"|"IDENTITY_CENTER_USER"|"IAM_PRINCIPAL"|"IDENTITY_CENTER_GROUP",
    "Values": ["string", ...],
    "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
  },
  "Tags": {
    "Key": "string",
    "Values": ["string", ...],
    "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
  },
  "CostCategories": {
    "Key": "string",
    "Values": ["string", ...],
    "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
  },
  "ProductAttributes": {
    "Key": "string",
    "Values": ["string", ...],
    "MatchOptions": ["EQUALS"|"ABSENT"|"STARTS_WITH"|"ENDS_WITH"|"CONTAINS"|"CASE_SENSITIVE"|"CASE_INSENSITIVE"|"GREATER_THAN_OR_EQUAL", ...]
  }
}

--sort-by (list)

The value that you want to sort the data by.

The key represents cost and usage metrics. The following values are supported:

  • BlendedCost
  • UnblendedCost
  • AmortizedCost
  • NetAmortizedCost
  • NetUnblendedCost
  • UsageQuantity
  • NormalizedUsageAmount
  • BilledCost
  • ContractedCost
  • ListCost
  • PublicEquivalentBilledCost
  • PublicOnDemandCost

The supported values for the SortOrder key are ASCENDING or DESCENDING .

When you specify a SortBy paramater, the context must be COST_AND_USAGE . Further, when using SortBy , NextPageToken and SearchString aren’t supported.

(structure)

The details for how to sort the data.

Key -> (string) [required]

The key that’s used to sort the data.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

SortOrder -> (string)

The order that’s used to sort the data.

Possible values:

  • ASCENDING
  • DESCENDING

Shorthand Syntax:

Key=string,SortOrder=string ...

JSON Syntax:

[
  {
    "Key": "string",
    "SortOrder": "ASCENDING"|"DESCENDING"
  }
  ...
]

--billing-view-arn (string)

The Amazon Resource Name (ARN) that uniquely identifies a specific billing view. The ARN is used to specify which particular billing view you want to interact with or retrieve information from when making API calls related to Amazon Web Services Billing and Cost Management features. The BillingViewArn can be retrieved by calling the ListBillingViews API.

Constraints:

  • min: 20
  • max: 2048
  • pattern: ^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[-a-zA-Z0-9/:_+=.-@]{1,43}$

--max-results (integer)

The maximum number of objects that are returned for this request. If MaxResults isn’t specified with SortBy, the request returns 1000 results as the default value for this parameter. This field takes effect only when you specify SortBy in the request. If you don’t specify SortBy, Cost Explorer ignores MaxResults.

For GetDimensionValues , MaxResults has an upper limit of 1000.

Constraints:

  • min: 1

--next-page-token (string)

The 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.

Constraints:

  • min: 0
  • max: 8192
  • pattern: [\S\s]*

--cli-input-json | --cli-input-yaml (string) Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.

--generate-cli-skeleton (string) Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

Global Options

--debug (boolean)

Turn on debug logging.

--endpoint-url (string)

Override command’s default URL with the given URL.

--no-verify-ssl (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

--no-paginate (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

--output (string)

The formatting style for command output.

  • json
  • text
  • table
  • yaml
  • yaml-stream
  • off

--query (string)

A JMESPath query to use in filtering the response data.

--profile (string)

Use a specific profile from your credential file.

--region (string)

The region to use. Overrides config/env settings.

--version (string)

Display the version of this tool.

--color (string)

Turn on/off color output.

  • on
  • off
  • auto

--no-sign-request (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

--ca-bundle (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

--cli-read-timeout (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

--cli-connect-timeout (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

--cli-binary-format (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.

  • base64
  • raw-in-base64-out

--no-cli-pager (boolean)

Disable cli pager for output.

--cli-auto-prompt (boolean)

Automatically prompt for CLI input parameters.

--no-cli-auto-prompt (boolean)

Disable automatically prompt for CLI input parameters.

--cli-error-format (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

  • legacy
  • json
  • yaml
  • text
  • table
  • enhanced

--help (boolean)

Display help for the command/subcommand.

Examples

Note

To use the following examples, you must have the AWS CLI installed and configured. See the Getting started guide in the AWS CLI User Guide for more information.

Unless otherwise stated, all examples have unix-like quotation rules. These examples will need to be adapted to your terminal’s quoting rules. See Using quotation marks with strings in the AWS CLI User Guide .

To retrieve the tags for the dimension SERVICE, with a value of “Elastic”

The following get-dimension-values example retrieves the tags for the dimension SERVICE, with a value of “Elastic” for January 01 2017 through May 18 2017.

aws ce get-dimension-values \
    --search-string Elastic \
    --time-period Start=2017-01-01,End=2017-05-18 \
    --dimension SERVICE

Output:

{
    "TotalSize": 6,
    "DimensionValues": [
        {
            "Attributes": {},
            "Value": "Amazon ElastiCache"
        },
        {
            "Attributes": {},
            "Value": "EC2 - Other"
        },
        {
            "Attributes": {},
            "Value": "Amazon Elastic Compute Cloud - Compute"
        },
        {
            "Attributes": {},
            "Value": "Amazon Elastic Load Balancing"
        },
        {
            "Attributes": {},
            "Value": "Amazon Elastic MapReduce"
        },
        {
            "Attributes": {},
            "Value": "Amazon Elasticsearch Service"
        }
    ],
    "ReturnSize": 6
}

For more information, see Filtering the data that you want to view in the AWS Cost Management User Guide.

Output

DimensionValues -> (list)

The dimension values that match your request. Some dimensions are available only for a specific context.

If you set the context to COST_AND_USAGE , you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a .
  • DATABASE_ENGINE - The Amazon Relational Database Service database engine. Examples are Aurora MySQL , Aurora PostgreSQL , and MySQL .
  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge .
  • LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web Services services, such as Amazon Web Services.
  • LINKED_ACCOUNT - The description in the attribute map that includes the full name of the member account. The value field contains the Amazon Web Services ID of the member account.
  • OPERATING_SYSTEM - The operating system. Examples are Linux/UNIX , Windows (Amazon VPC) , and Red Hat Enterprise Linux .
  • OPERATION - The action performed. Examples include RunInstance and CreateBucket .
  • PLATFORM - The operating system or platform of the usage. Examples are Linux/UNIX , Windows (Amazon VPC) , and Red Hat Enterprise Linux .
  • PURCHASE_TYPE - The reservation type of the purchase to which this usage is related. Examples include On Demand Instances , Standard Reserved Instances , Spot Instances , and Savings Plans .
  • SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
  • USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the GetDimensionValues operation includes a unit attribute. Examples include GB and Hrs.
  • USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon EC2: CloudWatch – Alarms. The response for this operation includes a unit attribute.
  • RECORD_TYPE - The different types of charges such as RI fees, usage costs, tax refunds, and credits. Examples include Usage , Credit , Tax , Recurring , Upfront , and Support .
  • RESOURCE_ID - The unique identifier of the resource. ResourceId is an opt-in feature that is available for the last 14 days. You can opt in by enabling resource-level data for the services that you want in Cost Management Console preferences.

If you set the context to RESERVATIONS , you can use the following dimensions for searching:

  • AZ - The Availability Zone. An example is us-east-1a .
  • INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge .
  • INSTANCE_TYPE_FAMILY - The family of the instance type. An example is m5 .
  • LINKED_ACCOUNT - The Amazon Web Services ID of the member account. The name attribute contains the full name of the member account.
  • PLATFORM - The platform of the reservation. For Amazon EC2, examples are Linux/UNIX , Windows , and Red Hat Enterprise Linux . For Amazon Relational Database Service and Amazon ElastiCache, the value is the engine, such as MySQL or Redis . These values can differ from the COST_AND_USAGE values, for example Windows instead of Windows (Amazon VPC) .
  • REGION - The Amazon Web Services Region.
  • SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are Region and Availability Zone .
  • SERVICE - The Amazon Web Services service of the reservation, such as Amazon Relational Database Service.
  • TENANCY - The tenancy of the reservation. Values are Shared and Dedicated .

If you set the context to SAVINGS_PLANS , you can use the following dimensions for searching:

  • SAVINGS_PLANS_TYPE - Type of Savings Plans. Examples are ComputeSavingsPlans , EC2InstanceSavingsPlans , SageMakerSavingsPlans , and DatabaseSavingsPlans .
  • PAYMENT_OPTION - Payment option for the given Savings Plans (for example, All Upfront)
  • REGION - The Amazon Web Services Region.
  • INSTANCE_TYPE_FAMILY - The family of instances (For example, m5 )
  • LINKED_ACCOUNT - The Amazon Web Services ID of the member account. The name attribute contains the full name of the member account.
  • SAVINGS_PLAN_ARN - The unique identifier for your Savings Plan

(structure)

The metadata of a specific type that you can use to filter and group your results. You can use GetDimensionValues to find specific values.

Value -> (string)

The value of a dimension with a specific attribute.

Constraints:

  • min: 0
  • max: 1024
  • pattern: [\S\s]*

Attributes -> (map)

The attribute that applies to a specific Dimension .

key -> (string)

value -> (string)

ReturnSize -> (integer)

The number of results that Amazon Web Services returned at one time.

TotalSize -> (integer)

The total number of search results. When you specify SortBy , TotalSize equals ReturnSize : the number of values that Cost Explorer returns after it applies the MaxResults limit, not the number of values that match the request. In the COST_AND_USAGE context without SortBy , TotalSize can be greater than ReturnSize .

NextPageToken -> (string)

The token for the next set of retrievable results. Amazon Web Services provides the token when the response from a previous call has more results than the maximum page size.

Constraints:

  • min: 0
  • max: 8192
  • pattern: [\S\s]*