CostExplorer ************ Client ====== class CostExplorer.Client A low-level client representing AWS Cost Explorer Service You can use the Cost Explorer API to programmatically query your cost and usage data. You can query for aggregated data such as total monthly costs or total daily usage. You can also query for granular data. This might include the number of daily write operations for Amazon DynamoDB database tables in your production environment. Service Endpoint The Cost Explorer API provides the following endpoint: * "https://ce.us-east-1.amazonaws.com" For information about the costs that are associated with the Cost Explorer API, see Amazon Web Services Cost Management Pricing. import boto3 client = boto3.client('ce') These are the available methods: * can_paginate * close * create_anomaly_monitor * create_anomaly_subscription * create_cost_category_definition * delete_anomaly_monitor * delete_anomaly_subscription * delete_cost_category_definition * describe_cost_category_definition * get_anomalies * get_anomaly_monitors * get_anomaly_subscriptions * get_approximate_usage_records * get_commitment_purchase_analysis * get_cost_and_usage * get_cost_and_usage_comparisons * get_cost_and_usage_with_resources * get_cost_categories * get_cost_comparison_drivers * get_cost_forecast * get_dimension_values * get_paginator * get_reservation_coverage * get_reservation_purchase_recommendation * get_reservation_utilization * get_rightsizing_recommendation * get_savings_plan_purchase_recommendation_details * get_savings_plans_coverage * get_savings_plans_purchase_recommendation * get_savings_plans_utilization * get_savings_plans_utilization_details * get_tags * get_usage_forecast * get_waiter * list_commitment_purchase_analyses * list_cost_allocation_tag_backfill_history * list_cost_allocation_tags * list_cost_category_definitions * list_savings_plans_purchase_recommendation_generation * list_tags_for_resource * provide_anomaly_feedback * start_commitment_purchase_analysis * start_cost_allocation_tag_backfill * start_savings_plans_purchase_recommendation_generation * tag_resource * untag_resource * update_anomaly_monitor * update_anomaly_subscription * update_cost_allocation_tags_status * update_cost_category_definition Paginators ========== Paginators are available on a client instance via the "get_paginator" method. For more detailed instructions and examples on the usage of paginators, see the paginators user guide. The available paginators are: * GetAnomalies * GetAnomalyMonitors * GetAnomalySubscriptions * GetCostAndUsageComparisons * GetCostComparisonDrivers CostExplorer / Paginator / GetAnomalies GetAnomalies ************ class CostExplorer.Paginator.GetAnomalies paginator = client.get_paginator('get_anomalies') paginate(**kwargs) Creates an iterator that will paginate through responses from "CostExplorer.Client.get_anomalies()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( MonitorArn='string', DateInterval={ 'StartDate': 'string', 'EndDate': 'string' }, Feedback='YES'|'NO'|'PLANNED_ACTIVITY', TotalImpact={ 'NumericOperator': 'EQUAL'|'GREATER_THAN_OR_EQUAL'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'BETWEEN', 'StartValue': 123.0, 'EndValue': 123.0 }, PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **MonitorArn** (*string*) -- Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN). * **DateInterval** (*dict*) -- **[REQUIRED]** Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an "AnomalyEndDate" in the specified time range. * **StartDate** *(string) --* **[REQUIRED]** The first date an anomaly was observed. * **EndDate** *(string) --* The last date an anomaly was observed. * **Feedback** (*string*) -- Filters anomaly results by the feedback field on the anomaly object. * **TotalImpact** (*dict*) -- Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies "GREATER_THAN 200.00" to retrieve anomalies, with an estimated dollar impact greater than 200. * **NumericOperator** *(string) --* **[REQUIRED]** The comparing value that's used in the filter. * **StartValue** *(float) --* **[REQUIRED]** The lower bound dollar value that's used in the filter. * **EndValue** *(float) --* The upper bound dollar value that's used in the filter. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'Anomalies': [ { 'AnomalyId': 'string', 'AnomalyStartDate': 'string', 'AnomalyEndDate': 'string', 'DimensionValue': 'string', 'RootCauses': [ { 'Service': 'string', 'Region': 'string', 'LinkedAccount': 'string', 'LinkedAccountName': 'string', 'UsageType': 'string', 'Impact': { 'Contribution': 123.0 } }, ], 'AnomalyScore': { 'MaxScore': 123.0, 'CurrentScore': 123.0 }, 'Impact': { 'MaxImpact': 123.0, 'TotalImpact': 123.0, 'TotalActualSpend': 123.0, 'TotalExpectedSpend': 123.0, 'TotalImpactPercentage': 123.0 }, 'MonitorArn': 'string', 'Feedback': 'YES'|'NO'|'PLANNED_ACTIVITY' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **Anomalies** *(list) --* A list of cost anomalies. * *(dict) --* An unusual cost pattern. This consists of the detailed metadata and the current status of the anomaly object. * **AnomalyId** *(string) --* The unique identifier for the anomaly. * **AnomalyStartDate** *(string) --* The first day the anomaly is detected. * **AnomalyEndDate** *(string) --* The last day the anomaly is detected. * **DimensionValue** *(string) --* The dimension for the anomaly (for example, an Amazon Web Services service in a service monitor). * **RootCauses** *(list) --* The list of identified root causes for the anomaly. * *(dict) --* The combination of Amazon Web Services service, linked account, linked account name, Region, and usage type where a cost anomaly is observed, along with the dollar and percentage amount of the anomaly impact. The linked account name will only be available when the account name can be identified. * **Service** *(string) --* The Amazon Web Services service name that's associated with the cost anomaly. * **Region** *(string) --* The Amazon Web Services Region that's associated with the cost anomaly. * **LinkedAccount** *(string) --* The member account value that's associated with the cost anomaly. * **LinkedAccountName** *(string) --* The member account name value that's associated with the cost anomaly. * **UsageType** *(string) --* The "UsageType" value that's associated with the cost anomaly. * **Impact** *(dict) --* The dollar impact for the root cause. * **Contribution** *(float) --* The dollar amount that this root cause contributed to the anomaly's TotalImpact. * **AnomalyScore** *(dict) --* The latest and maximum score for the anomaly. * **MaxScore** *(float) --* The maximum score that's observed during the "AnomalyDateInterval". * **CurrentScore** *(float) --* The last observed score. * **Impact** *(dict) --* The dollar impact for the anomaly. * **MaxImpact** *(float) --* The maximum dollar value that's observed for an anomaly. * **TotalImpact** *(float) --* The cumulative dollar difference between the total actual spend and total expected spend. It is calculated as "TotalActualSpend - TotalExpectedSpend". * **TotalActualSpend** *(float) --* The cumulative dollar amount that was actually spent during the anomaly. * **TotalExpectedSpend** *(float) --* The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using advanced machine learning models to determine the typical spending pattern based on historical data for a customer. * **TotalImpactPercentage** *(float) --* The cumulative percentage difference between the total actual spend and total expected spend. It is calculated as "(TotalImpact / TotalExpectedSpend) * 100". When "TotalExpectedSpend" is zero, this field is omitted. Expected spend can be zero in situations such as when you start to use a service for the first time. * **MonitorArn** *(string) --* The Amazon Resource Name (ARN) for the cost monitor that generated this anomaly. * **Feedback** *(string) --* The feedback value. * **NextToken** *(string) --* A token to resume pagination. CostExplorer / Paginator / GetCostComparisonDrivers GetCostComparisonDrivers ************************ class CostExplorer.Paginator.GetCostComparisonDrivers paginator = client.get_paginator('get_cost_comparison_drivers') paginate(**kwargs) Creates an iterator that will paginate through responses from "CostExplorer.Client.get_cost_comparison_drivers()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( BillingViewArn='string', BaselineTimePeriod={ 'Start': 'string', 'End': 'string' }, ComparisonTimePeriod={ 'Start': 'string', 'End': 'string' }, MetricForComparison='string', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, GroupBy=[ { 'Type': 'DIMENSION'|'TAG'|'COST_CATEGORY', 'Key': 'string' }, ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **BillingViewArn** (*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. * **BaselineTimePeriod** (*dict*) -- **[REQUIRED]** The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **ComparisonTimePeriod** (*dict*) -- **[REQUIRED]** The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **MetricForComparison** (*string*) -- **[REQUIRED]** The cost and usage metric to compare. Valid values are "AmortizedCost", "BlendedCost", "NetAmortizedCost", "NetUnblendedCost", "NormalizedUsageAmount", "UnblendedCost", and "UsageQuantity". * **Filter** (*dict*) -- 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **GroupBy** (*list*) -- You can group results using the attributes "DIMENSION", "TAG", and "COST_CATEGORY". Note that "SERVICE" and "USAGE_TYPE" dimensions are automatically included in the cost comparison drivers analysis. * *(dict) --* Represents a group when you specify a group by criteria or in the response to a query with a specific grouping. * **Type** *(string) --* The string that represents the type of group. * **Key** *(string) --* The string that represents a key for a specified group. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'CostComparisonDrivers': [ { 'CostSelector': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } }, 'CostDrivers': [ { 'Type': 'string', 'Name': 'string', 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } } }, ] }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **CostComparisonDrivers** *(list) --* An array of comparison results showing factors that drive significant cost differences between "BaselineTimePeriod" and "ComparisonTimePeriod". * *(dict) --* Represents a collection of cost drivers and their associated metrics for cost comparison analysis. * **CostSelector** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Metrics** *(dict) --* A mapping of metric names to their comparison values. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **CostDrivers** *(list) --* An array of cost drivers, each representing a cost difference between the baseline and comparison time periods. Each entry also includes a metric delta (for example, usage change) that contributed to the cost variance, along with the identifier and type of change. * *(dict) --* Represents factors that contribute to cost variations between the baseline and comparison time periods, including the type of driver, an identifier of the driver, and associated metrics. * **Type** *(string) --* The category or classification of the cost driver. Values include: BUNDLED_DISCOUNT, CREDIT, OUT_OF_CYCLE_CHARGE, REFUND, RECURRING_RESERVATION_FEE, RESERVATION_USAGE, RI_VOLUME_DISCOUNT, SAVINGS_PLAN_USAGE, SAVINGS_PLAN_NEGATION, SAVINGS_PLAN_RECURRING_FEE, SUPPORT_FEE, TAX, UPFRONT_RESERVATION_FEE, USAGE_CHANGE, COMMITMENT * **Name** *(string) --* The specific identifier of the cost driver. * **Metrics** *(dict) --* A mapping of metric names to their comparison values, measuring the impact of this cost driver. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **NextToken** *(string) --* A token to resume pagination. CostExplorer / Paginator / GetCostAndUsageComparisons GetCostAndUsageComparisons ************************** class CostExplorer.Paginator.GetCostAndUsageComparisons paginator = client.get_paginator('get_cost_and_usage_comparisons') paginate(**kwargs) Creates an iterator that will paginate through responses from "CostExplorer.Client.get_cost_and_usage_comparisons()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( BillingViewArn='string', BaselineTimePeriod={ 'Start': 'string', 'End': 'string' }, ComparisonTimePeriod={ 'Start': 'string', 'End': 'string' }, MetricForComparison='string', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, GroupBy=[ { 'Type': 'DIMENSION'|'TAG'|'COST_CATEGORY', 'Key': 'string' }, ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **BillingViewArn** (*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. * **BaselineTimePeriod** (*dict*) -- **[REQUIRED]** The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **ComparisonTimePeriod** (*dict*) -- **[REQUIRED]** The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **MetricForComparison** (*string*) -- **[REQUIRED]** The cost and usage metric to compare. Valid values are "AmortizedCost", "BlendedCost", "NetAmortizedCost", "NetUnblendedCost", "NormalizedUsageAmount", "UnblendedCost", and "UsageQuantity". * **Filter** (*dict*) -- 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **GroupBy** (*list*) -- You can group results using the attributes "DIMENSION", "TAG", and "COST_CATEGORY". * *(dict) --* Represents a group when you specify a group by criteria or in the response to a query with a specific grouping. * **Type** *(string) --* The string that represents the type of group. * **Key** *(string) --* The string that represents a key for a specified group. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'CostAndUsageComparisons': [ { 'CostAndUsageSelector': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } } }, ], 'TotalCostAndUsage': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } }, 'NextToken': 'string' } **Response Structure** * *(dict) --* * **CostAndUsageComparisons** *(list) --* An array of comparison results showing cost and usage metrics between "BaselineTimePeriod" and "ComparisonTimePeriod". * *(dict) --* Represents a comparison of cost and usage metrics between two time periods. * **CostAndUsageSelector** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Metrics** *(dict) --* A mapping of metric names to their comparison values. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **TotalCostAndUsage** *(dict) --* A summary of the total cost and usage, comparing amounts between "BaselineTimePeriod" and "ComparisonTimePeriod" and their differences. This total represents the aggregate total across all paginated results, if the response spans multiple pages. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **NextToken** *(string) --* A token to resume pagination. CostExplorer / Paginator / GetAnomalySubscriptions GetAnomalySubscriptions *********************** class CostExplorer.Paginator.GetAnomalySubscriptions paginator = client.get_paginator('get_anomaly_subscriptions') paginate(**kwargs) Creates an iterator that will paginate through responses from "CostExplorer.Client.get_anomaly_subscriptions()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( SubscriptionArnList=[ 'string', ], MonitorArn='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **SubscriptionArnList** (*list*) -- A list of cost anomaly subscription ARNs. * *(string) --* * **MonitorArn** (*string*) -- Cost anomaly monitor ARNs. * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'AnomalySubscriptions': [ { 'SubscriptionArn': 'string', 'AccountId': 'string', 'MonitorArnList': [ 'string', ], 'Subscribers': [ { 'Address': 'string', 'Type': 'EMAIL'|'SNS', 'Status': 'CONFIRMED'|'DECLINED' }, ], 'Threshold': 123.0, 'Frequency': 'DAILY'|'IMMEDIATE'|'WEEKLY', 'SubscriptionName': 'string', 'ThresholdExpression': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } } }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AnomalySubscriptions** *(list) --* A list of cost anomaly subscriptions that includes the detailed metadata for each one. * *(dict) --* An "AnomalySubscription" resource (also referred to as an alert subscription) sends notifications about specific anomalies that meet an alerting criteria defined by you. You can specify the frequency of the alerts and the subscribers to notify. Anomaly subscriptions can be associated with one or more AnomalyMonitor resources, and they only send notifications about anomalies detected by those associated monitors. You can also configure a threshold to further control which anomalies are included in the notifications. Anomalies that don’t exceed the chosen threshold and therefore don’t trigger notifications from an anomaly subscription will still be available on the console and from the GetAnomalies API. * **SubscriptionArn** *(string) --* The "AnomalySubscription" Amazon Resource Name (ARN). * **AccountId** *(string) --* Your unique account identifier. * **MonitorArnList** *(list) --* A list of cost anomaly monitors. * *(string) --* * **Subscribers** *(list) --* A list of subscribers to notify. * *(dict) --* The recipient of "AnomalySubscription" notifications. * **Address** *(string) --* The email address or SNS Amazon Resource Name (ARN). This depends on the "Type". * **Type** *(string) --* The notification delivery channel. * **Status** *(string) --* Indicates if the subscriber accepts the notifications. * **Threshold** *(float) --* (deprecated) An absolute dollar value that must be exceeded by the anomaly's total impact (see Impact for more details) for an anomaly notification to be generated. This field has been deprecated. To specify a threshold, use ThresholdExpression. Continued use of Threshold will be treated as shorthand syntax for a ThresholdExpression. One of Threshold or ThresholdExpression is required for this resource. You cannot specify both. * **Frequency** *(string) --* The frequency that anomaly notifications are sent. Notifications are sent either over email (for DAILY and WEEKLY frequencies) or SNS (for IMMEDIATE frequency). For more information, see Creating an Amazon SNS topic for anomaly notifications. * **SubscriptionName** *(string) --* The name for the subscription. * **ThresholdExpression** *(dict) --* An Expression object used to specify the anomalies that you want to generate alerts for. This supports dimensions and nested expressions. The supported dimensions are "ANOMALY_TOTAL_IMPACT_ABSOLUTE" and "ANOMALY_TOTAL_IMPACT_PERCENTAGE", corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, respectively (see Impact for more details). The supported nested expression types are "AND" and "OR". The match option "GREATER_THAN_OR_EQUAL" is required. Values must be numbers between 0 and 10,000,000,000 in string format. One of Threshold or ThresholdExpression is required for this resource. You cannot specify both. The following are examples of valid ThresholdExpressions: * Absolute threshold: "{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }" * Percentage threshold: "{ "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }" * "AND" two thresholds together: "{ "And": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }" * "OR" two thresholds together: "{ "Or": [ { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } }, { "Dimensions": { "Key": "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], "Values": [ "100" ] } } ] }" * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **NextToken** *(string) --* A token to resume pagination. CostExplorer / Paginator / GetAnomalyMonitors GetAnomalyMonitors ****************** class CostExplorer.Paginator.GetAnomalyMonitors paginator = client.get_paginator('get_anomaly_monitors') paginate(**kwargs) Creates an iterator that will paginate through responses from "CostExplorer.Client.get_anomaly_monitors()". See also: AWS API Documentation **Request Syntax** response_iterator = paginator.paginate( MonitorArnList=[ 'string', ], PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } ) Parameters: * **MonitorArnList** (*list*) -- A list of cost anomaly monitor ARNs. * *(string) --* * **PaginationConfig** (*dict*) -- A dictionary that provides parameters to control pagination. * **MaxItems** *(integer) --* The total number of items to return. If the total number of items available is more than the value specified in max-items then a "NextToken" will be provided in the output that you can use to resume pagination. * **PageSize** *(integer) --* The size of each page. * **StartingToken** *(string) --* A token to specify where to start paginating. This is the "NextToken" from a previous response. Return type: dict Returns: **Response Syntax** { 'AnomalyMonitors': [ { 'MonitorArn': 'string', 'MonitorName': 'string', 'CreationDate': 'string', 'LastUpdatedDate': 'string', 'LastEvaluatedDate': 'string', 'MonitorType': 'DIMENSIONAL'|'CUSTOM', 'MonitorDimension': 'SERVICE', 'MonitorSpecification': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'DimensionalValueCount': 123 }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **AnomalyMonitors** *(list) --* A list of cost anomaly monitors that includes the detailed metadata for each monitor. * *(dict) --* This object continuously inspects your account's cost data for anomalies. It's based on "MonitorType" and "MonitorSpecification". The content consists of detailed metadata and the current status of the monitor object. * **MonitorArn** *(string) --* The Amazon Resource Name (ARN) value. * **MonitorName** *(string) --* The name of the monitor. * **CreationDate** *(string) --* The date when the monitor was created. * **LastUpdatedDate** *(string) --* The date when the monitor was last updated. * **LastEvaluatedDate** *(string) --* The date when the monitor last evaluated for anomalies. * **MonitorType** *(string) --* The possible type values. * **MonitorDimension** *(string) --* The dimensions to evaluate. * **MonitorSpecification** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION ==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **DimensionalValueCount** *(integer) --* The value for evaluated dimensions. * **NextToken** *(string) --* A token to resume pagination. CostExplorer / Client / get_usage_forecast get_usage_forecast ****************** CostExplorer.Client.get_usage_forecast(**kwargs) Retrieves a forecast for how much Amazon Web Services predicts that you will use over the forecast time period that you select, based on your past usage. See also: AWS API Documentation **Request Syntax** response = client.get_usage_forecast( TimePeriod={ 'Start': 'string', 'End': 'string' }, Metric='BLENDED_COST'|'UNBLENDED_COST'|'AMORTIZED_COST'|'NET_UNBLENDED_COST'|'NET_AMORTIZED_COST'|'USAGE_QUANTITY'|'NORMALIZED_USAGE_AMOUNT', Granularity='DAILY'|'MONTHLY'|'HOURLY', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, BillingViewArn='string', PredictionIntervalLevel=123 ) Parameters: * **TimePeriod** (*dict*) -- **[REQUIRED]** The start and end dates of the period that you want to retrieve usage forecast for. The start date is included in the period, but the end date isn't included in the period. 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". The start date must be equal to or later than the current date to avoid a validation error. * **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. * **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". * **Metric** (*string*) -- **[REQUIRED]** Which metric Cost Explorer uses to create your forecast. Valid values for a "GetUsageForecast" call are the following: * USAGE_QUANTITY * NORMALIZED_USAGE_AMOUNT * **Granularity** (*string*) -- **[REQUIRED]** How granular you want the forecast to be. You can get 3 months of "DAILY" forecasts or 12 months of "MONTHLY" forecasts. The "GetUsageForecast" operation supports only "DAILY" and "MONTHLY" granularities. * **Filter** (*dict*) -- The filters that you want to use to filter your forecast. The "GetUsageForecast" API supports filtering by the following dimensions: * "AZ" * "INSTANCE_TYPE" * "LINKED_ACCOUNT" * "LINKED_ACCOUNT_NAME" * "OPERATION" * "PURCHASE_TYPE" * "REGION" * "SERVICE" * "USAGE_TYPE" * "USAGE_TYPE_GROUP" * "RECORD_TYPE" * "OPERATING_SYSTEM" * "TENANCY" * "SCOPE" * "PLATFORM" * "SUBSCRIPTION_ID" * "LEGAL_ENTITY_NAME" * "DEPLOYMENT_OPTION" * "DATABASE_ENGINE" * "INSTANCE_TYPE_FAMILY" * "BILLING_ENTITY" * "RESERVATION_ID" * "SAVINGS_PLAN_ARN" * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **BillingViewArn** (*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. * **PredictionIntervalLevel** (*integer*) -- Amazon Web Services Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals. Return type: dict Returns: **Response Syntax** { 'Total': { 'Amount': 'string', 'Unit': 'string' }, 'ForecastResultsByTime': [ { 'TimePeriod': { 'Start': 'string', 'End': 'string' }, 'MeanValue': 'string', 'PredictionIntervalLowerBound': 'string', 'PredictionIntervalUpperBound': 'string' }, ] } **Response Structure** * *(dict) --* * **Total** *(dict) --* How much you're forecasted to use over the forecast period. * **Amount** *(string) --* The actual number that represents the metric. * **Unit** *(string) --* The unit that the metric is given in. * **ForecastResultsByTime** *(list) --* The forecasts for your query, in order. For "DAILY" forecasts, this is a list of days. For "MONTHLY" forecasts, this is a list of months. * *(dict) --* The forecast that's created for your query. * **TimePeriod** *(dict) --* The period of time that the forecast covers. * **Start** *(string) --* 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. * **End** *(string) --* 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". * **MeanValue** *(string) --* The mean value of the forecast. * **PredictionIntervalLowerBound** *(string) --* The lower limit for the prediction interval. * **PredictionIntervalUpperBound** *(string) --* The upper limit for the prediction interval. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.UnresolvableUsageUnitException" * "CostExplorer.Client.exceptions.ResourceNotFoundException" CostExplorer / Client / get_savings_plans_purchase_recommendation get_savings_plans_purchase_recommendation ***************************************** CostExplorer.Client.get_savings_plans_purchase_recommendation(**kwargs) Retrieves the Savings Plans recommendations for your account. First use "StartSavingsPlansPurchaseRecommendationGeneration" to generate a new set of recommendations, and then use "GetSavingsPlansPurchaseRecommendation" to retrieve them. See also: AWS API Documentation **Request Syntax** response = client.get_savings_plans_purchase_recommendation( SavingsPlansType='COMPUTE_SP'|'EC2_INSTANCE_SP'|'SAGEMAKER_SP', TermInYears='ONE_YEAR'|'THREE_YEARS', PaymentOption='NO_UPFRONT'|'PARTIAL_UPFRONT'|'ALL_UPFRONT'|'LIGHT_UTILIZATION'|'MEDIUM_UTILIZATION'|'HEAVY_UTILIZATION', AccountScope='PAYER'|'LINKED', NextPageToken='string', PageSize=123, LookbackPeriodInDays='SEVEN_DAYS'|'THIRTY_DAYS'|'SIXTY_DAYS', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } } ) Parameters: * **SavingsPlansType** (*string*) -- **[REQUIRED]** The Savings Plans recommendation type that's requested. * **TermInYears** (*string*) -- **[REQUIRED]** The savings plan recommendation term that's used to generate these recommendations. * **PaymentOption** (*string*) -- **[REQUIRED]** The payment option that's used to generate these recommendations. * **AccountScope** (*string*) -- The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to "PAYER". If the value is "LINKED", recommendations are calculated for individual member accounts only. * **NextPageToken** (*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. * **PageSize** (*integer*) -- The number of recommendations that you want returned in a single response object. * **LookbackPeriodInDays** (*string*) -- **[REQUIRED]** The lookback period that's used to generate the recommendation. * **Filter** (*dict*) -- You can filter your recommendations by Account ID with the "LINKED_ACCOUNT" dimension. To filter your recommendations by Account ID, specify "Key" as "LINKED_ACCOUNT" and "Value" as the comma-separated Acount ID(s) that you want to see Savings Plans purchase recommendations for. For GetSavingsPlansPurchaseRecommendation, the "Filter" doesn't include "CostCategories" or "Tags". It only includes "Dimensions". With "Dimensions", "Key" must be "LINKED_ACCOUNT" and "Value" can be a single Account ID or multiple comma-separated Account IDs that you want to see Savings Plans Purchase Recommendations for. "AND" and "OR" operators are not supported. * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* Return type: dict Returns: **Response Syntax** { 'Metadata': { 'RecommendationId': 'string', 'GenerationTimestamp': 'string', 'AdditionalMetadata': 'string' }, 'SavingsPlansPurchaseRecommendation': { 'AccountScope': 'PAYER'|'LINKED', 'SavingsPlansType': 'COMPUTE_SP'|'EC2_INSTANCE_SP'|'SAGEMAKER_SP', 'TermInYears': 'ONE_YEAR'|'THREE_YEARS', 'PaymentOption': 'NO_UPFRONT'|'PARTIAL_UPFRONT'|'ALL_UPFRONT'|'LIGHT_UTILIZATION'|'MEDIUM_UTILIZATION'|'HEAVY_UTILIZATION', 'LookbackPeriodInDays': 'SEVEN_DAYS'|'THIRTY_DAYS'|'SIXTY_DAYS', 'SavingsPlansPurchaseRecommendationDetails': [ { 'SavingsPlansDetails': { 'Region': 'string', 'InstanceFamily': 'string', 'OfferingId': 'string' }, 'AccountId': 'string', 'UpfrontCost': 'string', 'EstimatedROI': 'string', 'CurrencyCode': 'string', 'EstimatedSPCost': 'string', 'EstimatedOnDemandCost': 'string', 'EstimatedOnDemandCostWithCurrentCommitment': 'string', 'EstimatedSavingsAmount': 'string', 'EstimatedSavingsPercentage': 'string', 'HourlyCommitmentToPurchase': 'string', 'EstimatedAverageUtilization': 'string', 'EstimatedMonthlySavingsAmount': 'string', 'CurrentMinimumHourlyOnDemandSpend': 'string', 'CurrentMaximumHourlyOnDemandSpend': 'string', 'CurrentAverageHourlyOnDemandSpend': 'string', 'RecommendationDetailId': 'string' }, ], 'SavingsPlansPurchaseRecommendationSummary': { 'EstimatedROI': 'string', 'CurrencyCode': 'string', 'EstimatedTotalCost': 'string', 'CurrentOnDemandSpend': 'string', 'EstimatedSavingsAmount': 'string', 'TotalRecommendationCount': 'string', 'DailyCommitmentToPurchase': 'string', 'HourlyCommitmentToPurchase': 'string', 'EstimatedSavingsPercentage': 'string', 'EstimatedMonthlySavingsAmount': 'string', 'EstimatedOnDemandCostWithCurrentCommitment': 'string' } }, 'NextPageToken': 'string' } **Response Structure** * *(dict) --* * **Metadata** *(dict) --* Information that regards this specific recommendation set. * **RecommendationId** *(string) --* The unique identifier for the recommendation set. * **GenerationTimestamp** *(string) --* The timestamp that shows when the recommendations were generated. * **AdditionalMetadata** *(string) --* Additional metadata that might be applicable to the recommendation. * **SavingsPlansPurchaseRecommendation** *(dict) --* Contains your request parameters, Savings Plan Recommendations Summary, and Details. * **AccountScope** *(string) --* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations that include the management account and member accounts if the value is set to "PAYER". If the value is "LINKED", recommendations are calculated for individual member accounts only. * **SavingsPlansType** *(string) --* The requested Savings Plans recommendation type. * **TermInYears** *(string) --* The Savings Plans recommendation term in years. It's used to generate the recommendation. * **PaymentOption** *(string) --* The payment option that's used to generate the recommendation. * **LookbackPeriodInDays** *(string) --* The lookback period in days that's used to generate the recommendation. * **SavingsPlansPurchaseRecommendationDetails** *(list) --* Details for the Savings Plans that we recommend that you purchase to cover existing Savings Plans eligible workloads. * *(dict) --* Details for your recommended Savings Plans. * **SavingsPlansDetails** *(dict) --* Details for your recommended Savings Plans. * **Region** *(string) --* A collection of Amazon Web Services resources in a geographic area. Each Amazon Web Services Region is isolated and independent of the other Regions. * **InstanceFamily** *(string) --* A group of instance types that Savings Plans applies to. * **OfferingId** *(string) --* The unique ID that's used to distinguish Savings Plans from one another. * **AccountId** *(string) --* The "AccountID" the recommendation is generated for. * **UpfrontCost** *(string) --* The upfront cost of the recommended Savings Plans, based on the selected payment option. * **EstimatedROI** *(string) --* The estimated return on investment that's based on the recommended Savings Plans that you purchased. This is calculated as "estimatedSavingsAmount"/ >>``<>``< "Even" - Allocates costs evenly across all targets. * **Parameters** *(list) --* The parameters for a split charge method. This is only required for the "FIXED" method. * *(dict) --* The parameters for a split charge method. * **Type** *(string) --* **[REQUIRED]** The parameter type. * **Values** *(list) --* **[REQUIRED]** The parameter values. * *(string) --* * **ResourceTags** (*list*) -- An optional list of tags to associate with the specified CostCategory. You can use resource tags to control access to your "cost category" using IAM policies. Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags: * Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use * The maximum length of a key is 128 characters * The maximum length of a value is 256 characters * Keys and values can only contain alphanumeric characters, spaces, and any of the following: "_.:/=+@-" * Keys and values are case sensitive * Keys and values are trimmed for any leading or trailing whitespaces * Don’t use "aws:" as a prefix for your keys. This prefix is reserved for Amazon Web Services use * *(dict) --* The tag structure that contains a tag key and value. Note: Tagging is supported only for the following Cost Explorer resource types: AnomalyMonitor, AnomalySubscription, CostCategory. * **Key** *(string) --* **[REQUIRED]** The key that's associated with the tag. * **Value** *(string) --* **[REQUIRED]** The value that's associated with the tag. Return type: dict Returns: **Response Syntax** { 'CostCategoryArn': 'string', 'EffectiveStart': 'string' } **Response Structure** * *(dict) --* * **CostCategoryArn** *(string) --* The unique identifier for your newly created Cost Category. * **EffectiveStart** *(string) --* The Cost Category's effective start date. It can only be a billing start date (first day of the month). **Exceptions** * "CostExplorer.Client.exceptions.ServiceQuotaExceededException" * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_anomaly_monitors get_anomaly_monitors ******************** CostExplorer.Client.get_anomaly_monitors(**kwargs) Retrieves the cost anomaly monitor definitions for your account. You can filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). See also: AWS API Documentation **Request Syntax** response = client.get_anomaly_monitors( MonitorArnList=[ 'string', ], NextPageToken='string', MaxResults=123 ) Parameters: * **MonitorArnList** (*list*) -- A list of cost anomaly monitor ARNs. * *(string) --* * **NextPageToken** (*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. * **MaxResults** (*integer*) -- The number of entries that a paginated response contains. Return type: dict Returns: **Response Syntax** { 'AnomalyMonitors': [ { 'MonitorArn': 'string', 'MonitorName': 'string', 'CreationDate': 'string', 'LastUpdatedDate': 'string', 'LastEvaluatedDate': 'string', 'MonitorType': 'DIMENSIONAL'|'CUSTOM', 'MonitorDimension': 'SERVICE', 'MonitorSpecification': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'DimensionalValueCount': 123 }, ], 'NextPageToken': 'string' } **Response Structure** * *(dict) --* * **AnomalyMonitors** *(list) --* A list of cost anomaly monitors that includes the detailed metadata for each monitor. * *(dict) --* This object continuously inspects your account's cost data for anomalies. It's based on "MonitorType" and "MonitorSpecification". The content consists of detailed metadata and the current status of the monitor object. * **MonitorArn** *(string) --* The Amazon Resource Name (ARN) value. * **MonitorName** *(string) --* The name of the monitor. * **CreationDate** *(string) --* The date when the monitor was created. * **LastUpdatedDate** *(string) --* The date when the monitor was last updated. * **LastEvaluatedDate** *(string) --* The date when the monitor last evaluated for anomalies. * **MonitorType** *(string) --* The possible type values. * **MonitorDimension** *(string) --* The dimensions to evaluate. * **MonitorSpecification** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **DimensionalValueCount** *(integer) --* The value for evaluated dimensions. * **NextPageToken** *(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. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.UnknownMonitorException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" CostExplorer / Client / update_cost_allocation_tags_status update_cost_allocation_tags_status ********************************** CostExplorer.Client.update_cost_allocation_tags_status(**kwargs) Updates status for cost allocation tags in bulk, with maximum batch size of 20. If the tag status that's updated is the same as the existing tag status, the request doesn't fail. Instead, it doesn't have any effect on the tag status (for example, activating the active tag). See also: AWS API Documentation **Request Syntax** response = client.update_cost_allocation_tags_status( CostAllocationTagsStatus=[ { 'TagKey': 'string', 'Status': 'Active'|'Inactive' }, ] ) Parameters: **CostAllocationTagsStatus** (*list*) -- **[REQUIRED]** The list of "CostAllocationTagStatusEntry" objects that are used to update cost allocation tags status for this request. * *(dict) --* The cost allocation tag status. The status of a key can either be active or inactive. * **TagKey** *(string) --* **[REQUIRED]** The key for the cost allocation tag. * **Status** *(string) --* **[REQUIRED]** The status of a cost allocation tag. Return type: dict Returns: **Response Syntax** { 'Errors': [ { 'TagKey': 'string', 'Code': 'string', 'Message': 'string' }, ] } **Response Structure** * *(dict) --* * **Errors** *(list) --* A list of "UpdateCostAllocationTagsStatusError" objects with error details about each cost allocation tag that can't be updated. If there's no failure, an empty array returns. * *(dict) --* Gives a detailed description of the result of an action. It's on each cost allocation tag entry in the request. * **TagKey** *(string) --* The key for the cost allocation tag. * **Code** *(string) --* An error code representing why the action failed on this entry. * **Message** *(string) --* A message explaining why the action failed on this entry. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_cost_comparison_drivers get_cost_comparison_drivers *************************** CostExplorer.Client.get_cost_comparison_drivers(**kwargs) Retrieves key factors driving cost changes between two time periods within the last 13 months, such as usage changes, discount changes, and commitment-based savings. If you have enabled multi-year data at monthly granularity, you can go back up to 38 months. See also: AWS API Documentation **Request Syntax** response = client.get_cost_comparison_drivers( BillingViewArn='string', BaselineTimePeriod={ 'Start': 'string', 'End': 'string' }, ComparisonTimePeriod={ 'Start': 'string', 'End': 'string' }, MetricForComparison='string', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, GroupBy=[ { 'Type': 'DIMENSION'|'TAG'|'COST_CATEGORY', 'Key': 'string' }, ], MaxResults=123, NextPageToken='string' ) Parameters: * **BillingViewArn** (*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. * **BaselineTimePeriod** (*dict*) -- **[REQUIRED]** The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **ComparisonTimePeriod** (*dict*) -- **[REQUIRED]** The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **MetricForComparison** (*string*) -- **[REQUIRED]** The cost and usage metric to compare. Valid values are "AmortizedCost", "BlendedCost", "NetAmortizedCost", "NetUnblendedCost", "NormalizedUsageAmount", "UnblendedCost", and "UsageQuantity". * **Filter** (*dict*) -- 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **GroupBy** (*list*) -- You can group results using the attributes "DIMENSION", "TAG", and "COST_CATEGORY". Note that "SERVICE" and "USAGE_TYPE" dimensions are automatically included in the cost comparison drivers analysis. * *(dict) --* Represents a group when you specify a group by criteria or in the response to a query with a specific grouping. * **Type** *(string) --* The string that represents the type of group. * **Key** *(string) --* The string that represents a key for a specified group. * **MaxResults** (*integer*) -- The maximum number of results that are returned for the request. * **NextPageToken** (*string*) -- The token to retrieve the next set of paginated results. Return type: dict Returns: **Response Syntax** { 'CostComparisonDrivers': [ { 'CostSelector': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } }, 'CostDrivers': [ { 'Type': 'string', 'Name': 'string', 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } } }, ] }, ], 'NextPageToken': 'string' } **Response Structure** * *(dict) --* * **CostComparisonDrivers** *(list) --* An array of comparison results showing factors that drive significant cost differences between "BaselineTimePeriod" and "ComparisonTimePeriod". * *(dict) --* Represents a collection of cost drivers and their associated metrics for cost comparison analysis. * **CostSelector** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Metrics** *(dict) --* A mapping of metric names to their comparison values. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **CostDrivers** *(list) --* An array of cost drivers, each representing a cost difference between the baseline and comparison time periods. Each entry also includes a metric delta (for example, usage change) that contributed to the cost variance, along with the identifier and type of change. * *(dict) --* Represents factors that contribute to cost variations between the baseline and comparison time periods, including the type of driver, an identifier of the driver, and associated metrics. * **Type** *(string) --* The category or classification of the cost driver. Values include: BUNDLED_DISCOUNT, CREDIT, OUT_OF_CYCLE_CHARGE, REFUND, RECURRING_RESERVATION_FEE, RESERVATION_USAGE, RI_VOLUME_DISCOUNT, SAVINGS_PLAN_USAGE, SAVINGS_PLAN_NEGATION, SAVINGS_PLAN_RECURRING_FEE, SUPPORT_FEE, TAX, UPFRONT_RESERVATION_FEE, USAGE_CHANGE, COMMITMENT * **Name** *(string) --* The specific identifier of the cost driver. * **Metrics** *(dict) --* A mapping of metric names to their comparison values, measuring the impact of this cost driver. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **NextPageToken** *(string) --* The token to retrieve the next set of paginated results. **Exceptions** * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.ResourceNotFoundException" CostExplorer / Client / delete_anomaly_monitor delete_anomaly_monitor ********************** CostExplorer.Client.delete_anomaly_monitor(**kwargs) Deletes a cost anomaly monitor. See also: AWS API Documentation **Request Syntax** response = client.delete_anomaly_monitor( MonitorArn='string' ) Parameters: **MonitorArn** (*string*) -- **[REQUIRED]** The unique identifier of the cost anomaly monitor that you want to delete. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.UnknownMonitorException" CostExplorer / Client / update_cost_category_definition update_cost_category_definition ******************************* CostExplorer.Client.update_cost_category_definition(**kwargs) Updates an existing Cost Category. Changes made to the Cost Category rules will be used to categorize the current month’s expenses and future expenses. This won’t change categorization for the previous months. See also: AWS API Documentation **Request Syntax** response = client.update_cost_category_definition( CostCategoryArn='string', EffectiveStart='string', RuleVersion='CostCategoryExpression.v1', Rules=[ { 'Value': 'string', 'Rule': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'InheritedValue': { 'DimensionName': 'LINKED_ACCOUNT_NAME'|'TAG', 'DimensionKey': 'string' }, 'Type': 'REGULAR'|'INHERITED_VALUE' }, ], DefaultValue='string', SplitChargeRules=[ { 'Source': 'string', 'Targets': [ 'string', ], 'Method': 'FIXED'|'PROPORTIONAL'|'EVEN', 'Parameters': [ { 'Type': 'ALLOCATION_PERCENTAGES', 'Values': [ 'string', ] }, ] }, ] ) Parameters: * **CostCategoryArn** (*string*) -- **[REQUIRED]** The unique identifier for your Cost Category. * **EffectiveStart** (*string*) -- The Cost Category's effective start date. It can only be a billing start date (first day of the month). If the date isn't provided, it's the first day of the current month. Dates can't be before the previous twelve months, or in the future. * **RuleVersion** (*string*) -- **[REQUIRED]** The rule schema version in this particular Cost Category. * **Rules** (*list*) -- **[REQUIRED]** The "Expression" object used to categorize costs. For more information, see CostCategoryRule. * *(dict) --* Rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value. * **Value** *(string) --* The default value for the cost category. * **Rule** *(dict) --* An Expression object used to categorize costs. This supports dimensions, tags, and nested expressions. Currently the only dimensions supported are "LINKED_ACCOUNT", "SERVICE_CODE", "RECORD_TYPE", "LINKED_ACCOUNT_NAME", "REGION", and "USAGE_TYPE". "RECORD_TYPE" is a dimension used for Cost Explorer APIs, and is also supported for Cost Category expressions. This dimension uses different terms, depending on whether you're using the console or API/JSON editor. For a detailed comparison, see Term Comparisons in the *Billing and Cost Management User Guide*. * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **InheritedValue** *(dict) --* The value the line item is categorized as if the line item contains the matched dimension. * **DimensionName** *(string) --* The name of the dimension that's used to group costs. If you specify "LINKED_ACCOUNT_NAME", the cost category value is based on account name. If you specify "TAG", the cost category value is based on the value of the specified tag key. * **DimensionKey** *(string) --* The key to extract cost category values. * **Type** *(string) --* You can define the "CostCategoryRule" rule type as either "REGULAR" or "INHERITED_VALUE". The "INHERITED_VALUE" rule type adds the flexibility to define a rule that dynamically inherits the cost category value. This value is from the dimension value that's defined by "CostCategoryInheritedValueDimension". For example, suppose that you want to costs to be dynamically grouped based on the value of a specific tag key. First, choose an inherited value rule type, and then choose the tag dimension and specify the tag key to use. * **DefaultValue** (*string*) -- The default value for the cost category. * **SplitChargeRules** (*list*) -- The split charge rules used to allocate your charges between your Cost Category values. * *(dict) --* Use the split charge rule to split the cost of one Cost Category value across several other target values. * **Source** *(string) --* **[REQUIRED]** The Cost Category value that you want to split. That value can't be used as a source or a target in other split charge rules. To indicate uncategorized costs, you can use an empty string as the source. * **Targets** *(list) --* **[REQUIRED]** The Cost Category values that you want to split costs across. These values can't be used as a source in other split charge rules. * *(string) --* * **Method** *(string) --* **[REQUIRED]** The method that's used to define how to split your source costs across your targets. "Proportional" - Allocates charges across your targets based on the proportional weighted cost of each target. "Fixed" - Allocates charges across your targets based on your defined allocation percentage. > "Even" - Allocates costs evenly across all targets. * **Parameters** *(list) --* The parameters for a split charge method. This is only required for the "FIXED" method. * *(dict) --* The parameters for a split charge method. * **Type** *(string) --* **[REQUIRED]** The parameter type. * **Values** *(list) --* **[REQUIRED]** The parameter values. * *(string) --* Return type: dict Returns: **Response Syntax** { 'CostCategoryArn': 'string', 'EffectiveStart': 'string' } **Response Structure** * *(dict) --* * **CostCategoryArn** *(string) --* The unique identifier for your Cost Category. * **EffectiveStart** *(string) --* The Cost Category's effective start date. It can only be a billing start date (first day of the month). **Exceptions** * "CostExplorer.Client.exceptions.ResourceNotFoundException" * "CostExplorer.Client.exceptions.ServiceQuotaExceededException" * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / create_anomaly_monitor create_anomaly_monitor ********************** CostExplorer.Client.create_anomaly_monitor(**kwargs) Creates a new cost anomaly detection monitor with the requested type and monitor specification. See also: AWS API Documentation **Request Syntax** response = client.create_anomaly_monitor( AnomalyMonitor={ 'MonitorArn': 'string', 'MonitorName': 'string', 'CreationDate': 'string', 'LastUpdatedDate': 'string', 'LastEvaluatedDate': 'string', 'MonitorType': 'DIMENSIONAL'|'CUSTOM', 'MonitorDimension': 'SERVICE', 'MonitorSpecification': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'DimensionalValueCount': 123 }, ResourceTags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **AnomalyMonitor** (*dict*) -- **[REQUIRED]** The cost anomaly detection monitor object that you want to create. * **MonitorArn** *(string) --* The Amazon Resource Name (ARN) value. * **MonitorName** *(string) --* **[REQUIRED]** The name of the monitor. * **CreationDate** *(string) --* The date when the monitor was created. * **LastUpdatedDate** *(string) --* The date when the monitor was last updated. * **LastEvaluatedDate** *(string) --* The date when the monitor last evaluated for anomalies. * **MonitorType** *(string) --* **[REQUIRED]** The possible type values. * **MonitorDimension** *(string) --* The dimensions to evaluate. * **MonitorSpecification** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **DimensionalValueCount** *(integer) --* The value for evaluated dimensions. * **ResourceTags** (*list*) -- An optional list of tags to associate with the specified AnomalyMonitor. You can use resource tags to control access to your "monitor" using IAM policies. Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags: * Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use * The maximum length of a key is 128 characters * The maximum length of a value is 256 characters * Keys and values can only contain alphanumeric characters, spaces, and any of the following: "_.:/=+@-" * Keys and values are case sensitive * Keys and values are trimmed for any leading or trailing whitespaces * Don’t use "aws:" as a prefix for your keys. This prefix is reserved for Amazon Web Services use * *(dict) --* The tag structure that contains a tag key and value. Note: Tagging is supported only for the following Cost Explorer resource types: AnomalyMonitor, AnomalySubscription, CostCategory. * **Key** *(string) --* **[REQUIRED]** The key that's associated with the tag. * **Value** *(string) --* **[REQUIRED]** The value that's associated with the tag. Return type: dict Returns: **Response Syntax** { 'MonitorArn': 'string' } **Response Structure** * *(dict) --* * **MonitorArn** *(string) --* The unique identifier of your newly created cost anomaly detection monitor. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_savings_plans_utilization get_savings_plans_utilization ***************************** CostExplorer.Client.get_savings_plans_utilization(**kwargs) Retrieves the Savings Plans utilization for your account across date ranges with daily or monthly granularity. Management account in an organization have access to member accounts. You can use "GetDimensionValues" in "SAVINGS_PLANS" to determine the possible dimension values. Note: You can't group by any dimension values for "GetSavingsPlansUtilization". See also: AWS API Documentation **Request Syntax** response = client.get_savings_plans_utilization( TimePeriod={ 'Start': 'string', 'End': 'string' }, Granularity='DAILY'|'MONTHLY'|'HOURLY', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, SortBy={ 'Key': 'string', 'SortOrder': 'ASCENDING'|'DESCENDING' } ) Parameters: * **TimePeriod** (*dict*) -- **[REQUIRED]** The time period that you want the usage and costs for. The "Start" date must be within 13 months. The "End" date must be after the "Start" date, and before the current date. Future dates can't be used as an "End" date. * **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. * **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". * **Granularity** (*string*) -- The granularity of the Amazon Web Services utillization data for your Savings Plans. The "GetSavingsPlansUtilization" operation supports only "DAILY" and "MONTHLY" granularities. * **Filter** (*dict*) -- Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions: * "LINKED_ACCOUNT" * "SAVINGS_PLAN_ARN" * "SAVINGS_PLANS_TYPE" * "REGION" * "PAYMENT_OPTION" * "INSTANCE_TYPE_FAMILY" "GetSavingsPlansUtilization" uses the same Expression object as the other operations, but only "AND" is supported among each dimension. * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **SortBy** (*dict*) -- The value that you want to sort the data by. The following values are supported for "Key": * "UtilizationPercentage" * "TotalCommitment" * "UsedCommitment" * "UnusedCommitment" * "NetSavings" The supported values for "SortOrder" are "ASCENDING" and "DESCENDING". * **Key** *(string) --* **[REQUIRED]** The key that's used to sort the data. * **SortOrder** *(string) --* The order that's used to sort the data. Return type: dict Returns: **Response Syntax** { 'SavingsPlansUtilizationsByTime': [ { 'TimePeriod': { 'Start': 'string', 'End': 'string' }, 'Utilization': { 'TotalCommitment': 'string', 'UsedCommitment': 'string', 'UnusedCommitment': 'string', 'UtilizationPercentage': 'string' }, 'Savings': { 'NetSavings': 'string', 'OnDemandCostEquivalent': 'string' }, 'AmortizedCommitment': { 'AmortizedRecurringCommitment': 'string', 'AmortizedUpfrontCommitment': 'string', 'TotalAmortizedCommitment': 'string' } }, ], 'Total': { 'Utilization': { 'TotalCommitment': 'string', 'UsedCommitment': 'string', 'UnusedCommitment': 'string', 'UtilizationPercentage': 'string' }, 'Savings': { 'NetSavings': 'string', 'OnDemandCostEquivalent': 'string' }, 'AmortizedCommitment': { 'AmortizedRecurringCommitment': 'string', 'AmortizedUpfrontCommitment': 'string', 'TotalAmortizedCommitment': 'string' } } } **Response Structure** * *(dict) --* * **SavingsPlansUtilizationsByTime** *(list) --* The amount of cost/commitment that you used your Savings Plans. You can use it to specify date ranges. * *(dict) --* The amount of Savings Plans utilization (in hours). * **TimePeriod** *(dict) --* The time period of the request. * **Start** *(string) --* 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. * **End** *(string) --* 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". * **Utilization** *(dict) --* A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible. * **TotalCommitment** *(string) --* The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts). * **UsedCommitment** *(string) --* The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period. * **UnusedCommitment** *(string) --* The amount of your Savings Plans commitment that wasn't consumed from Savings Plans eligible usage in a specific period. * **UtilizationPercentage** *(string) --* The amount of "UsedCommitment" divided by the "TotalCommitment" for your Savings Plans. * **Savings** *(dict) --* The amount that's saved by using existing Savings Plans. Savings returns both net savings from Savings Plans and also the "onDemandCostEquivalent" of the Savings Plans when considering the utilization rate. * **NetSavings** *(string) --* The savings amount that you're accumulating for the usage that's covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage. * **OnDemandCostEquivalent** *(string) --* How much the amount that the usage would have cost if it was accrued at the On-Demand rate. * **AmortizedCommitment** *(dict) --* The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees. * **AmortizedRecurringCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with either a "Partial" or a "NoUpfront". * **AmortizedUpfrontCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with an "Upfront" or "PartialUpfront" Savings Plans. * **TotalAmortizedCommitment** *(string) --* The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method. * **Total** *(dict) --* The total amount of cost/commitment that you used your Savings Plans, regardless of date ranges. * **Utilization** *(dict) --* A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible. * **TotalCommitment** *(string) --* The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts). * **UsedCommitment** *(string) --* The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period. * **UnusedCommitment** *(string) --* The amount of your Savings Plans commitment that wasn't consumed from Savings Plans eligible usage in a specific period. * **UtilizationPercentage** *(string) --* The amount of "UsedCommitment" divided by the "TotalCommitment" for your Savings Plans. * **Savings** *(dict) --* The amount that's saved by using existing Savings Plans. Savings returns both net savings from Savings Plans and also the "onDemandCostEquivalent" of the Savings Plans when considering the utilization rate. * **NetSavings** *(string) --* The savings amount that you're accumulating for the usage that's covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage. * **OnDemandCostEquivalent** *(string) --* How much the amount that the usage would have cost if it was accrued at the On-Demand rate. * **AmortizedCommitment** *(dict) --* The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees. * **AmortizedRecurringCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with either a "Partial" or a "NoUpfront". * **AmortizedUpfrontCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with an "Upfront" or "PartialUpfront" Savings Plans. * **TotalAmortizedCommitment** *(string) --* The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.DataUnavailableException" CostExplorer / Client / delete_cost_category_definition delete_cost_category_definition ******************************* CostExplorer.Client.delete_cost_category_definition(**kwargs) Deletes a Cost Category. Expenses from this month going forward will no longer be categorized with this Cost Category. See also: AWS API Documentation **Request Syntax** response = client.delete_cost_category_definition( CostCategoryArn='string' ) Parameters: **CostCategoryArn** (*string*) -- **[REQUIRED]** The unique identifier for your Cost Category. Return type: dict Returns: **Response Syntax** { 'CostCategoryArn': 'string', 'EffectiveEnd': 'string' } **Response Structure** * *(dict) --* * **CostCategoryArn** *(string) --* The unique identifier for your Cost Category. * **EffectiveEnd** *(string) --* The effective end date of the Cost Category as a result of deleting it. No costs after this date is categorized by the deleted Cost Category. **Exceptions** * "CostExplorer.Client.exceptions.ResourceNotFoundException" * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_savings_plan_purchase_recommendation_details get_savings_plan_purchase_recommendation_details ************************************************ CostExplorer.Client.get_savings_plan_purchase_recommendation_details(**kwargs) Retrieves the details for a Savings Plan recommendation. These details include the hourly data-points that construct the cost, coverage, and utilization charts. See also: AWS API Documentation **Request Syntax** response = client.get_savings_plan_purchase_recommendation_details( RecommendationDetailId='string' ) Parameters: **RecommendationDetailId** (*string*) -- **[REQUIRED]** The ID that is associated with the Savings Plan recommendation. Return type: dict Returns: **Response Syntax** { 'RecommendationDetailId': 'string', 'RecommendationDetailData': { 'AccountScope': 'PAYER'|'LINKED', 'LookbackPeriodInDays': 'SEVEN_DAYS'|'THIRTY_DAYS'|'SIXTY_DAYS', 'SavingsPlansType': 'COMPUTE_SP'|'EC2_INSTANCE_SP'|'SAGEMAKER_SP', 'TermInYears': 'ONE_YEAR'|'THREE_YEARS', 'PaymentOption': 'NO_UPFRONT'|'PARTIAL_UPFRONT'|'ALL_UPFRONT'|'LIGHT_UTILIZATION'|'MEDIUM_UTILIZATION'|'HEAVY_UTILIZATION', 'AccountId': 'string', 'CurrencyCode': 'string', 'InstanceFamily': 'string', 'Region': 'string', 'OfferingId': 'string', 'GenerationTimestamp': 'string', 'LatestUsageTimestamp': 'string', 'CurrentAverageHourlyOnDemandSpend': 'string', 'CurrentMaximumHourlyOnDemandSpend': 'string', 'CurrentMinimumHourlyOnDemandSpend': 'string', 'EstimatedAverageUtilization': 'string', 'EstimatedMonthlySavingsAmount': 'string', 'EstimatedOnDemandCost': 'string', 'EstimatedOnDemandCostWithCurrentCommitment': 'string', 'EstimatedROI': 'string', 'EstimatedSPCost': 'string', 'EstimatedSavingsAmount': 'string', 'EstimatedSavingsPercentage': 'string', 'ExistingHourlyCommitment': 'string', 'HourlyCommitmentToPurchase': 'string', 'UpfrontCost': 'string', 'CurrentAverageCoverage': 'string', 'EstimatedAverageCoverage': 'string', 'MetricsOverLookbackPeriod': [ { 'StartTime': 'string', 'EstimatedOnDemandCost': 'string', 'CurrentCoverage': 'string', 'EstimatedCoverage': 'string', 'EstimatedNewCommitmentUtilization': 'string' }, ] } } **Response Structure** * *(dict) --* * **RecommendationDetailId** *(string) --* The ID that is associated with the Savings Plan recommendation. * **RecommendationDetailData** *(dict) --* Contains detailed information about a specific Savings Plan recommendation. * **AccountScope** *(string) --* The account scope that you want your recommendations for. Amazon Web Services calculates recommendations including the management account and member accounts if the value is set to PAYER. If the value is LINKED, recommendations are calculated for individual member accounts only. * **LookbackPeriodInDays** *(string) --* How many days of previous usage that Amazon Web Services considers when making this recommendation. * **SavingsPlansType** *(string) --* The requested Savings Plan recommendation type. * **TermInYears** *(string) --* The term of the commitment in years. * **PaymentOption** *(string) --* The payment option for the commitment (for example, All Upfront or No Upfront). * **AccountId** *(string) --* The AccountID that the recommendation is generated for. * **CurrencyCode** *(string) --* The currency code that Amazon Web Services used to generate the recommendation and present potential savings. * **InstanceFamily** *(string) --* The instance family of the recommended Savings Plan. * **Region** *(string) --* The region the recommendation is generated for. * **OfferingId** *(string) --* The unique ID that's used to distinguish Savings Plans from one another. * **GenerationTimestamp** *(string) --* The period of time that you want the usage and costs for. * **LatestUsageTimestamp** *(string) --* The period of time that you want the usage and costs for. * **CurrentAverageHourlyOnDemandSpend** *(string) --* The average value of hourly On-Demand spend over the lookback period of the applicable usage type. * **CurrentMaximumHourlyOnDemandSpend** *(string) --* The highest value of hourly On-Demand spend over the lookback period of the applicable usage type. * **CurrentMinimumHourlyOnDemandSpend** *(string) --* The lowest value of hourly On-Demand spend over the lookback period of the applicable usage type. * **EstimatedAverageUtilization** *(string) --* The estimated utilization of the recommended Savings Plan. * **EstimatedMonthlySavingsAmount** *(string) --* The estimated monthly savings amount based on the recommended Savings Plan. * **EstimatedOnDemandCost** *(string) --* The remaining On-Demand cost estimated to not be covered by the recommended Savings Plan, over the length of the lookback period. * **EstimatedOnDemandCostWithCurrentCommitment** *(string) --* The estimated On-Demand costs you expect with no additional commitment, based on your usage of the selected time period and the Savings Plan you own. * **EstimatedROI** *(string) --* The estimated return on investment that's based on the recommended Savings Plan that you purchased. This is calculated as estimatedSavingsAmount/estimatedSPCost*100. * **EstimatedSPCost** *(string) --* The cost of the recommended Savings Plan over the length of the lookback period. * **EstimatedSavingsAmount** *(string) --* The estimated savings amount that's based on the recommended Savings Plan over the length of the lookback period. * **EstimatedSavingsPercentage** *(string) --* The estimated savings percentage relative to the total cost of applicable On-Demand usage over the lookback period. * **ExistingHourlyCommitment** *(string) --* The existing hourly commitment for the Savings Plan type. * **HourlyCommitmentToPurchase** *(string) --* The recommended hourly commitment level for the Savings Plan type and the configuration that's based on the usage during the lookback period. * **UpfrontCost** *(string) --* The upfront cost of the recommended Savings Plan, based on the selected payment option. * **CurrentAverageCoverage** *(string) --* The average value of hourly coverage over the lookback period. * **EstimatedAverageCoverage** *(string) --* The estimated coverage of the recommended Savings Plan. * **MetricsOverLookbackPeriod** *(list) --* The related hourly cost, coverage, and utilization metrics over the lookback period. * *(dict) --* Contains the hourly metrics for the given recommendation over the lookback period. * **StartTime** *(string) --* The period of time that you want the usage and costs for. * **EstimatedOnDemandCost** *(string) --* The remaining On-Demand cost estimated to not be covered by the recommended Savings Plan, over the length of the lookback period. * **CurrentCoverage** *(string) --* The current amount of Savings Plans eligible usage that the Savings Plan covered. * **EstimatedCoverage** *(string) --* The estimated coverage amount based on the recommended Savings Plan. * **EstimatedNewCommitmentUtilization** *(string) --* The estimated utilization for the recommended Savings Plan. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.DataUnavailableException" CostExplorer / Client / close close ***** CostExplorer.Client.close() Closes underlying endpoint connections. CostExplorer / Client / list_cost_allocation_tag_backfill_history list_cost_allocation_tag_backfill_history ***************************************** CostExplorer.Client.list_cost_allocation_tag_backfill_history(**kwargs) Retrieves a list of your historical cost allocation tag backfill requests. See also: AWS API Documentation **Request Syntax** response = client.list_cost_allocation_tag_backfill_history( NextToken='string', MaxResults=123 ) Parameters: * **NextToken** (*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. * **MaxResults** (*integer*) -- The maximum number of objects that are returned for this request. Return type: dict Returns: **Response Syntax** { 'BackfillRequests': [ { 'BackfillFrom': 'string', 'RequestedAt': 'string', 'CompletedAt': 'string', 'BackfillStatus': 'SUCCEEDED'|'PROCESSING'|'FAILED', 'LastUpdatedAt': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **BackfillRequests** *(list) --* The list of historical cost allocation tag backfill requests. * *(dict) --* The cost allocation tag backfill request structure that contains metadata and details of a certain backfill. * **BackfillFrom** *(string) --* The date the backfill starts from. * **RequestedAt** *(string) --* The time when the backfill was requested. * **CompletedAt** *(string) --* The backfill completion time. * **BackfillStatus** *(string) --* The status of the cost allocation tag backfill request. * **LastUpdatedAt** *(string) --* The time when the backfill status was last updated. * **NextToken** *(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. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" CostExplorer / Client / get_cost_and_usage_comparisons get_cost_and_usage_comparisons ****************************** CostExplorer.Client.get_cost_and_usage_comparisons(**kwargs) Retrieves cost and usage comparisons for your account between two periods within the last 13 months. If you have enabled multi-year data at monthly granularity, you can go back up to 38 months. See also: AWS API Documentation **Request Syntax** response = client.get_cost_and_usage_comparisons( BillingViewArn='string', BaselineTimePeriod={ 'Start': 'string', 'End': 'string' }, ComparisonTimePeriod={ 'Start': 'string', 'End': 'string' }, MetricForComparison='string', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, GroupBy=[ { 'Type': 'DIMENSION'|'TAG'|'COST_CATEGORY', 'Key': 'string' }, ], MaxResults=123, NextPageToken='string' ) Parameters: * **BillingViewArn** (*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. * **BaselineTimePeriod** (*dict*) -- **[REQUIRED]** The reference time period for comparison. This time period serves as the baseline against which other cost and usage data will be compared. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **ComparisonTimePeriod** (*dict*) -- **[REQUIRED]** The comparison time period for analysis. This time period's cost and usage data will be compared against the baseline time period. The interval must start and end on the first day of a month, with a duration of exactly one month. * **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. * **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". * **MetricForComparison** (*string*) -- **[REQUIRED]** The cost and usage metric to compare. Valid values are "AmortizedCost", "BlendedCost", "NetAmortizedCost", "NetUnblendedCost", "NormalizedUsageAmount", "UnblendedCost", and "UsageQuantity". * **Filter** (*dict*) -- 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **GroupBy** (*list*) -- You can group results using the attributes "DIMENSION", "TAG", and "COST_CATEGORY". * *(dict) --* Represents a group when you specify a group by criteria or in the response to a query with a specific grouping. * **Type** *(string) --* The string that represents the type of group. * **Key** *(string) --* The string that represents a key for a specified group. * **MaxResults** (*integer*) -- The maximum number of results that are returned for the request. * **NextPageToken** (*string*) -- The token to retrieve the next set of paginated results. Return type: dict Returns: **Response Syntax** { 'CostAndUsageComparisons': [ { 'CostAndUsageSelector': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'Metrics': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } } }, ], 'TotalCostAndUsage': { 'string': { 'BaselineTimePeriodAmount': 'string', 'ComparisonTimePeriodAmount': 'string', 'Difference': 'string', 'Unit': 'string' } }, 'NextPageToken': 'string' } **Response Structure** * *(dict) --* * **CostAndUsageComparisons** *(list) --* An array of comparison results showing cost and usage metrics between "BaselineTimePeriod" and "ComparisonTimePeriod". * *(dict) --* Represents a comparison of cost and usage metrics between two time periods. * **CostAndUsageSelector** *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Metrics** *(dict) --* A mapping of metric names to their comparison values. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **TotalCostAndUsage** *(dict) --* A summary of the total cost and usage, comparing amounts between "BaselineTimePeriod" and "ComparisonTimePeriod" and their differences. This total represents the aggregate total across all paginated results, if the response spans multiple pages. * *(string) --* * *(dict) --* Contains cost or usage metric values for comparing two time periods. Each value includes amounts for the baseline and comparison time periods, their difference, and the unit of measurement. * **BaselineTimePeriodAmount** *(string) --* The numeric value for the baseline time period measurement. * **ComparisonTimePeriodAmount** *(string) --* The numeric value for the comparison time period measurement. * **Difference** *(string) --* The calculated difference between "ComparisonTimePeriodAmount" and "BaselineTimePeriodAmount". * **Unit** *(string) --* The unit of measurement applicable to all numeric values in this comparison. * **NextPageToken** *(string) --* The token to retrieve the next set of paginated results. **Exceptions** * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.ResourceNotFoundException" CostExplorer / Client / get_tags get_tags ******** CostExplorer.Client.get_tags(**kwargs) Queries for available tag keys and tag values for a specified period. You can search the tag values for an arbitrary string. See also: AWS API Documentation **Request Syntax** response = client.get_tags( SearchString='string', TimePeriod={ 'Start': 'string', 'End': 'string' }, TagKey='string', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, SortBy=[ { 'Key': 'string', 'SortOrder': 'ASCENDING'|'DESCENDING' }, ], BillingViewArn='string', MaxResults=123, NextPageToken='string' ) Parameters: * **SearchString** (*string*) -- The value that you want to search for. * **TimePeriod** (*dict*) -- **[REQUIRED]** The start and end dates 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. * **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". * **TagKey** (*string*) -- The key of the tag that you want to return values for. * **Filter** (*dict*) -- 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **SortBy** (*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" The supported values for "SortOrder" are "ASCENDING" and "DESCENDING". When you use "SortBy", "NextPageToken" and "SearchString" aren't supported. * *(dict) --* The details for how to sort the data. * **Key** *(string) --* **[REQUIRED]** The key that's used to sort the data. * **SortOrder** *(string) --* The order that's used to sort the data. * **BillingViewArn** (*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. * **MaxResults** (*integer*) -- This field is only used when SortBy is provided in the request. 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. For "GetTags", MaxResults has an upper quota of 1000. * **NextPageToken** (*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. Return type: dict Returns: **Response Syntax** { 'NextPageToken': 'string', 'Tags': [ 'string', ], 'ReturnSize': 123, 'TotalSize': 123 } **Response Structure** * *(dict) --* * **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. * **Tags** *(list) --* The tags that match your request. * *(string) --* * **ReturnSize** *(integer) --* The number of query results that Amazon Web Services returns at a time. * **TotalSize** *(integer) --* The total number of query results. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.BillExpirationException" * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" * "CostExplorer.Client.exceptions.RequestChangedException" * "CostExplorer.Client.exceptions.ResourceNotFoundException" CostExplorer / Client / describe_cost_category_definition describe_cost_category_definition ********************************* CostExplorer.Client.describe_cost_category_definition(**kwargs) Returns the name, Amazon Resource Name (ARN), rules, definition, and effective dates of a Cost Category that's defined in the account. You have the option to use "EffectiveOn" to return a Cost Category that's active on a specific date. If there's no "EffectiveOn" specified, you see a Cost Category that's effective on the current date. If Cost Category is still effective, "EffectiveEnd" is omitted in the response. See also: AWS API Documentation **Request Syntax** response = client.describe_cost_category_definition( CostCategoryArn='string', EffectiveOn='string' ) Parameters: * **CostCategoryArn** (*string*) -- **[REQUIRED]** The unique identifier for your Cost Category. * **EffectiveOn** (*string*) -- The date when the Cost Category was effective. Return type: dict Returns: **Response Syntax** { 'CostCategory': { 'CostCategoryArn': 'string', 'EffectiveStart': 'string', 'EffectiveEnd': 'string', 'Name': 'string', 'RuleVersion': 'CostCategoryExpression.v1', 'Rules': [ { 'Value': 'string', 'Rule': { 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, 'InheritedValue': { 'DimensionName': 'LINKED_ACCOUNT_NAME'|'TAG', 'DimensionKey': 'string' }, 'Type': 'REGULAR'|'INHERITED_VALUE' }, ], 'SplitChargeRules': [ { 'Source': 'string', 'Targets': [ 'string', ], 'Method': 'FIXED'|'PROPORTIONAL'|'EVEN', 'Parameters': [ { 'Type': 'ALLOCATION_PERCENTAGES', 'Values': [ 'string', ] }, ] }, ], 'ProcessingStatus': [ { 'Component': 'COST_EXPLORER', 'Status': 'PROCESSING'|'APPLIED' }, ], 'DefaultValue': 'string' } } **Response Structure** * *(dict) --* * **CostCategory** *(dict) --* The structure of Cost Categories. This includes detailed metadata and the set of rules for the "CostCategory" object. * **CostCategoryArn** *(string) --* The unique identifier for your Cost Category. * **EffectiveStart** *(string) --* The effective start date of your Cost Category. * **EffectiveEnd** *(string) --* The effective end date of your Cost Category. * **Name** *(string) --* The unique name of the Cost Category. * **RuleVersion** *(string) --* The rule schema version in this particular Cost Category. * **Rules** *(list) --* The rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value. * *(dict) --* Rules are processed in order. If there are multiple rules that match the line item, then the first rule to match is used to determine that Cost Category value. * **Value** *(string) --* The default value for the cost category. * **Rule** *(dict) --* An Expression object used to categorize costs. This supports dimensions, tags, and nested expressions. Currently the only dimensions supported are "LINKED_ACCOUNT", "SERVICE_CODE", "RECORD_TYPE", "LINKED_ACCOUNT_NAME", "REGION", and "USAGE_TYPE". "RECORD_TYPE" is a dimension used for Cost Explorer APIs, and is also supported for Cost Category expressions. This dimension uses different terms, depending on whether you're using the console or API/JSON editor. For a detailed comparison, see Term Comparisons in the *Billing and Cost Management User Guide*. * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us- east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **InheritedValue** *(dict) --* The value the line item is categorized as if the line item contains the matched dimension. * **DimensionName** *(string) --* The name of the dimension that's used to group costs. If you specify "LINKED_ACCOUNT_NAME", the cost category value is based on account name. If you specify "TAG", the cost category value is based on the value of the specified tag key. * **DimensionKey** *(string) --* The key to extract cost category values. * **Type** *(string) --* You can define the "CostCategoryRule" rule type as either "REGULAR" or "INHERITED_VALUE". The "INHERITED_VALUE" rule type adds the flexibility to define a rule that dynamically inherits the cost category value. This value is from the dimension value that's defined by "CostCategoryInheritedValueDimension". For example, suppose that you want to costs to be dynamically grouped based on the value of a specific tag key. First, choose an inherited value rule type, and then choose the tag dimension and specify the tag key to use. * **SplitChargeRules** *(list) --* The split charge rules that are used to allocate your charges between your Cost Category values. * *(dict) --* Use the split charge rule to split the cost of one Cost Category value across several other target values. * **Source** *(string) --* The Cost Category value that you want to split. That value can't be used as a source or a target in other split charge rules. To indicate uncategorized costs, you can use an empty string as the source. * **Targets** *(list) --* The Cost Category values that you want to split costs across. These values can't be used as a source in other split charge rules. * *(string) --* * **Method** *(string) --* The method that's used to define how to split your source costs across your targets. "Proportional" - Allocates charges across your targets based on the proportional weighted cost of each target. "Fixed" - Allocates charges across your targets based on your defined allocation percentage. > "Even" - Allocates costs evenly across all targets. * **Parameters** *(list) --* The parameters for a split charge method. This is only required for the "FIXED" method. * *(dict) --* The parameters for a split charge method. * **Type** *(string) --* The parameter type. * **Values** *(list) --* The parameter values. * *(string) --* * **ProcessingStatus** *(list) --* The list of processing statuses for Cost Management products for a specific cost category. * *(dict) --* The list of processing statuses for Cost Management products for a specific cost category. * **Component** *(string) --* The Cost Management product name of the applied status. * **Status** *(string) --* The process status for a specific cost category. * **DefaultValue** *(string) --* The default value for the cost category. **Exceptions** * "CostExplorer.Client.exceptions.ResourceNotFoundException" * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_anomalies get_anomalies ************* CostExplorer.Client.get_anomalies(**kwargs) Retrieves all of the cost anomalies detected on your account during the time period that's specified by the "DateInterval" object. Anomalies are available for up to 90 days. See also: AWS API Documentation **Request Syntax** response = client.get_anomalies( MonitorArn='string', DateInterval={ 'StartDate': 'string', 'EndDate': 'string' }, Feedback='YES'|'NO'|'PLANNED_ACTIVITY', TotalImpact={ 'NumericOperator': 'EQUAL'|'GREATER_THAN_OR_EQUAL'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN'|'LESS_THAN'|'BETWEEN', 'StartValue': 123.0, 'EndValue': 123.0 }, NextPageToken='string', MaxResults=123 ) Parameters: * **MonitorArn** (*string*) -- Retrieves all of the cost anomalies detected for a specific cost anomaly monitor Amazon Resource Name (ARN). * **DateInterval** (*dict*) -- **[REQUIRED]** Assigns the start and end dates for retrieving cost anomalies. The returned anomaly object will have an "AnomalyEndDate" in the specified time range. * **StartDate** *(string) --* **[REQUIRED]** The first date an anomaly was observed. * **EndDate** *(string) --* The last date an anomaly was observed. * **Feedback** (*string*) -- Filters anomaly results by the feedback field on the anomaly object. * **TotalImpact** (*dict*) -- Filters anomaly results by the total impact field on the anomaly object. For example, you can filter anomalies "GREATER_THAN 200.00" to retrieve anomalies, with an estimated dollar impact greater than 200. * **NumericOperator** *(string) --* **[REQUIRED]** The comparing value that's used in the filter. * **StartValue** *(float) --* **[REQUIRED]** The lower bound dollar value that's used in the filter. * **EndValue** *(float) --* The upper bound dollar value that's used in the filter. * **NextPageToken** (*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. * **MaxResults** (*integer*) -- The number of entries a paginated response contains. Return type: dict Returns: **Response Syntax** { 'Anomalies': [ { 'AnomalyId': 'string', 'AnomalyStartDate': 'string', 'AnomalyEndDate': 'string', 'DimensionValue': 'string', 'RootCauses': [ { 'Service': 'string', 'Region': 'string', 'LinkedAccount': 'string', 'LinkedAccountName': 'string', 'UsageType': 'string', 'Impact': { 'Contribution': 123.0 } }, ], 'AnomalyScore': { 'MaxScore': 123.0, 'CurrentScore': 123.0 }, 'Impact': { 'MaxImpact': 123.0, 'TotalImpact': 123.0, 'TotalActualSpend': 123.0, 'TotalExpectedSpend': 123.0, 'TotalImpactPercentage': 123.0 }, 'MonitorArn': 'string', 'Feedback': 'YES'|'NO'|'PLANNED_ACTIVITY' }, ], 'NextPageToken': 'string' } **Response Structure** * *(dict) --* * **Anomalies** *(list) --* A list of cost anomalies. * *(dict) --* An unusual cost pattern. This consists of the detailed metadata and the current status of the anomaly object. * **AnomalyId** *(string) --* The unique identifier for the anomaly. * **AnomalyStartDate** *(string) --* The first day the anomaly is detected. * **AnomalyEndDate** *(string) --* The last day the anomaly is detected. * **DimensionValue** *(string) --* The dimension for the anomaly (for example, an Amazon Web Services service in a service monitor). * **RootCauses** *(list) --* The list of identified root causes for the anomaly. * *(dict) --* The combination of Amazon Web Services service, linked account, linked account name, Region, and usage type where a cost anomaly is observed, along with the dollar and percentage amount of the anomaly impact. The linked account name will only be available when the account name can be identified. * **Service** *(string) --* The Amazon Web Services service name that's associated with the cost anomaly. * **Region** *(string) --* The Amazon Web Services Region that's associated with the cost anomaly. * **LinkedAccount** *(string) --* The member account value that's associated with the cost anomaly. * **LinkedAccountName** *(string) --* The member account name value that's associated with the cost anomaly. * **UsageType** *(string) --* The "UsageType" value that's associated with the cost anomaly. * **Impact** *(dict) --* The dollar impact for the root cause. * **Contribution** *(float) --* The dollar amount that this root cause contributed to the anomaly's TotalImpact. * **AnomalyScore** *(dict) --* The latest and maximum score for the anomaly. * **MaxScore** *(float) --* The maximum score that's observed during the "AnomalyDateInterval". * **CurrentScore** *(float) --* The last observed score. * **Impact** *(dict) --* The dollar impact for the anomaly. * **MaxImpact** *(float) --* The maximum dollar value that's observed for an anomaly. * **TotalImpact** *(float) --* The cumulative dollar difference between the total actual spend and total expected spend. It is calculated as "TotalActualSpend - TotalExpectedSpend". * **TotalActualSpend** *(float) --* The cumulative dollar amount that was actually spent during the anomaly. * **TotalExpectedSpend** *(float) --* The cumulative dollar amount that was expected to be spent during the anomaly. It is calculated using advanced machine learning models to determine the typical spending pattern based on historical data for a customer. * **TotalImpactPercentage** *(float) --* The cumulative percentage difference between the total actual spend and total expected spend. It is calculated as "(TotalImpact / TotalExpectedSpend) * 100". When "TotalExpectedSpend" is zero, this field is omitted. Expected spend can be zero in situations such as when you start to use a service for the first time. * **MonitorArn** *(string) --* The Amazon Resource Name (ARN) for the cost monitor that generated this anomaly. * **Feedback** *(string) --* The feedback value. * **NextPageToken** *(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. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.InvalidNextTokenException" CostExplorer / Client / tag_resource tag_resource ************ CostExplorer.Client.tag_resource(**kwargs) An API operation for adding one or more tags (key-value pairs) to a resource. You can use the "TagResource" operation with a resource that already has tags. If you specify a new tag key for the resource, this tag is appended to the list of tags associated with the resource. If you specify a tag key that is already associated with the resource, the new tag value you specify replaces the previous value for that tag. Although the maximum number of array members is 200, user-tag maximum is 50. The remaining are reserved for Amazon Web Services use. See also: AWS API Documentation **Request Syntax** response = client.tag_resource( ResourceArn='string', ResourceTags=[ { 'Key': 'string', 'Value': 'string' }, ] ) Parameters: * **ResourceArn** (*string*) -- **[REQUIRED]** The Amazon Resource Name (ARN) of the resource. For a list of supported resources, see ResourceTag. * **ResourceTags** (*list*) -- **[REQUIRED]** A list of tag key-value pairs to be added to the resource. Each tag consists of a key and a value, and each key must be unique for the resource. The following restrictions apply to resource tags: * Although the maximum number of array members is 200, you can assign a maximum of 50 user-tags to one resource. The remaining are reserved for Amazon Web Services use * The maximum length of a key is 128 characters * The maximum length of a value is 256 characters * Keys and values can only contain alphanumeric characters, spaces, and any of the following: "_.:/=+@-" * Keys and values are case sensitive * Keys and values are trimmed for any leading or trailing whitespaces * Don’t use "aws:" as a prefix for your keys. This prefix is reserved for Amazon Web Services use * *(dict) --* The tag structure that contains a tag key and value. Note: Tagging is supported only for the following Cost Explorer resource types: AnomalyMonitor, AnomalySubscription, CostCategory. * **Key** *(string) --* **[REQUIRED]** The key that's associated with the tag. * **Value** *(string) --* **[REQUIRED]** The value that's associated with the tag. Return type: dict Returns: **Response Syntax** {} **Response Structure** * *(dict) --* **Exceptions** * "CostExplorer.Client.exceptions.ResourceNotFoundException" * "CostExplorer.Client.exceptions.TooManyTagsException" * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / update_anomaly_monitor update_anomaly_monitor ********************** CostExplorer.Client.update_anomaly_monitor(**kwargs) Updates an existing cost anomaly monitor. The changes made are applied going forward, and doesn't change anomalies detected in the past. See also: AWS API Documentation **Request Syntax** response = client.update_anomaly_monitor( MonitorArn='string', MonitorName='string' ) Parameters: * **MonitorArn** (*string*) -- **[REQUIRED]** Cost anomaly monitor Amazon Resource Names (ARNs). * **MonitorName** (*string*) -- The new name for the cost anomaly monitor. Return type: dict Returns: **Response Syntax** { 'MonitorArn': 'string' } **Response Structure** * *(dict) --* * **MonitorArn** *(string) --* A cost anomaly monitor ARN. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.UnknownMonitorException" CostExplorer / Client / list_cost_category_definitions list_cost_category_definitions ****************************** CostExplorer.Client.list_cost_category_definitions(**kwargs) Returns the name, Amazon Resource Name (ARN), "NumberOfRules" and effective dates of all Cost Categories defined in the account. You have the option to use "EffectiveOn" to return a list of Cost Categories that were active on a specific date. If there is no "EffectiveOn" specified, you’ll see Cost Categories that are effective on the current date. If Cost Category is still effective, "EffectiveEnd" is omitted in the response. "ListCostCategoryDefinitions" supports pagination. The request can have a "MaxResults" range up to 100. See also: AWS API Documentation **Request Syntax** response = client.list_cost_category_definitions( EffectiveOn='string', NextToken='string', MaxResults=123 ) Parameters: * **EffectiveOn** (*string*) -- The date when the Cost Category was effective. * **NextToken** (*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. * **MaxResults** (*integer*) -- The number of entries a paginated response contains. Return type: dict Returns: **Response Syntax** { 'CostCategoryReferences': [ { 'CostCategoryArn': 'string', 'Name': 'string', 'EffectiveStart': 'string', 'EffectiveEnd': 'string', 'NumberOfRules': 123, 'ProcessingStatus': [ { 'Component': 'COST_EXPLORER', 'Status': 'PROCESSING'|'APPLIED' }, ], 'Values': [ 'string', ], 'DefaultValue': 'string' }, ], 'NextToken': 'string' } **Response Structure** * *(dict) --* * **CostCategoryReferences** *(list) --* A reference to a Cost Category that contains enough information to identify the Cost Category. * *(dict) --* A reference to a Cost Category containing only enough information to identify the Cost Category. You can use this information to retrieve the full Cost Category information using "DescribeCostCategory". * **CostCategoryArn** *(string) --* The unique identifier for your Cost Category. * **Name** *(string) --* The unique name of the Cost Category. * **EffectiveStart** *(string) --* The Cost Category's effective start date. * **EffectiveEnd** *(string) --* The Cost Category's effective end date. * **NumberOfRules** *(integer) --* The number of rules that are associated with a specific Cost Category. * **ProcessingStatus** *(list) --* The list of processing statuses for Cost Management products for a specific cost category. * *(dict) --* The list of processing statuses for Cost Management products for a specific cost category. * **Component** *(string) --* The Cost Management product name of the applied status. * **Status** *(string) --* The process status for a specific cost category. * **Values** *(list) --* A list of unique cost category values in a specific cost category. * *(string) --* The default value for the cost category. * **DefaultValue** *(string) --* The default value for the cost category. * **NextToken** *(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. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_cost_forecast get_cost_forecast ***************** CostExplorer.Client.get_cost_forecast(**kwargs) Retrieves a forecast for how much Amazon Web Services predicts that you will spend over the forecast time period that you select, based on your past costs. See also: AWS API Documentation **Request Syntax** response = client.get_cost_forecast( TimePeriod={ 'Start': 'string', 'End': 'string' }, Metric='BLENDED_COST'|'UNBLENDED_COST'|'AMORTIZED_COST'|'NET_UNBLENDED_COST'|'NET_AMORTIZED_COST'|'USAGE_QUANTITY'|'NORMALIZED_USAGE_AMOUNT', Granularity='DAILY'|'MONTHLY'|'HOURLY', Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, BillingViewArn='string', PredictionIntervalLevel=123 ) Parameters: * **TimePeriod** (*dict*) -- **[REQUIRED]** The period of time that you want the forecast to cover. The start date must be equal to or no later than the current date to avoid a validation error. * **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. * **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". * **Metric** (*string*) -- **[REQUIRED]** Which metric Cost Explorer uses to create your forecast. For more information about blended and unblended rates, see Why does the "blended" annotation appear on some line items in my bill?. Valid values for a "GetCostForecast" call are the following: * AMORTIZED_COST * BLENDED_COST * NET_AMORTIZED_COST * NET_UNBLENDED_COST * UNBLENDED_COST * **Granularity** (*string*) -- **[REQUIRED]** How granular you want the forecast to be. You can get 3 months of "DAILY" forecasts or 12 months of "MONTHLY" forecasts. The "GetCostForecast" operation supports only "DAILY" and "MONTHLY" granularities. * **Filter** (*dict*) -- The filters that you want to use to filter your forecast. The "GetCostForecast" API supports filtering by the following dimensions: * "AZ" * "INSTANCE_TYPE" * "LINKED_ACCOUNT" * "OPERATION" * "PURCHASE_TYPE" * "REGION" * "SERVICE" * "USAGE_TYPE" * "USAGE_TYPE_GROUP" * "RECORD_TYPE" * "OPERATING_SYSTEM" * "TENANCY" * "SCOPE" * "PLATFORM" * "SUBSCRIPTION_ID" * "LEGAL_ENTITY_NAME" * "DEPLOYMENT_OPTION" * "DATABASE_ENGINE" * "INSTANCE_TYPE_FAMILY" * "BILLING_ENTITY" * "RESERVATION_ID" * "SAVINGS_PLAN_ARN" * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **BillingViewArn** (*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. * **PredictionIntervalLevel** (*integer*) -- Cost Explorer always returns the mean forecast as a single point. You can request a prediction interval around the mean by specifying a confidence level. The higher the confidence level, the more confident Cost Explorer is about the actual value falling in the prediction interval. Higher confidence levels result in wider prediction intervals. Return type: dict Returns: **Response Syntax** { 'Total': { 'Amount': 'string', 'Unit': 'string' }, 'ForecastResultsByTime': [ { 'TimePeriod': { 'Start': 'string', 'End': 'string' }, 'MeanValue': 'string', 'PredictionIntervalLowerBound': 'string', 'PredictionIntervalUpperBound': 'string' }, ] } **Response Structure** * *(dict) --* * **Total** *(dict) --* How much you are forecasted to spend over the forecast period, in "USD". * **Amount** *(string) --* The actual number that represents the metric. * **Unit** *(string) --* The unit that the metric is given in. * **ForecastResultsByTime** *(list) --* The forecasts for your query, in order. For "DAILY" forecasts, this is a list of days. For "MONTHLY" forecasts, this is a list of months. * *(dict) --* The forecast that's created for your query. * **TimePeriod** *(dict) --* The period of time that the forecast covers. * **Start** *(string) --* 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. * **End** *(string) --* 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". * **MeanValue** *(string) --* The mean value of the forecast. * **PredictionIntervalLowerBound** *(string) --* The lower limit for the prediction interval. * **PredictionIntervalUpperBound** *(string) --* The upper limit for the prediction interval. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.ResourceNotFoundException" CostExplorer / Client / provide_anomaly_feedback provide_anomaly_feedback ************************ CostExplorer.Client.provide_anomaly_feedback(**kwargs) Modifies the feedback property of a given cost anomaly. See also: AWS API Documentation **Request Syntax** response = client.provide_anomaly_feedback( AnomalyId='string', Feedback='YES'|'NO'|'PLANNED_ACTIVITY' ) Parameters: * **AnomalyId** (*string*) -- **[REQUIRED]** A cost anomaly ID. * **Feedback** (*string*) -- **[REQUIRED]** Describes whether the cost anomaly was a planned activity or you considered it an anomaly. Return type: dict Returns: **Response Syntax** { 'AnomalyId': 'string' } **Response Structure** * *(dict) --* * **AnomalyId** *(string) --* The ID of the modified cost anomaly. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" CostExplorer / Client / get_savings_plans_utilization_details get_savings_plans_utilization_details ************************************* CostExplorer.Client.get_savings_plans_utilization_details(**kwargs) Retrieves attribute data along with aggregate utilization and savings data for a given time period. This doesn't support granular or grouped data (daily/monthly) in response. You can't retrieve data by dates in a single response similar to "GetSavingsPlanUtilization", but you have the option to make multiple calls to "GetSavingsPlanUtilizationDetails" by providing individual dates. You can use "GetDimensionValues" in "SAVINGS_PLANS" to determine the possible dimension values. Note: "GetSavingsPlanUtilizationDetails" internally groups data by "SavingsPlansArn". See also: AWS API Documentation **Request Syntax** response = client.get_savings_plans_utilization_details( TimePeriod={ 'Start': 'string', 'End': 'string' }, Filter={ 'Or': [ {'... recursive ...'}, ], 'And': [ {'... recursive ...'}, ], 'Not': {'... recursive ...'}, 'Dimensions': { 'Key': 'AZ'|'INSTANCE_TYPE'|'LINKED_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', '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', ] } }, DataType=[ 'ATTRIBUTES'|'UTILIZATION'|'AMORTIZED_COMMITMENT'|'SAVINGS', ], NextToken='string', MaxResults=123, SortBy={ 'Key': 'string', 'SortOrder': 'ASCENDING'|'DESCENDING' } ) Parameters: * **TimePeriod** (*dict*) -- **[REQUIRED]** The time period that you want the usage and costs for. The "Start" date must be within 13 months. The "End" date must be after the "Start" date, and before the current date. Future dates can't be used as an "End" date. * **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. * **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". * **Filter** (*dict*) -- Filters Savings Plans utilization coverage data for active Savings Plans dimensions. You can filter data with the following dimensions: * "LINKED_ACCOUNT" * "SAVINGS_PLAN_ARN" * "REGION" * "PAYMENT_OPTION" * "INSTANCE_TYPE_FAMILY" "GetSavingsPlansUtilizationDetails" uses the same Expression object as the other operations, but only "AND" is supported among each dimension. * **Or** *(list) --* Return results that match either "Dimension" object. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **And** *(list) --* Return results that match both "Dimension" objects. * *(dict) --* 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 three types of simple dimension values: "CostCategories", "Tags", and "Dimensions". * Specify the "CostCategories" field to define a filter that acts on Cost Categories. * Specify the "Tags" field to define a filter that acts on Cost Allocation Tags. * Specify the "Dimensions" field to define a filter that acts on the DimensionValues. * For each filter type, you can set the dimension name and values for the filters that you plan to use. * For example, you can filter for "REGION==us-east-1 OR REGION==us-west-1". For "GetRightsizingRecommendation", the Region is a full name (for example, "REGION==US East (N. Virginia)". * The corresponding "Expression" for this example is as follows: "{ "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". * **Not** *(dict) --* Return results that don't match a "Dimension" object. * **Dimensions** *(dict) --* 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. * **Values** *(list) --* The metadata values that you can use to filter and group your results. You can use "GetDimensionValues" to find specific values. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category and Anomaly Subscriptions. Refer to the documentation for each specific API to see what is supported. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **Tags** *(dict) --* The specific "Tag" to use for "Expression". * **Key** *(string) --* The key for the tag. * **Values** *(list) --* The specific value of the tag. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. "MatchOptions" is only applicable for actions related to Cost Category. The default values for "MatchOptions" are "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **CostCategories** *(dict) --* The filter that's based on "CostCategory" values. * **Key** *(string) --* The unique name of the Cost Category. * **Values** *(list) --* The specific value of the Cost Category. * *(string) --* * **MatchOptions** *(list) --* The match options that you can use to filter your results. MatchOptions is only applicable for actions related to cost category. The default values for "MatchOptions" is "EQUALS" and "CASE_SENSITIVE". * *(string) --* * **DataType** (*list*) -- The data type. * *(string) --* * **NextToken** (*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. * **MaxResults** (*integer*) -- The number of items to be returned in a response. The default is "20", with a minimum value of "1". * **SortBy** (*dict*) -- The value that you want to sort the data by. The following values are supported for "Key": * "UtilizationPercentage" * "TotalCommitment" * "UsedCommitment" * "UnusedCommitment" * "NetSavings" * "AmortizedRecurringCommitment" * "AmortizedUpfrontCommitment" The supported values for "SortOrder" are "ASCENDING" and "DESCENDING". * **Key** *(string) --* **[REQUIRED]** The key that's used to sort the data. * **SortOrder** *(string) --* The order that's used to sort the data. Return type: dict Returns: **Response Syntax** { 'SavingsPlansUtilizationDetails': [ { 'SavingsPlanArn': 'string', 'Attributes': { 'string': 'string' }, 'Utilization': { 'TotalCommitment': 'string', 'UsedCommitment': 'string', 'UnusedCommitment': 'string', 'UtilizationPercentage': 'string' }, 'Savings': { 'NetSavings': 'string', 'OnDemandCostEquivalent': 'string' }, 'AmortizedCommitment': { 'AmortizedRecurringCommitment': 'string', 'AmortizedUpfrontCommitment': 'string', 'TotalAmortizedCommitment': 'string' } }, ], 'Total': { 'Utilization': { 'TotalCommitment': 'string', 'UsedCommitment': 'string', 'UnusedCommitment': 'string', 'UtilizationPercentage': 'string' }, 'Savings': { 'NetSavings': 'string', 'OnDemandCostEquivalent': 'string' }, 'AmortizedCommitment': { 'AmortizedRecurringCommitment': 'string', 'AmortizedUpfrontCommitment': 'string', 'TotalAmortizedCommitment': 'string' } }, 'TimePeriod': { 'Start': 'string', 'End': 'string' }, 'NextToken': 'string' } **Response Structure** * *(dict) --* * **SavingsPlansUtilizationDetails** *(list) --* Retrieves a single daily or monthly Savings Plans utilization rate and details for your account. * *(dict) --* A single daily or monthly Savings Plans utilization rate and details for your account. A management account in an organization have access to member accounts. You can use "GetDimensionValues" to determine the possible dimension values. * **SavingsPlanArn** *(string) --* The unique Amazon Resource Name (ARN) for a particular Savings Plan. * **Attributes** *(dict) --* The attribute that applies to a specific "Dimension". * *(string) --* * *(string) --* * **Utilization** *(dict) --* A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible. * **TotalCommitment** *(string) --* The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts). * **UsedCommitment** *(string) --* The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period. * **UnusedCommitment** *(string) --* The amount of your Savings Plans commitment that wasn't consumed from Savings Plans eligible usage in a specific period. * **UtilizationPercentage** *(string) --* The amount of "UsedCommitment" divided by the "TotalCommitment" for your Savings Plans. * **Savings** *(dict) --* The amount saved by using existing Savings Plans. Savings returns both net savings from savings plans and also the "onDemandCostEquivalent" of the Savings Plans when considering the utilization rate. * **NetSavings** *(string) --* The savings amount that you're accumulating for the usage that's covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage. * **OnDemandCostEquivalent** *(string) --* How much the amount that the usage would have cost if it was accrued at the On-Demand rate. * **AmortizedCommitment** *(dict) --* The total amortized commitment for a Savings Plans. Includes the sum of the upfront and recurring Savings Plans fees. * **AmortizedRecurringCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with either a "Partial" or a "NoUpfront". * **AmortizedUpfrontCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with an "Upfront" or "PartialUpfront" Savings Plans. * **TotalAmortizedCommitment** *(string) --* The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method. * **Total** *(dict) --* The total Savings Plans utilization, regardless of time period. * **Utilization** *(dict) --* A ratio of your effectiveness of using existing Savings Plans to apply to workloads that are Savings Plans eligible. * **TotalCommitment** *(string) --* The total amount of Savings Plans commitment that's been purchased in an account (or set of accounts). * **UsedCommitment** *(string) --* The amount of your Savings Plans commitment that was consumed from Savings Plans eligible usage in a specific period. * **UnusedCommitment** *(string) --* The amount of your Savings Plans commitment that wasn't consumed from Savings Plans eligible usage in a specific period. * **UtilizationPercentage** *(string) --* The amount of "UsedCommitment" divided by the "TotalCommitment" for your Savings Plans. * **Savings** *(dict) --* The amount that's saved by using existing Savings Plans. Savings returns both net savings from Savings Plans and also the "onDemandCostEquivalent" of the Savings Plans when considering the utilization rate. * **NetSavings** *(string) --* The savings amount that you're accumulating for the usage that's covered by a Savings Plans, when compared to the On-Demand equivalent of the same usage. * **OnDemandCostEquivalent** *(string) --* How much the amount that the usage would have cost if it was accrued at the On-Demand rate. * **AmortizedCommitment** *(dict) --* The total amortized commitment for a Savings Plans. This includes the sum of the upfront and recurring Savings Plans fees. * **AmortizedRecurringCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with either a "Partial" or a "NoUpfront". * **AmortizedUpfrontCommitment** *(string) --* The amortized amount of your Savings Plans commitment that was purchased with an "Upfront" or "PartialUpfront" Savings Plans. * **TotalAmortizedCommitment** *(string) --* The total amortized amount of your Savings Plans commitment, regardless of your Savings Plans purchase method. * **TimePeriod** *(dict) --* The time period of the request. * **Start** *(string) --* 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. * **End** *(string) --* 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". * **NextToken** *(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. **Exceptions** * "CostExplorer.Client.exceptions.LimitExceededException" * "CostExplorer.Client.exceptions.DataUnavailableException" * "CostExplorer.Client.exceptions.InvalidNextTokenException"