GetSavingsPlansCoverage
Retrieves the Savings Plans covered for your account. This enables you to see how much of
your cost is covered by a Savings Plan. An organization’s management account can see the
coverage of the associated member accounts. The filter supports dimensions and cost
categories, combined with one level of And or Not. For details, see
Filter. For any time period, you can filter data for Savings Plans usage with
the following dimensions:
-
LINKED_ACCOUNT -
REGION -
SERVICE -
INSTANCE_TYPE_FAMILY
To determine valid values for a dimension, use the GetDimensionValues
operation.
Request Syntax
{
"Filter": {
"And": [
"Expression"
],
"CostCategories": {
"Key": "string",
"MatchOptions": [ "string" ],
"Values": [ "string" ]
},
"Dimensions": {
"Key": "string",
"MatchOptions": [ "string" ],
"Values": [ "string" ]
},
"Not": "Expression",
"Or": [
"Expression"
],
"ProductAttributes": {
"Key": "string",
"MatchOptions": [ "string" ],
"Values": [ "string" ]
},
"Tags": {
"Key": "string",
"MatchOptions": [ "string" ],
"Values": [ "string" ]
}
},
"Granularity": "string",
"GroupBy": [
{
"Key": "string",
"Type": "string"
}
],
"MaxResults": number,
"Metrics": [ "string" ],
"NextToken": "string",
"SortBy": {
"Key": "string",
"SortOrder": "string"
},
"TimePeriod": {
"End": "string",
"Start": "string"
}
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- Filter
-
Filters Savings Plans coverage data by dimensions. You can filter data for Savings Plans usage with the following dimensions:
-
LINKED_ACCOUNT -
REGION -
SERVICE -
INSTANCE_TYPE_FAMILY
GetSavingsPlansCoverageuses the same Expression object as the other operations. The filter must have one of the following shapes:-
A
DimensionsorCostCategoriesexpression. -
A
Notexpression that contains oneDimensionsorCostCategoriesexpression. -
An
Andexpression with two or more operands, where each operand has one of the two shapes above.
OrandTagsexpressions aren't supported. AnAndexpression can't contain anotherAnd, and aNotexpression can't contain anAndor anotherNot.Each dimension can appear only once in the filter, including inside
Not, and you can use only oneCostCategoriesexpression. To filter on several values of a dimension, put all of the values in one expression. Cost Explorer combines the values in one expression with OR.Type: Expression object
Required: No
-
- Granularity
-
The granularity of the Amazon Web Services cost data for your Savings Plans.
Granularitycan't be set ifGroupByis set.The
GetSavingsPlansCoverageoperation supports onlyDAILYandMONTHLYgranularities.Type: String
Valid Values:
DAILY | MONTHLY | HOURLYRequired: No
- GroupBy
-
You can group the data using the attributes
INSTANCE_TYPE_FAMILY,REGION, orSERVICE.Type: Array of GroupDefinition objects
Required: No
- MaxResults
-
The number of items to be returned in a response. The default is
20, with a minimum value of1.Type: Integer
Valid Range: Minimum value of 1.
Required: No
- Metrics
-
The measurement that you want your Savings Plans coverage reported in. The only valid value is
SpendCoveredBySavingsPlans.Type: Array of strings
Length Constraints: Minimum length of 0. Maximum length of 1024.
Pattern:
[\S\s]*Required: No
- NextToken
-
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.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
[\S\s]*Required: No
- SortBy
-
The value that you want to sort the data by.
The following values are supported for
Key:-
SpendCoveredBySavingsPlan -
OnDemandCost -
CoveragePercentage -
TotalCost -
InstanceFamily -
Region -
Service
The supported values for
SortOrderareASCENDINGandDESCENDING.Type: SortDefinition object
Required: No
-
- TimePeriod
-
The time period that you want the usage and costs for. The
Startdate must be within 13 months. TheEnddate must be after theStartdate, and before the current date. Future dates can't be used as anEnddate.Type: DateInterval object
Required: Yes
Response Syntax
{
"NextToken": "string",
"SavingsPlansCoverages": [
{
"Attributes": {
"string" : "string"
},
"Coverage": {
"CoveragePercentage": "string",
"OnDemandCost": "string",
"SpendCoveredBySavingsPlans": "string",
"TotalCost": "string"
},
"TimePeriod": {
"End": "string",
"Start": "string"
}
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- NextToken
-
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.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 8192.
Pattern:
[\S\s]* - SavingsPlansCoverages
-
The amount of spend that your Savings Plans covered.
Type: Array of SavingsPlansCoverage objects
Errors
For information about the errors that are common to all actions, see Common Error Types.
- DataUnavailableException
-
The requested data is unavailable.
HTTP Status Code: 400
- InvalidNextTokenException
-
The pagination token is invalid. Try again without a pagination token.
HTTP Status Code: 400
- LimitExceededException
-
You made too many calls in a short period of time. Try again later.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: