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
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]
--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
startis2017-01-01andendis2017-05-01, then the cost and usage data is retrieved from2017-01-01up to and including2017-04-30but not including2017-05-01.Start -> (string) [required]
The beginning of the time period. The start date is inclusive. For example, if
startis2017-01-01, Amazon Web Services retrieves cost and usage data starting at2017-01-01up 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
endis2017-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
Dimensionis available for a differentContext. For more information, seeContext.LINK_ACCOUNT_NAMEandSERVICE_CODEcan only be used in CostCategoryRule .
PRODUCT_ATTRIBUTEreturns the product attribute keys that are available for your costs of supported services, or the values of the key that you specify inDimensionKey.PRODUCT_ATTRIBUTEis supported only in theCOST_AND_USAGEcontext.
IAM_PRINCIPAL,IDENTITY_CENTER_GROUP, andIDENTITY_CENTER_USERreturn values from your artificial intelligence (AI) usage only.Possible values:
AZINSTANCE_TYPELINKED_ACCOUNTPAYER_ACCOUNTLINKED_ACCOUNT_NAMEOPERATIONPURCHASE_TYPEREGIONSERVICESERVICE_CODEUSAGE_TYPEUSAGE_TYPE_GROUPRECORD_TYPEOPERATING_SYSTEMTENANCYSCOPEPLATFORMSUBSCRIPTION_IDLEGAL_ENTITY_NAMEDEPLOYMENT_OPTIONDATABASE_ENGINECACHE_ENGINEINSTANCE_TYPE_FAMILYBILLING_ENTITYRESERVATION_IDRESOURCE_IDRIGHTSIZING_TYPESAVINGS_PLANS_TYPESAVINGS_PLAN_ARNPAYMENT_OPTIONAGREEMENT_END_DATE_TIME_AFTERAGREEMENT_END_DATE_TIME_BEFOREINVOICING_ENTITYANOMALY_TOTAL_IMPACT_ABSOLUTEANOMALY_TOTAL_IMPACT_PERCENTAGEPRODUCT_ATTRIBUTEIDENTITY_CENTER_USERIAM_PRINCIPALIDENTITY_CENTER_GROUP
--dimension-key (string)
The product attribute key to return values for, such as
model. If you omitDimensionKeyor 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
DimensionKeyonly whenDimensionisPRODUCT_ATTRIBUTE. If you also specifySortBy,DimensionKeyis required. As a result, you can’t list product attribute keys when you useSortBy.Constraints:
- min:
0- max:
1024- pattern:
[\S\s]*
--context (string)
The context for the call to
GetDimensionValues. This can beCOST_AND_USAGE,RESERVATIONS, orSAVINGS_PLANS. The default value isCOST_AND_USAGE. If the context is set toRESERVATIONS, the resulting dimension values can be used in theGetReservationUtilizationoperation.GetReservationCoveragefilters match cost and usage data, so useCOST_AND_USAGEvalues for them. If the context is set toSAVINGS_PLANS, the resulting dimension values can be used in theGetSavingsPlansUtilizationandGetSavingsPlansUtilizationDetailsoperations. If the context is set toCOST_AND_USAGE, the resulting dimension values can be used in theGetCostAndUsageoperation.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, andMemcached.- DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service deployments. Examples are
Single-AZandMulti-AZ.- DATABASE_ENGINE - The Amazon Relational Database Service database engine. Examples are
Aurora MySQL,Aurora PostgreSQL, andMySQL.- 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
m5orc6gfor Amazon EC2. The casing of the code follows each service’s product catalog, for exampleR6Gfor 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), andRed Hat Enterprise Linux.- OPERATION - The action performed. Examples include
RunInstanceandCreateBucket.- PLATFORM - The operating system or platform of the usage. Examples are
Linux/UNIX,Windows (Amazon VPC), andRed 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, andSavings 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
ComputeSavingsPlansandEC2InstanceSavingsPlans.- SERVICE - The Amazon Web Services service such as Amazon DynamoDB.
- TENANCY - The tenancy of a resource. Examples are
Shared,Dedicated, andHost.- USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The response for the
GetDimensionValuesoperation 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, andSupport.- 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
GetDimensionValuesto 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
nameattribute contains the full name of the member account.- PLATFORM - The platform of the reservation. For Amazon EC2, examples are
Linux/UNIX,Windows, andRed Hat Enterprise Linux. For Amazon Relational Database Service and Amazon ElastiCache, the value is the engine, such asMySQLorRedis. These values can differ from theCOST_AND_USAGEvalues, for exampleWindowsinstead ofWindows (Amazon VPC).- REGION - The Amazon Web Services Region.
- SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are
RegionandAvailability Zone.- SERVICE - The Amazon Web Services service of the reservation, such as Amazon Relational Database Service.
- TENANCY - The tenancy of the reservation. Values are
SharedandDedicated.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, andDatabaseSavingsPlans.- 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
nameattribute contains the full name of the member account.- SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans.
Possible values:
COST_AND_USAGERESERVATIONSSAVINGS_PLANS
--filter (structure)
To filter your results, use an Expression object.
The supported filter shapes depend on
Contextand on whether you specifySortBy:
COST_AND_USAGEwithoutSortBy: a singleDimensions,Tags, orCostCategoriesexpression, or oneAndof such expressions.Or,Not, and anAndinside anotherAndaren’t supported.COST_AND_USAGEwithSortBy:And,Or, andNotare supported, nested up to four levels.RESERVATIONSandSAVINGS_PLANS: a singleDimensionsexpression, aNotexpression that contains oneDimensionsexpression, or oneAndof such expressions. Each dimension can appear only once.Or,Tags,CostCategories, and anAndinside anotherAndaren’t supported. ForRESERVATIONS, don’t specifyMatchOptions. ForSAVINGS_PLANS,MatchOptionscan be onlyEQUALS, orEQUALSandCASE_SENSITIVE.SortByisn’t supported in these contexts.Or -> (list)
Return results that match either
Dimensionobject.(structure)
Use
Expressionto filter in various Cost Explorer APIs.Not all
Expressiontypes 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, andProductAttributes.
- Specify the
CostCategoriesfield to define a filter that acts on Cost Categories.- Specify the
Tagsfield to define a filter that acts on Cost Allocation Tags.- Specify the
Dimensionsfield to define a filter that acts on the `DimensionValueshttps://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html`__ .- Specify the
ProductAttributesfield to define a filter that acts on the product attributes of supported services, such as Amazon Bedrock. OnlyGetCostAndUsage,GetCostAndUsageWithResources,GetDimensionValues(in theCOST_AND_USAGEcontext),GetTags, andGetCostCategoriessupportProductAttributes. For the supported services, keys andSERVICEfilter rules, see `ProductAttributeValueshttps://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .- 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. ForGetRightsizingRecommendation, the Region is a full name (for example,REGION==US East (N. Virginia).- The corresponding
Expressionfor 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
ORwhen 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
Expressionfor this example is as follows:{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }- Compound
Expressiontypes with logical operations.
- You can use multiple
Expressiontypes and the logical operatorsAND/OR/NOTto create a list of one or moreExpressionobjects. 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
Expressionfor 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
Expressioncan have only one operator, the service returns an error if more than one is specified. The following example shows anExpressionobject 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
GetRightsizingRecommendationaction, 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 toLINKED_ACCOUNT,REGION, orRIGHTSIZING_TYPE.For the
GetReservationPurchaseRecommendationaction, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT.Or -> (list)
Return results that match either
Dimensionobject.( … recursive … )
And -> (list)
Return results that match both
Dimensionobjects.( … recursive … )
( … recursive … )Dimensions -> (structure)
The specific
Dimensionto use forExpression.Key -> (string)
The names of the metadata types that you can use to filter and group your results. For example,
AZreturns 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_NAMEandSERVICE_CODEcan only be used in CostCategoryRule .
ANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGEcan only be used in AnomalySubscriptions .Use
PRODUCT_ATTRIBUTEonly as theDimensioninGetDimensionValues. To filter or group by product attributes, use theProductAttributesfield ofExpressionor thePRODUCT_ATTRIBUTEgroup type.Possible values:
AZINSTANCE_TYPELINKED_ACCOUNTPAYER_ACCOUNTLINKED_ACCOUNT_NAMEOPERATIONPURCHASE_TYPEREGIONSERVICESERVICE_CODEUSAGE_TYPEUSAGE_TYPE_GROUPRECORD_TYPEOPERATING_SYSTEMTENANCYSCOPEPLATFORMSUBSCRIPTION_IDLEGAL_ENTITY_NAMEDEPLOYMENT_OPTIONDATABASE_ENGINECACHE_ENGINEINSTANCE_TYPE_FAMILYBILLING_ENTITYRESERVATION_IDRESOURCE_IDRIGHTSIZING_TYPESAVINGS_PLANS_TYPESAVINGS_PLAN_ARNPAYMENT_OPTIONAGREEMENT_END_DATE_TIME_AFTERAGREEMENT_END_DATE_TIME_BEFOREINVOICING_ENTITYANOMALY_TOTAL_IMPACT_ABSOLUTEANOMALY_TOTAL_IMPACT_PERCENTAGEPRODUCT_ATTRIBUTEIDENTITY_CENTER_USERIAM_PRINCIPALIDENTITY_CENTER_GROUPValues -> (list)
The metadata values that you can use to filter and group your results. You can use
GetDimensionValuesto 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
MatchOptionsvalues depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, forDimensionsfilters,GetCostAndUsagesupports onlyEQUALSandCASE_SENSITIVE. Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.The default values for
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALTags -> (structure)
The specific
Tagto use forExpression.Key -> (string)
The key for the tag.
Specify user-defined tag keys without the
user:prefix. For example, useteam, notuser:team. Tag keys that Amazon Web Services generates keep theiraws: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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALCostCategories -> (structure)
The filter that’s based on
CostCategoryvalues.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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALProductAttributes -> (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 theCOST_AND_USAGEcontext),GetTags, andGetCostCategories. For the supported services and keys, see `ProductAttributeValueshttps://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 `ProductAttributeValueshttps://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:
EQUALSmatches no costs, andABSENTmatches 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 5for themodelkey. Values are matched exactly, including case. To list the values of a key, useGetDimensionValueswithDimensionset toPRODUCT_ATTRIBUTEandDimensionKeyset to the key.To match costs that have no value for the key, set
MatchOptionstoABSENTand omitValues. Otherwise,Valuesis 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. OmitValues.CASE_SENSITIVE- Use only withEQUALS. Values are always matched case-sensitively.Default values are
EQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALAnd -> (list)
Return results that match both
Dimensionobjects.(structure)
Use
Expressionto filter in various Cost Explorer APIs.Not all
Expressiontypes 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, andProductAttributes.
- Specify the
CostCategoriesfield to define a filter that acts on Cost Categories.- Specify the
Tagsfield to define a filter that acts on Cost Allocation Tags.- Specify the
Dimensionsfield to define a filter that acts on the `DimensionValueshttps://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html`__ .- Specify the
ProductAttributesfield to define a filter that acts on the product attributes of supported services, such as Amazon Bedrock. OnlyGetCostAndUsage,GetCostAndUsageWithResources,GetDimensionValues(in theCOST_AND_USAGEcontext),GetTags, andGetCostCategoriessupportProductAttributes. For the supported services, keys andSERVICEfilter rules, see `ProductAttributeValueshttps://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ProductAttributeValues.html`__ .- 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. ForGetRightsizingRecommendation, the Region is a full name (for example,REGION==US East (N. Virginia).- The corresponding
Expressionfor 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
ORwhen 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
Expressionfor this example is as follows:{ "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], "Values": [ "a" ] } }- Compound
Expressiontypes with logical operations.
- You can use multiple
Expressiontypes and the logical operatorsAND/OR/NOTto create a list of one or moreExpressionobjects. 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
Expressionfor 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
Expressioncan have only one operator, the service returns an error if more than one is specified. The following example shows anExpressionobject 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
GetRightsizingRecommendationaction, 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 toLINKED_ACCOUNT,REGION, orRIGHTSIZING_TYPE.For the
GetReservationPurchaseRecommendationaction, only NOT is supported. AND and OR aren’t supported. Dimensions are limited toLINKED_ACCOUNT.Or -> (list)
Return results that match either
Dimensionobject.( … recursive … )
And -> (list)
Return results that match both
Dimensionobjects.( … recursive … )
( … recursive … )Dimensions -> (structure)
The specific
Dimensionto use forExpression.Key -> (string)
The names of the metadata types that you can use to filter and group your results. For example,
AZreturns 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_NAMEandSERVICE_CODEcan only be used in CostCategoryRule .
ANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGEcan only be used in AnomalySubscriptions .Use
PRODUCT_ATTRIBUTEonly as theDimensioninGetDimensionValues. To filter or group by product attributes, use theProductAttributesfield ofExpressionor thePRODUCT_ATTRIBUTEgroup type.Possible values:
AZINSTANCE_TYPELINKED_ACCOUNTPAYER_ACCOUNTLINKED_ACCOUNT_NAMEOPERATIONPURCHASE_TYPEREGIONSERVICESERVICE_CODEUSAGE_TYPEUSAGE_TYPE_GROUPRECORD_TYPEOPERATING_SYSTEMTENANCYSCOPEPLATFORMSUBSCRIPTION_IDLEGAL_ENTITY_NAMEDEPLOYMENT_OPTIONDATABASE_ENGINECACHE_ENGINEINSTANCE_TYPE_FAMILYBILLING_ENTITYRESERVATION_IDRESOURCE_IDRIGHTSIZING_TYPESAVINGS_PLANS_TYPESAVINGS_PLAN_ARNPAYMENT_OPTIONAGREEMENT_END_DATE_TIME_AFTERAGREEMENT_END_DATE_TIME_BEFOREINVOICING_ENTITYANOMALY_TOTAL_IMPACT_ABSOLUTEANOMALY_TOTAL_IMPACT_PERCENTAGEPRODUCT_ATTRIBUTEIDENTITY_CENTER_USERIAM_PRINCIPALIDENTITY_CENTER_GROUPValues -> (list)
The metadata values that you can use to filter and group your results. You can use
GetDimensionValuesto 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
MatchOptionsvalues depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, forDimensionsfilters,GetCostAndUsagesupports onlyEQUALSandCASE_SENSITIVE. Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.The default values for
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALTags -> (structure)
The specific
Tagto use forExpression.Key -> (string)
The key for the tag.
Specify user-defined tag keys without the
user:prefix. For example, useteam, notuser:team. Tag keys that Amazon Web Services generates keep theiraws: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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALCostCategories -> (structure)
The filter that’s based on
CostCategoryvalues.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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALProductAttributes -> (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 theCOST_AND_USAGEcontext),GetTags, andGetCostCategories. For the supported services and keys, see `ProductAttributeValueshttps://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 `ProductAttributeValueshttps://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:
EQUALSmatches no costs, andABSENTmatches 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 5for themodelkey. Values are matched exactly, including case. To list the values of a key, useGetDimensionValueswithDimensionset toPRODUCT_ATTRIBUTEandDimensionKeyset to the key.To match costs that have no value for the key, set
MatchOptionstoABSENTand omitValues. Otherwise,Valuesis 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. OmitValues.CASE_SENSITIVE- Use only withEQUALS. Values are always matched case-sensitively.Default values are
EQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALNot -> (structure)
Return results that don’t match a
Dimensionobject.Or -> (list)
Return results that match either
Dimensionobject.( … recursive … )
And -> (list)
Return results that match both
Dimensionobjects.( … recursive … )
( … recursive … )Dimensions -> (structure)
The specific
Dimensionto use forExpression.Key -> (string)
The names of the metadata types that you can use to filter and group your results. For example,
AZreturns 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_NAMEandSERVICE_CODEcan only be used in CostCategoryRule .
ANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGEcan only be used in AnomalySubscriptions .Use
PRODUCT_ATTRIBUTEonly as theDimensioninGetDimensionValues. To filter or group by product attributes, use theProductAttributesfield ofExpressionor thePRODUCT_ATTRIBUTEgroup type.Possible values:
AZINSTANCE_TYPELINKED_ACCOUNTPAYER_ACCOUNTLINKED_ACCOUNT_NAMEOPERATIONPURCHASE_TYPEREGIONSERVICESERVICE_CODEUSAGE_TYPEUSAGE_TYPE_GROUPRECORD_TYPEOPERATING_SYSTEMTENANCYSCOPEPLATFORMSUBSCRIPTION_IDLEGAL_ENTITY_NAMEDEPLOYMENT_OPTIONDATABASE_ENGINECACHE_ENGINEINSTANCE_TYPE_FAMILYBILLING_ENTITYRESERVATION_IDRESOURCE_IDRIGHTSIZING_TYPESAVINGS_PLANS_TYPESAVINGS_PLAN_ARNPAYMENT_OPTIONAGREEMENT_END_DATE_TIME_AFTERAGREEMENT_END_DATE_TIME_BEFOREINVOICING_ENTITYANOMALY_TOTAL_IMPACT_ABSOLUTEANOMALY_TOTAL_IMPACT_PERCENTAGEPRODUCT_ATTRIBUTEIDENTITY_CENTER_USERIAM_PRINCIPALIDENTITY_CENTER_GROUPValues -> (list)
The metadata values that you can use to filter and group your results. You can use
GetDimensionValuesto 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
MatchOptionsvalues depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, forDimensionsfilters,GetCostAndUsagesupports onlyEQUALSandCASE_SENSITIVE. Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.The default values for
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALTags -> (structure)
The specific
Tagto use forExpression.Key -> (string)
The key for the tag.
Specify user-defined tag keys without the
user:prefix. For example, useteam, notuser:team. Tag keys that Amazon Web Services generates keep theiraws: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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALCostCategories -> (structure)
The filter that’s based on
CostCategoryvalues.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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALProductAttributes -> (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 theCOST_AND_USAGEcontext),GetTags, andGetCostCategories. For the supported services and keys, see `ProductAttributeValueshttps://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 `ProductAttributeValueshttps://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:
EQUALSmatches no costs, andABSENTmatches 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 5for themodelkey. Values are matched exactly, including case. To list the values of a key, useGetDimensionValueswithDimensionset toPRODUCT_ATTRIBUTEandDimensionKeyset to the key.To match costs that have no value for the key, set
MatchOptionstoABSENTand omitValues. Otherwise,Valuesis 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. OmitValues.CASE_SENSITIVE- Use only withEQUALS. Values are always matched case-sensitively.Default values are
EQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALDimensions -> (structure)
The specific
Dimensionto use forExpression.Key -> (string)
The names of the metadata types that you can use to filter and group your results. For example,
AZreturns 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_NAMEandSERVICE_CODEcan only be used in CostCategoryRule .
ANOMALY_TOTAL_IMPACT_ABSOLUTEandANOMALY_TOTAL_IMPACT_PERCENTAGEcan only be used in AnomalySubscriptions .Use
PRODUCT_ATTRIBUTEonly as theDimensioninGetDimensionValues. To filter or group by product attributes, use theProductAttributesfield ofExpressionor thePRODUCT_ATTRIBUTEgroup type.Possible values:
AZINSTANCE_TYPELINKED_ACCOUNTPAYER_ACCOUNTLINKED_ACCOUNT_NAMEOPERATIONPURCHASE_TYPEREGIONSERVICESERVICE_CODEUSAGE_TYPEUSAGE_TYPE_GROUPRECORD_TYPEOPERATING_SYSTEMTENANCYSCOPEPLATFORMSUBSCRIPTION_IDLEGAL_ENTITY_NAMEDEPLOYMENT_OPTIONDATABASE_ENGINECACHE_ENGINEINSTANCE_TYPE_FAMILYBILLING_ENTITYRESERVATION_IDRESOURCE_IDRIGHTSIZING_TYPESAVINGS_PLANS_TYPESAVINGS_PLAN_ARNPAYMENT_OPTIONAGREEMENT_END_DATE_TIME_AFTERAGREEMENT_END_DATE_TIME_BEFOREINVOICING_ENTITYANOMALY_TOTAL_IMPACT_ABSOLUTEANOMALY_TOTAL_IMPACT_PERCENTAGEPRODUCT_ATTRIBUTEIDENTITY_CENTER_USERIAM_PRINCIPALIDENTITY_CENTER_GROUPValues -> (list)
The metadata values that you can use to filter and group your results. You can use
GetDimensionValuesto 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
MatchOptionsvalues depend on the operation. Refer to the documentation for each specific API to see what is supported. For example, forDimensionsfilters,GetCostAndUsagesupports onlyEQUALSandCASE_SENSITIVE. Other match options are supported only by specific operations, such as cost category rules and anomaly subscriptions.The default values for
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALTags -> (structure)
The specific
Tagto use forExpression.Key -> (string)
The key for the tag.
Specify user-defined tag keys without the
user:prefix. For example, useteam, notuser:team. Tag keys that Amazon Web Services generates keep theiraws: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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALCostCategories -> (structure)
The filter that’s based on
CostCategoryvalues.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,
GetCostAndUsagesupports 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
MatchOptionsareEQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_THAN_OR_EQUALProductAttributes -> (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 theCOST_AND_USAGEcontext),GetTags, andGetCostCategories. For the supported services and keys, see `ProductAttributeValueshttps://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 `ProductAttributeValueshttps://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:
EQUALSmatches no costs, andABSENTmatches 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 5for themodelkey. Values are matched exactly, including case. To list the values of a key, useGetDimensionValueswithDimensionset toPRODUCT_ATTRIBUTEandDimensionKeyset to the key.To match costs that have no value for the key, set
MatchOptionstoABSENTand omitValues. Otherwise,Valuesis 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. OmitValues.CASE_SENSITIVE- Use only withEQUALS. Values are always matched case-sensitively.Default values are
EQUALSandCASE_SENSITIVE.(string)
Possible values:
EQUALSABSENTSTARTS_WITHENDS_WITHCONTAINSCASE_SENSITIVECASE_INSENSITIVEGREATER_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:
BlendedCostUnblendedCostAmortizedCostNetAmortizedCostNetUnblendedCostUsageQuantityNormalizedUsageAmountBilledCostContractedCostListCostPublicEquivalentBilledCostPublicOnDemandCostThe supported values for the
SortOrderkey areASCENDINGorDESCENDING.When you specify a
SortByparamater, the context must beCOST_AND_USAGE. Further, when usingSortBy,NextPageTokenandSearchStringaren’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:
ASCENDINGDESCENDING
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.
--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.
--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.
--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.
--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.
--help (boolean)
Display help for the command/subcommand.
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.
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, andMySQL.- 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), andRed Hat Enterprise Linux.- OPERATION - The action performed. Examples include
RunInstanceandCreateBucket.- PLATFORM - The operating system or platform of the usage. Examples are
Linux/UNIX,Windows (Amazon VPC), andRed 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, andSavings 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
GetDimensionValuesoperation 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, andSupport.- 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
nameattribute contains the full name of the member account.- PLATFORM - The platform of the reservation. For Amazon EC2, examples are
Linux/UNIX,Windows, andRed Hat Enterprise Linux. For Amazon Relational Database Service and Amazon ElastiCache, the value is the engine, such asMySQLorRedis. These values can differ from theCOST_AND_USAGEvalues, for exampleWindowsinstead ofWindows (Amazon VPC).- REGION - The Amazon Web Services Region.
- SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values are
RegionandAvailability Zone.- SERVICE - The Amazon Web Services service of the reservation, such as Amazon Relational Database Service.
- TENANCY - The tenancy of the reservation. Values are
SharedandDedicated.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, andDatabaseSavingsPlans.- 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
nameattribute 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
GetDimensionValuesto 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 specifySortBy,TotalSizeequalsReturnSize: the number of values that Cost Explorer returns after it applies theMaxResultslimit, not the number of values that match the request. In theCOST_AND_USAGEcontext withoutSortBy,TotalSizecan be greater thanReturnSize.
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]*